Atlas chunks code by parsing it. Using tree-sitter, it emits 1 chunk per right-sized declaration, a function, class, or method, and falls back to line windows only for the gaps between them. The result is that a search hit is a complete unit of code with a name, instead of 40 lines that happen to start and end in the middle of two different functions.
What fixed line windows get wrong
Splitting a file every 40 lines is 1 rule applied to code that does not follow it. Boundaries land mid-function, so a single function becomes 2 partial chunks and neither one contains the whole behavior a query is looking for.
The damage shows up as retrieval that is technically correct and practically useless. A search matches the half of a function containing the keyword, and the half containing the logic that answers the question sits in an adjacent chunk that did not score high enough to be returned. You get a citation to a fragment and have to go read the file anyway.
Parsing instead of counting
Atlas runs tree-sitter over a file and emits 1 chunk per declaration that is a sensible size, naming each chunk after the symbol it contains. A 200-line class and a 6-line helper each become their own unit rather than being cut to a common length.
Because the boundaries follow the language's own structure, a retrieved chunk is something a developer would recognize as a thing: this function, that class. That makes results readable on their own, and it makes the symbol name available as an additional signal for both ranking and display.
The fallback that keeps coverage complete
Not everything in a file sits inside a declaration. Imports, top-level constants, and configuration blocks are line-windowed instead, so AST chunking adds structure where structure exists without leaving the other 100 percent of the file unindexed.
This is why the fallback matters as much as the parser. A purely AST-based index quietly drops whatever the grammar does not model, and the omissions are invisible until a search for a constant returns nothing. Covering the gaps means the index never regresses against a simpler approach.
Frequently asked questions
- How does Atlas split code for indexing?
- Atlas uses tree-sitter to emit one chunk per declaration, such as a function, class, or method, and line-windows the gaps between declarations.
- Why is AST chunking better than fixed line windows?
- Line windows cut through the middle of functions, so a match often lands in a fragment. AST chunks are complete, named units of code.
- Does anything in a file go unindexed?
- No. Code outside declarations, such as imports and top-level constants, is covered by a line-window fallback.
- Do chunks keep the symbol name?
- Yes. Each declaration chunk is named after the symbol it contains, which makes results identifiable and gives ranking an extra signal.
Try Atlas in your terminal
The terminal-native AI coding agent. Free core, single binary.
Install AtlasRelated guides
Atlas with OpenAI o3-pro: The $20 / $80 Reasoning Escape Hatch (2026)
OpenAI o3-pro in Atlas costs $20 per Mtok input and $80 per Mtok output on a 200K context. A one shot escape hatch for hard problems, not an interactive default.
Atlas with Kimi K2.6: The Generalist Reasoning Tier in 2026
Kimi K2.6 drives Atlas at $0.95 per Mtok input and $4.00 per Mtok output on a 256K tokens (262,144) window. The generalist pick when the job is not purely code.
Atlas with NVIDIA Nemotron 3 Nano 30B A3B in 2026
Nemotron 3 Nano 30B A3B in Atlas, 2026: 3B active parameters at $0.05/$0.20 per Mtok on DeepInfra, free on NVIDIA NIM, up to 1,048,576 tokens on Ollama Cloud.
Atlas with IBM Granite 4.1 8B in 2026
IBM Granite 4.1 8B in Atlas, 2026: a dense 8B model at $0.05/$0.10 per Mtok with a 131,072 token context where max output equals the full window.
Atlas for Flutter in 2026
Discover Atlas for Flutter in 2026. This terminal-native AI coding agent helps Flutter developers build apps faster and safer, integrating with widgets, state, and the Dart toolchain.
Atlas for FastAPI in 2026
Atlas is a terminal-native AI coding agent for FastAPI in 2026. It reads Pydantic v2 models and Depends(), then runs pytest behind a permission prompt.
Atlas for Polars: Terminal-Native AI Coding in 2026
Atlas is a terminal-native AI coding agent for Polars. Build LazyFrame chains, push scan_csv predicates into the reader, and read explain() plans in 2026.
Atlas with Command R: The $0.15 per Mtok Background Model for 2026
Command R runs Atlas background work at $0.15 per Mtok input and $0.6 per Mtok output, with a 128,000 token context and a 4,000 token output cap on patches.