claude-code-config
CLAUDE.md8 starsChanged 19 days agoMITView on GitHub
This is a configuration repository for Claude Code. It can be consumed two ways: The two modes coexist — hook command paths use ${CLAUDE_PLUGIN_ROOT:-<readlink fallback>}, so they resolve in both modes without modification. This file is loaded into every session, so it carries only the behavioural rules and easy-to-get-wrong gotchas below. The full reference is split out (and is not auto-loaded — read it when the task calls for it): These are the rules that are easy to get wrong…
In this repository20 other files it gives its agents.
- home/CLAUDE.mdCLAUDE.md
- run-claude-code-configSkill
- adrSkill
- api-designSkill
- commitSkill
- django-patternsSkill
- docker-patternsSkill
- eow-reviewSkill
- git-workflowSkill
- hotfixSkill
- infrastructureSkill
- laterSkill
- mkdocs-styleSkill
- project-setupSkill
- prSkill
- refinementSkill
- security-patternsSkill
- standupSkill
- statusSkill
- testing-patternsSkill
The file
We split this CLAUDE.md into the rules it gives an agent
9 rules. About 0 are common, 8 are distinctive, and 1 is 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.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 44
When the user specifies a task, treat the scope as a contract:
- Distinctive: line 47
If you discover the task requires changes beyond the stated scope, pause and describe what you've found.
- Distinctive: line 48
Never assume scope expansion is welcome, even if architecturally cleaner.
- Distinctive: line 52
When fixing bugs, always address the root cause rather than applying symptom-level bandaids:
- Distinctive: line 55
If you still need a secondary bandaid after fixing the root cause, the root cause fix was incomplete.
- Distinctive: line 59
Never refactor without a safety net.
- Distinctive: line 63
When refactoring or adding new config/constants, always derive from existing sources of truth rather than duplicating logic.
- Distinctive: line 67
When the user asks to narrow scope or correct an approach, immediately adopt their direction without further deliberation or alternative …
- Very specific: line 97
Default canonical labels: needs-triage, needs-info, ready-for-agent, ready-for-human, wontfix.
≈ “Common” is an estimate: at least 1 in 5 of the 26,980 CLAUDE.md 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.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Repository Purpose
This is a configuration repository for Claude Code. It can be consumed two ways:
- As a plugin (recommended):
/plugin marketplace add edjchapman/claude-code-config, then/plugin install claude-code-config. The plugin name resolves only against marketplaces you have added — there is no global registry — so this can only install from this repo. If another added marketplace also defines aclaude-code-configplugin, disambiguate with/plugin install claude-code-config@claude-code-config(plugin@marketplace). The plugin loader setsCLAUDE_PLUGIN_ROOTand the hook commands resolve relative to that. - In global mode (legacy path, still supported):
scripts/setup-global.shsymlinksagents/,skills/, andrules/into~/.claude/, and mirrorssettings.jsoninto~/.claude/settings.jsonas a real file — managed keys track the repo viascripts/sync-global-settings.py, personal keys survive every sync (ADR-0002). Per-project use is viascripts/setup-project.sh.
The two modes coexist — hook command paths use ${CLAUDE_PLUGIN_ROOT:-<readlink fallback>}, so they resolve in both modes without modification.
Where the reference lives
This file is loaded into every session, so it carries only the behavioural rules and easy-to-get-wrong gotchas below. The full reference is split out (and is not auto-loaded — read it when the task calls for it):
docs/architecture.md— Key Scripts, Hooks (formats, handler types, the full hook catalog + opt-in snippets), Settings Keys, Skills/Rules listings, Settings Files, Settings + MCP template systems, CLI Scripts, Automation & live cloud routines, Agent & Skill Definitions.docs/extending.md— when to use a skill vs an agent, the plugin-vs-custom retirement policy, the copy-an-exemplar Self-Extension Guide, and prompting techniques.README.md— user-facing catalogs of every agent, skill, hook, and template.
Working in this repo
These are the rules that are easy to get wrong — keep them in mind whenever you touch this config:
- Hooks are edited in one place.
hooks/hooks.jsonis the source of truth for hook definitions (ADR-0001);settings.json'shookskey is a generated region produced byscripts/generate.py. Never hand-edit the generated block — edithooks/hooks.jsonand let pre-commit regenerate (or runpython3 scripts/generate.py). CI enforces freshness viagenerate.py --check. Both files stay committed: each install mode reads its file directly. Seedocs/architecture.mdfor the hook formats and the current catalog. - No-matcher events. These events must omit the
matcherfield (adding one is silently ignored per the docs):UserPromptSubmit,Stop,TaskCompleted,PostToolBatch,TeammateIdle,TaskCreated,WorktreeCreate,WorktreeRemove,MessageDisplay,CwdChanged. - Primitives document themselves. The README's catalogs and
docs/architecture.md's reference lists are generated regions (issues #112/#114), so an agent / skill / rule / hook / template / CLI script on disk appears in both by regeneration — provided it carries the description its catalog renders: frontmatterdescription:, a hook or CLI script header comment (plus an optionalWhy:paragraph, projected as its rationale), or a settings-template_descriptionkey. Missing one is a generator error, not a docs review. - Some invariants are declared, not derived.
scripts/lib/primitives.pydeclares the routine-fired skills (SCHEDULED_SKILLS), the user-only skills (USER_ONLY_SKILLS), and thescripts/hooks/*.shthat are deliberately not hooks (NON_HOOK_SCRIPTS— every other tracked one must be wired inhooks/hooks.json);scripts/lib/architecture_catalogs.pydeclares the platform's documented hook events (DOCUMENTED_EVENTS— a wired event must be in it) and settings keys.generate.py --checkfails on a violation, and on a hand-written sentence inREADME.mdordocs/architecture.mdthat states a count of primitives (counts are generated). - Primitives are git-tracked files. Generator and checkers enumerate via
git ls-files, so stage a new primitive before expecting it in a catalog; an untracked local-only one is invisible by design. - Keep issues #51 and #52 open — they are the delivery targets for the daily-standup and end-of-week cloud routines; closing one orphans its routine.
- Run the validation suite before pushing (CI runs the same checks):
pre-commit run --all-files # Formatters, linters, and every standing checker
python3 scripts/generate.py --check # Generated regions fresh; hook and scheduling invariants
python3 -m unittest discover -s tests # Generator CLI testsScope and Implementation Philosophy
Strict Scope Adherence
When the user specifies a task, treat the scope as a contract:
- Focus strictly on the scope specified. Do not touch files or add changes beyond what was requested without explicit approval.
- If you discover the task requires changes beyond the stated scope, pause and describe what you've found. Get explicit user approval before expanding scope.
- Never assume scope expansion is welcome, even if architecturally cleaner.
Root Cause Over Symptom Fixes
When fixing bugs, always address the root cause rather than applying symptom-level bandaids:
- Trace errors to their earliest origin point — fix division-by-zero at the calculation layer, not with
fillnain serialization. - If you still need a secondary bandaid after fixing the root cause, the root cause fix was incomplete.
Test Safety Net Before Refactoring
Never refactor without a safety net. Before restructuring code, verify that tests exist for the behavior being changed. If they don't, write them first. Tests must pass before, during, and after every refactoring step.
Derivation Over Duplication
When refactoring or adding new config/constants, always derive from existing sources of truth rather than duplicating logic. Check for existing constants, registries, or config objects before creating new ones.
Adopt User Corrections Immediately
When the user asks to narrow scope or correct an approach, immediately adopt their direction without further deliberation or alternative proposals. The user knows the codebase constraints.
Code Style
- Shell scripts: Linted with
shellcheck(CI validates on every push) - Python: Linted with
ruff(auto-formatted byformat-on-edithook) - JSON: Validated with
python -m json.tool(CI validates templates and merge outputs)
Tooling Troubleshooting
If a tool or integration isn't working (e.g., MCP server, browser extension, external API), pivot after 2 failed attempts rather than retrying across the entire session. Suggest an alternative approach or escalate to the user. The cost of continued retrying far exceeds the cost of asking for help.
Commit Messages
Follow conventional commits:
feat(agents): add kubernetes-helper agent
fix(scripts): handle spaces in paths
docs: update template documentationAgent skills
Issue tracker
Issues live in this repo's GitHub Issues, operated via the gh CLI. See docs/agents/issue-tracker.md.
Triage labels
Default canonical labels: needs-triage, needs-info, ready-for-agent, ready-for-human, wontfix. See docs/agents/triage-labels.md.
Domain docs
Single-context layout — root CONTEXT.md + docs/adr/ (created lazily). See docs/agents/domain.md.
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.

