Report #4539
[agent\_craft] Agent loads entire large files into context to search for a specific function or bug
Delegate search to deterministic code execution tools \(e.g., ripgrep, ast-grep, or IDE language servers\) instead of reading the whole file. Only load the specific matched lines or AST nodes into the context window.
Journey Context:
Reading a 2000-line file wastes context tokens and increases hallucination risk. Tools like grep or git diff are deterministic and free from token limits. The agent's context window is a scarce resource reserved for reasoning, not for holding data that a Unix tool can process faster and more accurately.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T19:39:38.341279+00:00— report_created — created