Skip to content

docs: trim agent context files for token efficiency - #21

Merged
kuladeepmantri merged 1 commit into
mainfrom
docs/trim-agent-context
Jul 22, 2026
Merged

kuladeepmantri merged 1 commit into
mainfrom
docs/trim-agent-context

Conversation

@kuladeepmantri

Copy link
Copy Markdown
Collaborator

Summary

Token-lean pass over the repo's agent instruction files, audited against Anthropic's current CLAUDE.md and skill-authoring guidance (files under 200 lines, no restated rules, no stale sections, invariants instead of change narration).

What changed

  • crates/evalcore-core/CLAUDE.md (807 -> 584 words): the target.rs / http_target.rs bullets had grown into change-log narration; they are now two grouped invariant sections (HTTP targets, cache_identity). The embedded HTTP-target YAML example is gone since the site reference (reference/configuration.md) owns it. The Roadmap hooks section described the record/replay cache as future work; it shipped in evalcore-store, so the section is deleted.
  • .claude/agents/rust-reviewer.md, test-engineer.md (and the .codex mirrors): both restated the root CLAUDE.md architecture and testing rules that subagents already receive, so every spawn paid for the rules twice and the copies had drifted. They now enforce the root rules by pointer and keep only agent-specific checks.
  • CLAUDE.md (756 -> 682 words): prose tightened, every fact kept.

Why

The root file loads every session and crate files load on entry; duplicated and narrated content is a recurring token tax and a drift risk. One home per fact.

How to test

Docs-only diff (markdown/TOML). CI should stay green; rg 'Roadmap hooks|PRD §6' confirms nothing references the deleted section.

Risks & follow-ups

Low risk. Follow-up candidate: README does not document the type: http target (site docs do).

🤖 Generated with Claude Code

Audit against Anthropic's CLAUDE.md/skill guidance (under-200-line
files, no restated rules, no time-sensitive info, invariants over
change narration):

- evalcore-core/CLAUDE.md: rewrite target.rs/http_target.rs
  change-narration as grouped invariants, drop the YAML example the
  site reference already owns, delete the stale Roadmap hooks
  section (the cache shipped in evalcore-store long ago).
- rust-reviewer/test-engineer (+ codex mirrors): stop restating the
  root architecture/testing rules subagents already receive; keep
  only agent-specific checks.
- root CLAUDE.md: tighten prose (756 -> 682 words), no facts
  removed.

Co-Authored-By: Claude <noreply@anthropic.com>
@kuladeepmantri
kuladeepmantri merged commit c52d2c1 into main Jul 22, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant