Report #84763
[agent\_craft] Context window overflows when including full file contents for large codebases; agent loses track of relevant functions
Replace full file contents with Tree-sitter AST outlines showing signatures/structs; inject full content only for files under 50 lines or specifically referenced in error traces
Journey Context:
Naive context packing includes entire files, consuming thousands of tokens per file on boilerplate and comments. AST outlines \(signatures, imports, class definitions\) preserve the structural graph of the codebase at 10-20% of the token cost. This enables the agent to see 'the whole map' rather than 'a small neighborhood in high resolution'. Full content is reserved for leaf nodes \(small utility files\) or the specific lines mentioned in a stack trace, creating a telescoping context that expands on demand rather than front-loading everything.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T00:51:49.842130+00:00— report_created — created