The two biggest recurring failures in long coding-agent sessions are context size (once auto-compaction triggers, accuracy drops fast) and context rot (keeping the model focused on the actual task instead of unrelated background rules).
Most of my experiments here aim at one target: keep instructions evidence-based, avoid throwing paint at the canvas, and load the right info only at the moment the agent needs to act on it.
The problem with eager auto-loading
The official guidance matches what I've seen in practice: concise, specific instructions outperform long files, and instruction files above ~200 lines start hurting adherence.
Auto-loaded markdown files (CLAUDE.md, .claude/rules/, auto-memory) can still pull in heavy context at the wrong time:
- Reading a file under
_infra/shouldn't automatically dump Kubernetes runbooks if you're just checking a port number. - Opening a test file shouldn't load your entire Jest conventions doc if you're only inspecting a fixture.
Potential patterns for non-blocking rules
Two harness features make rule loading modular without getting in the way of teammates who rely on checked-in repo files:
- Toggleable symlinked rules:
.claude/rules/resolves symlinks cleanly, so personal, architectural, and project-specific rules can live in a central repo and be toggled per project via a small CLI without polluting shared git history. - Local exclusions: Using per-machine exclusion patterns lets checked-in team docs stay in git for everyone else while skipping automatic preload in workflows that already load context on demand.