Report #64544
[agent\_craft] Loading entire large files like package-lock.json, massive logs, or data files into the context window
Treat the file system as a database. Delegate search and processing of large files to external tools \(grep, ripgrep, AST parsers, python scripts\) and only load the filtered results into the agent's context.
Journey Context:
Agents using a read\_file tool out of habit will immediately flood the context with thousands of lines of boilerplate, causing context rot, high latency, and cost. The agent should use bash/code execution to query the file system \(e.g., grep -n 'ERROR' server.log\) and only ingest the highly relevant output.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T14:49:14.739192+00:00— report_created — created