# Onboard to an Unfamiliar Axum Codebase in 2026 with Atlas

> Atlas helps Axum developers in 2026 quickly build a mental model of unfamiliar codebases by starting with semantic search and integrating directly with `cargo nextest` and `rustfmt`.

To build a working mental model of an unfamiliar Axum repository in 2026 without reading every file, Atlas starts from meaning, not filenames. It leverages semantic search, then guides you through the codebase using real Axum toolchain commands like `cargo nextest` for testing, `cargo` for package management, and `rustfmt` for formatting, ensuring you recognize your own development environment.

## Key takeaways

- Atlas uses `codebase_search` to semantically query Axum code, not just filenames.
- The `glob` tool quickly reveals the Axum project's directory structure and `Cargo.toml` dependencies.
- Atlas integrates with `lsp` to follow `goToDefinition` for Axum `Extractor` and `State` types.
- The `explore` subagent provides safe, read-only wide sweeps of an Axum codebase.
- Atlas directly invokes `cargo nextest run` and `rustfmt` for Axum project validation and formatting.
- All Atlas tool calls are permission-gated, ensuring control over Axum codebase modifications.

## How does Atlas help me understand an Axum codebase's structure?

Atlas helps you understand an Axum codebase's structure by starting with a high-level overview, then drilling down into specifics. In 2026, it uses `glob` to map the directory shape and naming conventions, providing a crucial first look before you open any files.

When approaching an unfamiliar Axum project, the initial challenge is grasping its overall layout. Atlas addresses this by first running the `glob` tool on the top-level directories. This reveals the package structure and common naming conventions, such as `src/handlers`, `src/models`, or `src/middleware`, which are typical in Axum applications. This step provides a foundational understanding of where different components of the application reside, allowing you to form an initial mental map without diving into file contents. For instance, you might quickly identify the main `src/main.rs` or `src/lib.rs` files, along with `Cargo.toml` which defines the project's dependencies, including `axum` and `tower`.

## How do I find specific Axum handler logic or authentication flows?

To pinpoint specific Axum handler logic or authentication flows, Atlas employs `codebase_search` to query its semantic index. This tool returns ranked snippets with file paths, allowing you to quickly locate relevant code without manually sifting through dozens of files in 2026.

Instead of guessing file names or using keyword-only searches, Atlas's `codebase_search` tool allows you to ask plain-language questions like 'how requests are authenticated' or 'where is the main `Router` defined?'. Atlas searches its hybrid semantic and keyword index, built by AST declarations using tree-sitter, to find the most relevant code snippets. It can even build this index with local Ollama embeddings, keeping your code off third-party servers. The results include file paths, enabling you to prioritize reading the two or three files `codebase_search` ranked highest. This is particularly effective for Axum, where handlers are plain async functions and the core logic often revolves around the `Router` and `State` types.

## How does Atlas help me navigate Axum's `tower` Service trait bounds and `Extractor` types?

Atlas helps navigate Axum's complex `tower` Service trait bounds and `Extractor` types by integrating with the Language Server Protocol (LSP). After reading initial files, you can use the `lsp` tool's `goToDefinition` operation to follow imports and understand type definitions, a critical step in 2026 for Rust development.

Once you have identified key files using `codebase_search` and `glob`, Atlas allows you to `read` those files. For an Axum project, this might involve `src/main.rs` or a module defining your `Router`. From there, the `lsp` tool becomes invaluable. You can use `goToDefinition` to jump directly to the definition of a `State` type, an `Extractor` implementation, or a custom `IntoResponse` error type. This is crucial for understanding how data flows through your Axum handlers and how the `tower` Service trait bounds are satisfied. Atlas can even help you decode trait-bound errors you might encounter when a handler argument is not a valid `Extractor`, and then assist in fixing the signature.

## How does Atlas ensure safety and review when exploring an unfamiliar Axum codebase?

Atlas ensures safety and review by making every tool call permission-gated and by using a read-only plan agent. The `explore` subagent, designed for wide sweeps, operates with a deny-by-default permission set, allowing only 6 specific tools like `grep` and `read` in 2026.

Safety is paramount when exploring new code. Atlas implements a robust permission system: every tool call is permission-gated against allow, ask, and deny rules before it runs. When you delegate wide sweeps to the `explore` subagent through the `task` tool, it operates with a deny-by-default permission set. This means it can only use explicitly allowed tools such as `grep`, `glob`, `read`, `bash`, `webfetch`, and `websearch`, preventing unintended modifications. Furthermore, Atlas drafts a plan in a read-only plan agent and asks for your approval before switching to a build agent. Any file edits proposed by Atlas are presented as a unified diff for your approval before writing, and changes are snapshotted as git patches for easy rollback.

