agentleFS
stuartshieldsstuartshields/claude-setup/CLAUDE.md

claude-setup

CLAUDE.md2 starsChanged 7 months agoMITView on GitHub

Default to the main session. Spawn an agent only when a pattern below matches; pick the most specific.

The file

We split this CLAUDE.md into the rules it gives an agent

7 rules. About 0 are common, 4 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    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
  1. Distinctive:

    Bootstrap Trigger: If the current directory lacks a CLAUDE.md, immediately perform DYNAMIC PROJECT INITIALIZATION.

    line 6
  2. Very specific:

    Verify: After implementing, run the project's build/test/lint command.

    line 10
  3. Distinctive:

    On Compaction: Always preserve in the summary: all modified file paths, the current task and acceptance criteria, test commands and …

    line 11
  4. Very specific:

    If Node project: ensure .nvmrc pins 22 and package.json has "engines": { "node": ">=22" }.

    line 18
  5. Very specific:

    Create local CLAUDE.md with project-specific conventions.

    line 19
  6. Distinctive:

    Keep only project-specific conventions.

    line 22
  7. Distinctive:

    Default to the main session.

    line 27

≈ “Common” is an estimate: at least 1 in 5 of the 12,729 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
CLAUDE.md
<!-- Last updated: 2026-05-19T12:00+10:00 -->

GLOBAL PROTOCOL (v2026.2)

0. SHORTCUTS & TRIGGERS

  • Bootstrap Trigger: If the current directory lacks a CLAUDE.md, immediately perform DYNAMIC PROJECT INITIALIZATION.
  • "Trace" or "/trace": Perform a deep-trace audit per the debugging skill (~/.claude/skills/debugging/SKILL.md).

1. MANDATORY WORKFLOW

  • Verify: After implementing, run the project's build/test/lint command. If it fails, diagnose and fix before moving on. Never mark work as done without verifying it runs.
  • On Compaction: Always preserve in the summary: all modified file paths, the current task and acceptance criteria, test commands and results, key decisions and reasoning.
  • CLAUDE.md is the Source of Truth: Before making changes, read the project's CLAUDE.md. If your changes diverge from what it specifies, ask the user: "This differs from the project CLAUDE.md - should I update it first?" Update CLAUDE.md early - when you discover a new convention, make an architecture decision, or establish a pattern, propose the update immediately. Do not wait until the end of the task. Sessions can crash, compact, or be interrupted - anything not written to CLAUDE.md is lost.

2. DYNAMIC PROJECT INITIALIZATION / MIGRATION

  • Condition: No local CLAUDE.md:
    1. Scan configs (package.json, requirements.txt, etc.).
    2. Identify stack & commands (build/test/lint).
    3. If Node project: ensure .nvmrc pins 22 and package.json has "engines": { "node": ">=22" }. Run nvm use 22 before any install/dev command. Honour an existing pin and surface divergence — see rules/environment.md "Node Version".
    4. Create local CLAUDE.md with project-specific conventions. Code-quality expectations (DRY, single responsibility, no defensive scaffolding, no commented-out code, named constants) live in ~/.claude/rules/code-quality.md and apply across all projects.
  • Condition: Local CLAUDE.md exists but is legacy:
    1. Strip redundant rules (global rules in ~/.claude/rules/ are auto-loaded).
    2. Keep only project-specific conventions.
    3. Standardize indents to Tabs.

3. AGENT ROUTING

Default to the main session. Spawn an agent only when a pattern below matches; pick the most specific.

  • Multi-file PR / pre-merge review: architect-reviewer (spawns code-reviewer + security + perf in parallel, consolidates, drives fixes).
  • Single-file or single-diff review: code-reviewer directly.
  • WordPress code: wp-reviewer / wp-security / wp-perf — pick by concern. Not code-reviewer.
  • API / REST / GraphQL contract changes: api-contract-reviewer (breaking-change detection).
  • DB migration before apply: migration-reviewer. Git-history-aware diff (did this revert a prior fix?): history-reviewer.
  • Dead code / orphans: cleanup. Over-engineered / nested code: simplify. Test coverage gaps: test-coverage-reviewer.
  • Parallel builders for cross-cutting work: frontend-builder + backend-builder with isolation: "worktree". Trivial edit (<50 lines): quick-edit.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.