prune-context-file
4
总安装量
3
周安装量
#54350
全站排名
安装命令
npx skills add https://github.com/richardbray/skills --skill prune-context-file
Agent 安装分布
opencode
3
gemini-cli
3
claude-code
3
github-copilot
3
codex
3
kimi-cli
3
Skill 文档
Prune Context File
Audit and prune a CLAUDE.md or AGENTS.md file using findings from Gloaguen et al. (2025), the first rigorous study of whether context files improve coding agent performance.
Evidence Base (key findings)
- LLM-generated context files reduce performance by 0.5â2% and increase cost 20%+. Never suggest auto-generating a context file.
- Developer-written files marginally help (+4% avg) â except for Claude Code, which showed no benefit from developer-written files either.
- Codebase overviews don’t work. Agents find relevant files at the same speed with or without directory listings and project structure sections.
- Context files are redundant with existing docs. They only help when a repo has no other documentation at all.
- Tooling instructions are reliably followed. Naming a specific tool (e.g.
uv,pytest, a repo CLI) increases its usage 1.6â2.5Ã vs. not naming it. This is the highest-value content. - Instructions cause more testing and exploration, increasing steps and cost. Unnecessary requirements make tasks harder.
Paper: “Evaluating AGENTS.md” â Gloaguen et al., arxiv.org/abs/2602.11988
The Decision Test
For every line or section, ask: Would the agent write different code, run different commands, or make different assumptions without this?
- Yes â keep it
- No / agent can discover it from the codebase â cut it
Classification
Cut (low value)
- Directory listings and project structure sections
- Tech stack entries discoverable from
package.json/requirements.txt/go.mod(e.g. React, Express, Tailwind, TypeScript) - Links to docs files the agent can find itself
- General coding standards Claude already applies by default (e.g. “use descriptive variable names”, “avoid magic numbers”)
- Project overview prose beyond one sentence
Keep (high value)
- Specific commands: build, test, migrate, seed, lint â only if non-obvious or not already expressed as
package.json/Makefile/ config scripts the agent can read directly - Non-obvious tooling: libraries or CLIs the agent wouldn’t default to (e.g. Better Auth vs. Passport,
uvvs.pip) - Architectural constraints that would cause wrong assumptions if missing (e.g. non-standard i18n strategy, monorepo layout quirks)
- Behavioral rules: git workflow, PR requirements, test requirements â things that must be enforced, not inferred
- Project-specific conventions the agent can’t infer from code alone
Process
- Read the target context file
- Classify each section and bullet against the Cut/Keep criteria above
- Present a proposed diff: list what you’d remove and why (one line per item)
- Wait for approval before rewriting
- Write the pruned file, keeping the same structure but leaner
Output Format
When presenting the proposed changes, group by action:
REMOVE
- [Section/item] â [one-line reason]
KEEP
- [Section/item] â [one-line reason]
REWRITE
- [Section/item] â [what it becomes] â [one-line reason]
Then ask for confirmation before applying.