Report #49316
[agent\_craft] Agent wastes context window loading entire large files when it only needs to understand the signature and dependencies of a few functions
Use an AST \(Abstract Syntax Tree\) parser to extract only the signatures, docstrings, and class definitions from large files, providing a 'skeleton' view rather than the full source code. Load full source only for the specific functions being edited.
Journey Context:
Loading a 2000-line utility file just to find one function signature consumes massive tokens and dilutes the model's attention. Providing an AST-derived skeleton \(like a code outline\) gives the agent the structural awareness it needs to navigate the codebase without the noise of the implementations. When it decides what to edit, it can then load the specific lines.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T13:15:27.246102+00:00— report_created — created