folder-specific-claude-and-agents-md
Skill11 starsChanged 4 months agoMITView on GitHub
Create a specialized CLAUDE.md (+ AGENTS.md symlink) inside a specific folder to give future agents folder-scoped context. Use when the user asks to create a CLAUDE.md for a folder, write folder instructions, or add agent context to a directory.
- Reads credentials
We split this skill into the rules it gives an agent
17 rules. 11 are common, 0 are distinctive, and 6 are very specific to this project.
11
Common
Most of the 3 edited versions we read keep these.
0
Distinctive
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Very specific: line 16
Ask the user which folder.
- Very specific: line 21
Use ls -la first to enumerate files and subfolders.
- Common: line 22
Read every markdown, config, and key source file.
- Common: line 24
Do NOT skim. Do NOT skip. The user's later edits depend on you having full context.
- Common: line 27
Before writing the file, give the user a bullet list grouped by section — let them react first.
- Common: line 41
Keep answers short. The user will edit directly in the IDE.
- Common: line 42
When they edit the file, RE-READ it and flag: contradictions, typos, missing rules, wrong categorization.
- Common: line 43
Do not revert their edits unless asked.
- Common: line 47
Start with a one-line header explaining the file's purpose.
- Very specific: line 48
Subdir file marker: if this is a subdirectory file (parent folder already has its own CLAUDE.md), open with Apply root CLAUDE.md first, …
- Very specific: line 49
Use ## section headers matching the sections the user approved.
- Very specific: line 51
Cross-folder references: use @relative/path/file.md import syntax, not prose mentions.
- Very specific: line 61
Do NOT stage or push unless the user says to.
- Common: line 65
Never invent content: Every bullet must trace back to something you read in the folder or something the user said.
- Common: line 67
Folder-scoped only: Don't duplicate the global CLAUDE.md (personality, dates, ports, etc.).
- Common: line 72
Maintenance loop: When the user corrects the agent on something this file should have prevented, add the rule to the file immediately.
- Common: line 75
Flag gaps honestly: If the user's edits introduce contradictions (e.g.
“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Folder CLAUDE.md Creation
Generate a focused CLAUDE.md inside a target folder, plus an AGENTS.md symlink pointing at it. The file gives any future agent (Claude Code, Codex, etc.) the folder-specific context the global CLAUDE.md doesn't cover.
Background reference: library/claude-code/claude-and-agents-md.md.
Process
Step 1: Confirm the target folder + sanity-check it deserves a file
Ask the user which folder. Use absolute path under ~/Documents/code/workspace/.
Only create a file if the folder has context needed across multiple sessions — active evolving work, specific conventions, ongoing decisions. A folder of static reference files does NOT need one (agents can read on demand). If unsure, ask the user.
Step 2: Read every file in the folder IN FULL
- Use
ls -lafirst to enumerate files and subfolders. - Read every markdown, config, and key source file.
- For large tldraw/Vite subprojects: read
package.json,src/App.tsx, one representative module file, and the folder's ownmodule-details.md-style files. - Do NOT skim. Do NOT skip. The user's later edits depend on you having full context.
Step 3: Draft a bullet list of candidate content
Before writing the file, give the user a bullet list grouped by section — let them react first. Candidate sections (skip any that don't apply):
- Product / Purpose — what this folder/project is, current state, key metrics
- Avatar / Audience — who it's for (if applicable)
- Essential Files — one-line role for each important file, including cross-folder references (use
@path/file.mdimport syntax) - Constraints (MUST NOT) — explicit hard negatives. Highest-ROI content in the file.
- Conventions — the user's lingo, status emojis (✅ 🟡), naming patterns, "usually do" patterns
- Locked Decisions — things agreed + dated, must not re-litigate
- Context — history, authority, credibility that frames the work
- How to work with the user — collaboration style for this specific folder
- Marketing Angles / Positioning — if public-facing
- Top Insights — 3-5 most glaring signals from research (if research exists)
Step 4: Iterate with the user
- Keep answers short. The user will edit directly in the IDE.
- When they edit the file, RE-READ it and flag: contradictions, typos, missing rules, wrong categorization.
- Do not revert their edits unless asked.
Step 5: Write the file
- Path:
<folder>/CLAUDE.md - Start with a one-line header explaining the file's purpose.
- Subdir file marker: if this is a subdirectory file (parent folder already has its own CLAUDE.md), open with
Apply root CLAUDE.md first, then this file. - Use
##section headers matching the sections the user approved. - Bullets over prose. Short bullets.
- Cross-folder references: use
@relative/path/file.mdimport syntax, not prose mentions. - Heavy reference docs: annotate with
**Read when:**triggers (e.g. "Read when: writing offer copy"). Prevents loading every session.
Step 6: Create the AGENTS.md symlink
cd <folder> && ln -s CLAUDE.md AGENTS.mdVerify with ls -la CLAUDE.md AGENTS.md.
Step 7: Commit only when asked
Do NOT stage or push unless the user says to. When they do: git add -A, commit with a Day N: style message, push.
Rules
- Never invent content. Every bullet must trace back to something you read in the folder or something the user said. No generic boilerplate.
- Brevity wins. The user edits aggressively to make things shorter. Start tight.
- Folder-scoped only. Don't duplicate the global
CLAUDE.md(personality, dates, ports, etc.). Only include what's specific to this folder. - No file trees, no directory dumps, no stack details the code already shows. Anything an agent can derive from
lsorgreprots fast and wastes tokens. Pin decisions, rules, and context — not structure. - Constraints vs Conventions. Hard "MUST NOT" rules go in Constraints (explicit negatives). "Usually do X" patterns go in Conventions. Splitting these improves adherence.
- No absolute ALWAYS/NEVER without explicit exceptions. Edge cases make absolute rules get ignored. "Never commit secrets EXCEPT
.env.example" beats "never commit secrets." - Never summarize or auto-shorten the file. Context collapse degrades it. Grow deliberately, prune manually. If the user asks to trim, do it by hand.
- Maintenance loop. When the user corrects the agent on something this file should have prevented, add the rule to the file immediately. Don't wait.
- No emojis unless the user uses them (status markers ✅ 🟡 are the exception — they're already conventions).
- Symlink, not copy.
AGENTS.mdmust be a symlink so edits stay in sync. - Flag gaps honestly. If the user's edits introduce contradictions (e.g. "sell X" in one section and "never sell X" in another), call it out before they ask.
Other versions3 projects use a version of this.
Word for word · 0
None found.
Edited · 2
- matyasstoch/david-skills★ 5984% same
- talhaMah56/claude_skills★ 087% same
Wrote their own version · 1
- RichardLeeY/skill-eval-marketplace★ 2same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository26 other files it gives its agents.
- agent-self-schedulingSkill
- cmuxSkill
- codex-subagentSkill
- fable-safe-promptSkill
- goal-loopSkill
- handoffSkill
- markdown-renderingSkill
- run-deep-sweSkill
- anti-sleepSkill
- pi-custom-modelSkill
- setup-helpSkill
- browser-harnessSkill
- deepapiSkill
- deep-researchSkill
- pi-web-searchSkill
- research-promptSkill
- youtube-transcriptSkill
- distribute-skill-to-all-agentsSkill
- effective-agent-skillsSkill
- push-skill-to-githubSkill
- brain-to-docsSkill
- grill-meSkill
- interview-style-doc-buildingSkill
- read-all-adrsSkill
- shortSkill
- teachSkill
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.

