harness-cleaner
Skill1 starsChanged 24 days agoMITView on GitHub
Audit and shrink the agent definitions, AGENTS.md and process rules in this repo: size against budget, duplicated rules, contradictions. Use when a size-budget check fails, after adding rules, on a weekly or monthly cleanup, or when the user says cleanup, audit, bloat or contradiction.
In this repository18 other files it gives its agents.
- AGENTS.mdAGENTS.md
- context7-cliSkill
- decision-protocolSkill
- frontend-designSkill
- gitlab-accessSkill
- hallmarkSkill
- image-genSkill
- k8s-debugSkill
- retroSkill
- sdd-workflowSkill
- ste100Skill
- teammate-protocolSkill
- team-wikiSkill
- technical-seoSkill
- ux-copySkill
- vector-genSkill
- web-design-guidelinesSkill
- writing-for-agentsSkill
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 0 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 12
Run python3 .claude/scripts/check_harness.py.
- Very specific: line 15
Stale rules and fold-ins: Run the stale-rule probe and read the role evidence in .claude/process/fold-in-review.md.
- Very specific: line 16
Proposals: Write one line per change: file, rule, action (merge, remove, point), bytes saved.
- Very specific: line 17
Close: After approved edits, regenerate ports (.opencode/sync-agents.py, .codex/sync-agents.py), run check_harness.py --ratchet-budget, …
≈ “Common” is an estimate: at least 1 in 5 of the 372,429 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Harness cleaner
Agent definitions and AGENTS.md load in full on every spawn, so each byte costs on every run. This skill finds what to merge or remove. It proposes; the stakeholder approves each change.
Run
- Run
python3 .claude/scripts/check_harness.py. Budget breaches print asexceeds budget. List the five largest files and their growth since the last budget commit:git log -p --follow -3 -- .claude/scripts/size-budget.json. - Duplicates. For each file in step 1, list rules restated elsewhere. Search
(→ RP-nn)citations that appear inAGENTS.mdand in an agent file, and rules in an agent file that.claude/process/*.mdor a preloaded skill already state. Keep one source of truth; replace the other with a pointer. - Contradictions. Group the rules by situation (dispatch, review, merge, status, wiki, copy, GitLab). Spawn one fresh
general-purposeagent per group with the rule texts only. Ask: "List pairs of instructions that cannot both be followed. Quote both." Check each reported pair against the files before you act on it. - Stale rules and fold-ins. Run the stale-rule probe and read the role evidence in
.claude/process/fold-in-review.md. Propose at most one batch of insurance rules and at most one role fold-in per run. - Proposals. Write one line per change: file, rule, action (merge, remove, point), bytes saved. Present them to the stakeholder in the
decision-protocolformat. Apply only approved changes. - Close. After approved edits, regenerate ports (
.opencode/sync-agents.py,.codex/sync-agents.py), runcheck_harness.py --ratchet-budget, thencheck_harness.pyand the unit tests. Commit the lowered budget with the edits.
Done when every file is at or under its budget, every contradiction pair has a disposition (fixed, or kept with a reason), and the commit carries the lowered size-budget.json.
Raising a budget
A rule that must grow its file raises that file's entry in .claude/scripts/size-budget.json by hand. The commit message names the reason and what was considered for removal. --ratchet-budget never raises.
Weekly digest
Run python3 .claude/scripts/agent_digest.py once a week, or at the start of a cleaner run. It reads Claude Code's own subagent transcripts, so it costs no tokens and needs no change to any agent. A flag (!) names an agent whose volume fell, whose tool errors, steps or duration rose, or whose runs did not finish, against the four weeks before.
A flag is a lead, not a verdict. Open the agent's latest transcripts, find what changed, and check whether a recent edit to its definition or to a shared rule explains it (git log -p -- .claude/agents/<name>.md). A drop to zero can mean the agent was not needed that week.
Rules that no run cites cannot be found this way: an obeyed rule is never quoted. Do not guess dead rules.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

