To build a working mental model of an unfamiliar Astro repository without reading every file, Atlas leverages its semantic index, allowing you to query concepts directly. It then guides you through key Astro files like "astro.config.mjs" and "src/content.config.ts", using tools like "glob" and "read", before delegating wider exploration to a read-only subagent. This approach helps Astro developers quickly grasp project structure and logic, integrating with "pnpm" for package management and "vitest" for testing.
How does Atlas semantically search an Astro codebase?
Atlas helps Astro developers in 2026 quickly grasp unfamiliar codebases by starting with meaning, not just filenames. Its "codebase_search" tool queries a semantic index built using tree-sitter, allowing you to ask plain-language questions about Astro concepts like 'how requests are authenticated' or 'where are the 3 main content collections defined'.
Atlas's "codebase_search" tool is your initial entry point into an unfamiliar Astro project. Instead of blindly opening files, you can ask a plain-language question, such as 'how are requests authenticated in this Astro project?'. Atlas queries its semantic index, which is built by parsing AST declarations using tree-sitter, not blind line windows. This means Atlas understands the structure of your `.astro` components, `src/content.config.ts` schemas, and `astro.config.mjs` integrations. The tool returns ranked snippets with file paths, pointing you directly to the most relevant code, whether it is a specific `.astro` island or a configuration file. Atlas can build this code index with local Ollama embeddings, ensuring your Astro codebase remains off third-party servers.
How to map Astro project structure with Atlas glob?
After an initial semantic search, Atlas helps you map the physical layout of an Astro project using the "glob" tool. This allows you to quickly inspect top-level directories and understand naming conventions, such as identifying "src/pages" for routing or "src/content" for content collections, all within 1 to 2 commands.
Once "codebase_search" has given you a conceptual starting point, the "glob" tool helps you understand the physical layout of the Astro repository. Running `glob 'src/*'` will quickly reveal the common Astro directory structure, showing you `src/pages` for file-based routing, `src/components` for reusable UI elements, `src/layouts` for page templates, and `src/content` for content collections. This step is crucial for building a mental model of where `.astro` components, Markdown, MDX, or other assets are organized. It allows you to grasp the project's conventions and anticipate where specific types of Astro-related code reside before you even open a file.
How to safely explore an Astro codebase with subagents?
For wider, read-only sweeps across an unfamiliar Astro codebase, Atlas delegates work to the "explore" subagent, which operates with a deny-by-default permission set. This ensures that while the subagent can `grep` for specific patterns across `.astro` files or `glob` for new directories, it cannot make any changes, providing a safe environment for exploration in 2026.
When you need to perform broad investigations without the risk of accidental modifications, Atlas's "explore" subagent is invaluable. This subagent is defined with a deny-by-default permission set, meaning it can only execute explicitly allowed tools like `grep`, `glob`, `read`, `bash`, `webfetch`, and `websearch`. This read-only constraint makes it ideal for tasks such as `explore task 'grep for all client:load directives in .astro files'` to understand hydration patterns, or `explore task 'find all instances of Zod schemas in src/content'` to map data validation. The "explore" subagent fans out work to subagents that can run in the foreground or in parallel background sessions, allowing for efficient and safe wide-ranging inquiries across your Astro project.
How does Atlas ensure safety and review in Astro?
Atlas prioritizes safety and transparency throughout the onboarding process, ensuring every proposed change, even minor ones like dropping a `client:load` directive in an `.astro` component, is permission-gated. Before any file is written, Atlas computes a unified diff, which you must approve, providing 100% control over modifications in your Astro project.
Safety is a core tenet of Atlas. Every Atlas tool call is permission-gated against allow, ask, and deny rules before it runs. When Atlas drafts a plan, it does so in a read-only plan agent, asking for your approval before switching to a build agent that can make changes. For any proposed modification, such as letting Atlas add a Zod schema to a content collection in `src/content.config.ts` and running `astro check`, or dropping an unnecessary `client:load` directive in an `.astro` component, Atlas computes a unified diff. This diff is surfaced for your approval, giving you 100% control over what gets written to your Astro codebase. Atlas also snapshots file changes as git patches, so edits can be diffed and rolled back, and can even stage and create commits on your behalf, ensuring a secure and auditable workflow.
Step by step
- 01Run atlas in a project with an astro.config.mjs to allow Atlas to index your Astro codebase.
- 02Ask codebase_search "how are requests authenticated in this Astro project?" to get semantic pointers to relevant `.astro` files or configuration.
- 03Run glob 'src/*' to understand the layout of `src/pages`, `src/content`, and `src/components` within the Astro project.
- 04Read the top 2 to 3 files identified by codebase_search, such as `astro.config.mjs` or `src/content.config.ts`, then use lsp goToDefinition to follow imports within `.astro` components.
- 05Delegate a wide search to the explore subagent: task 'grep for all instances of client:load directives in .astro files' to understand hydration patterns safely.
- 06Record your insights and open questions using todowrite, for example: 'TODO: Investigate the purpose of the custom Astro integration in astro.config.mjs'.
- 07Review any proposed changes, approve the diff, and let Atlas format with prettier (prettier-plugin-astro) if modifications were made to maintain code style.
Frequently asked questions
- How does Atlas understand Astro-specific files like .astro components?
- Atlas indexes code by AST declarations using tree-sitter, allowing it to understand the structure and content of `.astro` files, content collection schemas in `src/content.config.ts`, and `astro.config.mjs` integrations, rather than just treating them as plain text.
- Can Atlas help me understand Astro content collections?
- Yes, Atlas can read your `src/content.config.ts` to understand content collection schemas and even assist in adding a Zod schema to a content collection, running `astro check` behind a permission prompt to validate changes.
- Is it safe to let Atlas explore my Astro codebase?
- Absolutely. Atlas's `explore` subagent operates with a deny-by-default permission set, allowing only read-only operations like `grep` and `glob`. It cannot modify any files in your Astro project without explicit approval.
- How does Atlas integrate with Astro's build process or package manager?
- While Atlas focuses on code understanding and modification, it recognizes and works within your existing Astro environment. It understands `pnpm` as the package manager and can prompt for `astro check` or `prettier (prettier-plugin-astro)` for formatting, integrating with your established toolchain.
- What if Atlas makes a change I don't like in my Astro project?
- Atlas computes a unified diff for every file edit and surfaces it for your approval before writing. You have 100% control, and Atlas also snapshots file changes as git patches, so edits can be diffed and rolled back easily.
- Can Atlas help me refactor Astro components or directives?
- Yes, Atlas can assist with specific tasks like dropping an unnecessary `client:load` directive so a component ships as static HTML instead of an island, or suggesting changes to `src/pages` routes, always with a diff for your review.
- How does Atlas handle Astro's zero-JS-by-default rendering model?
- Atlas understands Astro's rendering model through its AST indexing. It can identify `.astro` islands and client directives, and can even propose modifications to ensure components ship as static HTML when appropriate, aligning with Astro's core principles.
Try Atlas in your terminal
The terminal-native AI coding agent. Free core, single binary.
Install AtlasRelated guides
Onboard to an Unfamiliar Codebase with Atlas in 2026
How to onboard to an unfamiliar codebase with Atlas in 2026: use codebase_search, glob, read, lsp, task, and todowrite to build a mental model fast.
Atlas for Astro: Islands, Content Collections, and Zero JS by Default in 2026
Atlas is a terminal-native AI coding agent for Astro in 2026. It reads astro.config.mjs, src/pages, and content collection schemas, drops needless client:load directives, and runs astro check.
Locate where a behavior is implemented in Astro with Atlas in 2026
For Astro developers in 2026, Atlas helps you pinpoint exact code implementations. Use semantic search, grep, and LSP tools to find files and symbols responsible for any behavior across .astro islands and content
Document an Astro Module with a README in 2026 using Atlas
Generate accurate, up-to-date READMEs for your Astro modules in 2026 with Atlas. Leverage `pnpm`, `vitest`, and `prettier` to document what your code *actually* does today, not what it was supposed to do a year ago.
Write Unit Tests for Untested Astro Code in 2026 with Atlas
In 2026, Astro developers use Atlas to add `vitest` unit tests to untested modules. Atlas identifies existing conventions, writes new spec files, and runs tests with `pnpm`.
Extract a Shared Helper from Duplicated Code in Astro with Atlas in 2026
Refactor duplicated logic in your Astro project into a single, tested helper using Atlas. Find semantic duplicates across .astro files, create new modules, and replace copies with calls, all while integrating with
Review a Pull Request in Astro with Atlas in 2026
Atlas empowers Astro developers in 2026 to review pull requests comprehensively, catching subtle bugs by integrating with `vitest`, `pnpm`, and `prettier (prettier-plugin-astro)`.
Trace a Runtime Bug from a Stack Trace in Astro with Atlas in 2026
Pinpoint and fix runtime bugs in your Astro projects using Atlas, the terminal-native AI coding agent. Go from a production stack trace to a solution, leveraging Astro's toolchain like vitest and pnpm.