Large CLAUDE.md Files Slow Down Claude Code; Weekly Byte Tracking Can Help
Claude Code automatically injects the full contents of several configuration and rules files at the start of every session, meaning context size grows silently each time a rule is added. A developer discovered on July 11, 2026, that their total injected context had surpassed 40KB, with 99 supposedly archived agents still being loaded, causing noticeable performance degradation. The root problem is that bloat remains invisible without active measurement, as archived files stored in subdirectories under the agents folder continue to load regardless. To address this, the developer built a weekly automated script that measures injected byte counts and agent totals, then triggers a self-correction routine whenever predefined thresholds are exceeded. The approach uses configurable environment variables for thresholds, making it easy to tune without modifying the underlying script.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in