## How can Atlas help me test and format an Axum project?

Atlas can help you test and format an Axum project by integrating directly with the Rust toolchain. It can run `cargo nextest run` behind a permission prompt and then automatically `rustfmt` any generated diffs, ensuring your code adheres to standards in 2026.

After making changes or understanding a section of the codebase, validating its behavior is essential. Atlas allows you to run the project's tests using the actual Axum toolchain. You can instruct Atlas to run `cargo nextest run`, which it will execute only after a permission prompt. This ensures you retain control over potentially destructive operations. Once changes are made and approved, Atlas can then `rustfmt` the unified diff, ensuring that any new or modified code adheres to the project's formatting standards. This integration with `cargo nextest` and `rustfmt` means Atlas works direct within your existing Rust development workflow, rather than imposing a new one.

## Steps

1. Run `atlas` in your Axum crate's directory, ensuring `Cargo.toml` depends on `axum` and `tower`.
2. Ask `codebase_search` a plain-language question, such as 'how requests are authenticated in Axum', to get ranked file snippets.
3. Run `glob` on the top-level directories to understand the Axum project's package layout and naming conventions.
4. Use `read` to open the two or three Axum files `codebase_search` ranked highest, focusing on `Router` and `State` definitions.
5. Follow imports and type definitions with the `lsp` tool's `goToDefinition` operation to trace Axum handler logic and `Extractor` usage.
6. Delegate wider exploration, like finding all `tower` layers, to the `explore` subagent using the `task` tool, which operates with read-only permissions.
7. Record your findings and open questions as a `todowrite` list to maintain context across Atlas turns.
8. Have Atlas run `cargo nextest run` to validate changes, approving the permission prompt, then `rustfmt` the resulting diff for consistency.

## FAQ

### How does Atlas handle Axum's `tower` Service trait bounds?

Atlas understands the structure of Rust code through AST declarations. When you encounter trait-bound errors related to `tower` Service, Atlas can help decode the error and suggest fixes for handler signatures, especially when an argument isn't a valid `Extractor`.

### Can Atlas help me understand custom Axum `State` types?

Yes, after using `codebase_search` to find where your `State` type is defined, you can use the `lsp` tool's `goToDefinition` to navigate directly to its declaration. Atlas can then help you understand its fields and how it's threaded through your Axum handlers.

### How does Atlas ensure my Axum code stays formatted correctly?

Atlas integrates directly with `rustfmt`. After any code modifications, Atlas can compute a unified diff and then apply `rustfmt` to that diff, ensuring your Axum project adheres to the standard Rust formatting conventions without manual intervention.

### Is it safe to let Atlas modify my Axum project?

Yes, Atlas is designed with safety in mind. Every tool call is permission-gated, and it drafts plans in a read-only agent first. Any proposed file edits are presented as a unified diff for your explicit approval before writing, and changes are snapshotted as git patches for easy rollback.

### Can Atlas run `cargo nextest` for my Axum tests?

Absolutely. Atlas can run `cargo nextest run` to execute your Axum project's tests. This operation is permission-gated, meaning Atlas will ask for your explicit approval before running the tests, giving you full control over the execution environment.

### How does Atlas find relevant files in a large Axum repository?

Atlas uses `codebase_search` which queries a hybrid semantic and keyword index built from AST declarations. This allows it to understand the meaning of your plain-language questions, like 'where are the Axum `Router` definitions?', and return highly relevant file paths, even in large repositories.

### What if I need to explore widely without making changes?

For wide exploration, you can delegate tasks to the `explore` subagent using the `task` tool. This subagent operates with a deny-by-default permission set, allowing it only to `grep`, `glob`, `read`, `bash`, `webfetch`, and `websearch`, ensuring it cannot accidentally modify your Axum codebase.

---

Canonical HTML: https://runatlas.sh/resources/stacks/onboard-to-an-unfamiliar-codebase-in-axum
Source of truth: aeo_pages row `/resources/stacks/onboard-to-an-unfamiliar-codebase-in-axum` (segment: Stacks) (this file is generated from it, never hand-edited).
Licence: Atlas is proprietary with a free core. It is not open source and there is no public source repository.
