claude-edit
Skill0 starsChanged 6 months agoMITView on GitHub
Modify the project's `CLAUDE.md` (or `~/.claude/CLAUDE.md` user-level) based on a natural-language request. Triggered by /claude-edit. Backs up the file, uses the Edit tool (with built-in diff and permission prompt), and invalidates the dashboard cache. Use when the user wants to change the project charter — adding, removing, or rewording principles, rules, or constraints.
In this repository3 other files it gives its agents.
- agent-createSkill
- agent-editSkill
- dashboardSkill
The file
We split this skill into the rules it gives an agent
11 rules. About 0 are common, 8 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈8
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 25
Search in this order, take first match:
- Very specific: line 31
Ask if they want to create one (note: this skill does not create new files.
- Distinctive: line 36
Use the Read tool on the resolved path.
- Distinctive: line 52
If unclear ("rewrite section X" without saying how), ASK before editing.
- Distinctive: line 72
Use the Edit tool. The diff is shown to the user.
- Very specific: line 76
If the project has agents (.claude/agents/*.md exists), remind the user that the CLAUDE.md change may invalidate previously-computed …
- Distinctive: line 92
Single-file scope: Only modifies the resolved CLAUDE.md.
- Distinctive: line 93
Backup mandatory: Always before Edit.
- Distinctive: line 94
Preserve unmodified sections: If user asks to change one principle, leave the others alone.
- Distinctive: line 95
No silent destruction: If the request implies removing a major section, confirm first.
- Very specific: line 96
Don't auto-fix downstream agents: If the new CLAUDE.md conflicts with an existing agent, mention it but don't edit the agent — that's a …
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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
claude-edit skill
Modify the project's CLAUDE.md based on natural-language instructions. Same pattern as agent-edit but targeting the charter file instead of an agent file.
Trigger
/claude-edit "<natural-language change request>"Examples:
/claude-edit "add a 5th principle: prefer composition over inheritance"/claude-edit "remove the 'No mocking' rule — we agreed it's too strict"/claude-edit "soften principle 3 to allow refactoring when explicitly asked"
Pipeline
Step A. Resolve CLAUDE.md
Search in this order, take first match:
./CLAUDE.md(project root)~/.claude/CLAUDE.md(user-level)
If neither exists:
- Tell the user "no CLAUDE.md found in project root or ~/.claude/"
- Ask if they want to create one (note: this skill does not create new files; suggest manual creation or a future
/claude-createcommand) - Stop.
Step B. Read the file
Use the Read tool on the resolved path. Take note of:
- Top-level structure (
# CLAUDE.md,## 1. ..., etc.) - Style (bullet points vs prose, heading depth, numbering scheme)
- Any explicit "## Principles" or numbered sections
Step C. Plan the change
Translate the request into a precise edit:
- "Add a 5th principle" → append a new
## 5. <Title>section after the last principle, matching style - "Remove rule X" → delete just that section, leaving surrounding sections intact
- "Soften principle 3" → reword the text inside section 3 only
Hard rules:
- Modify ONLY
CLAUDE.md. Never touch agent files from this skill. - Match existing heading depth, numbering, and prose style.
- Preserve any sections the request didn't ask to change.
- If unclear ("rewrite section X" without saying how), ASK before editing.
Step D. Backup before edit
DASHBOARD=.claude/skills/dashboard
python3 $DASHBOARD/scripts/backup.py <resolved-path>Step E. Invalidate the dashboard cache (before the edit)
Run via Bash:
python3 $DASHBOARD/scripts/invalidate_cache.py <resolved-path>This MUST happen before the Edit (while the file still has its pre-edit content). Calling after the edit hashes the new content and finds nothing to remove, leaving stale entries in ~/.claude/dashboard-cache/.
Step F. Apply the edit
Use the Edit tool. The diff is shown to the user; they approve or reject.
Step G. Affinity recompute warning
If the project has agents (.claude/agents/*.md exists), remind the user that the CLAUDE.md change may invalidate previously-computed affinity scores. Suggest re-running /dashboard (default mode) to see updated alignment.
Step H. Report back
Tell the user:
- What was changed (one sentence)
- Backup path
- Suggest
/dashboard --claude(or/dashboardto see team affinity recomputed)
Example:
已在 CLAUDE.md 末尾加了原则 5: "组合优于继承"。 备份:
./CLAUDE.md.bak.1714823104938293000想看团队对新原则的服从度:/dashboard
Safety boundaries
- Single-file scope. Only modifies the resolved CLAUDE.md.
- Backup mandatory. Always before Edit.
- Preserve unmodified sections. If user asks to change one principle, leave the others alone.
- No silent destruction. If the request implies removing a major section, confirm first.
- Don't auto-fix downstream agents. If the new CLAUDE.md conflicts with an existing agent, mention it but don't edit the agent — that's a separate
/agent-editinvocation.
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.

