agentleFS
goca-segoca-se/dotcontext/CLAUDE.md

dotcontext

CLAUDE.md9 starsChanged 4 months agoMITView on GitHub

AI context toolkit for coding agents (Claude Code, Codex, opencode, Gemini, Copilot, Cursor) — commands, decisions, skills, and feature planning for your codebase. IMPORTANT: Before implementing any change, check .context/decisions/ for related ADRs. If a requested change conflicts with an existing decision: 1. Stop and inform the user which ADR(s) would be affected 2. Ask explicitly if they want to: - Proceed and update the decision - Modify the approach to comply with existing decision - Cancel the change 3.…

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

9 rules. About 0 are common, 7 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈7

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    IMPORTANT: Before implementing any change, check .context/decisions/ for related ADRs.

    line 7
  2. Distinctive:

    If a requested change conflicts with an existing decision:

    line 9
  3. Distinctive:

    Ask explicitly: if they want to:

    line 11
  4. Distinctive:

    Create new ADR with updated decision

    line 17
  5. Distinctive:

    No database (file-based templates)

    line 24
  6. Distinctive:

    Always ask before assuming: - When there is ambiguity, multiple valid approaches, or decisions to be made, use the AskUserQuestion tool to …

    line 72
  7. Distinctive:

    POSIX compatibility: - Use Bash 3.2+ compatible syntax (macOS ships with 3.2).

    line 73
  8. Very specific:

    Safe defaults: - Never overwrite existing user content: seed files are create-only, and managed files show a diff and prompt (--yes to …

    line 74
  9. Distinctive:

    Cross-platform support: - Test on macOS, Linux, and Windows/WSL.

    line 76

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

dotcontext

AI context toolkit for coding agents (Claude Code, Codex, opencode, Gemini, Copilot, Cursor) — commands, decisions, skills, and feature planning for your codebase.

Decision Compliance

IMPORTANT: Before implementing any change, check .context/decisions/ for related ADRs.

If a requested change conflicts with an existing decision:

  1. Stop and inform the user which ADR(s) would be affected
  2. Ask explicitly if they want to:
    • Proceed and update the decision
    • Modify the approach to comply with existing decision
    • Cancel the change
  3. If updating a decision, create a new version:
    • Change status to Superseded by ADR-XXX
    • Create new ADR with updated decision
    • Reference the previous ADR

Stack

  • Bash 3.2+ (POSIX-compatible shell scripting)
  • Single executable distribution (no framework)
  • No database (file-based templates)
  • Dependencies: curl/wget, sed, grep, jq (optional)

Commands

CLI

# Initialize context structure in a project (harness-selective; auto-runs /setup-context when Claude is selected)
dotcontext init [--name "Project Name"] [--agents claude,codex,...] [--yes] [--no-setup]

# Update CLI + templates
dotcontext update                     # Update CLI + templates (if in project)
dotcontext update --cli               # Only update CLI
dotcontext update --templates         # Only update templates

# Validate project setup
dotcontext doctor

# Shell tab completion
dotcontext completion [bash|zsh]

# Help / version (--features and --json expose the capability handshake)
dotcontext --help
dotcontext --version [--features|--json]

Claude Code (interactive with questions)

/setup-context             # Analyze codebase and populate context
/spec-dc [feature]         # Write a behavior spec — the WHAT (step 1)
/plan-dc [spec-path]       # Turn a spec into a plan (ADR review) — the HOW (step 2)
/execute-dc [plan-path]    # Implement a plan in parallel waves — the DO (step 3)
/code-review               # Review code changes
/commit [--amend]          # Smart commit with style-aware messages
/deep-context [query]      # Structured 4-step codebase exploration
/fix-bug [description]     # Test-driven bug fixing with parallel agents
/create-pr                 # Create PR with auto-generated description
/pr-comment                # Add comment to existing PR
/release [patch|minor|major] # Create release with version bump
/add-decision              # Add ADR interactively
/add-skill                 # Add skill guide interactively
/add-command               # Create custom command interactively

Critical Rules

  1. Always ask before assuming - When there is ambiguity, multiple valid approaches, or decisions to be made, use the AskUserQuestion tool to clarify before proceeding. Never assume user intent.
  2. POSIX compatibility - Use Bash 3.2+ compatible syntax (macOS ships with 3.2). Avoid bashisms that require newer versions.
  3. Safe defaults - Never overwrite existing user content: seed files are create-only, and managed files show a diff and prompt (--yes to skip) before updating. Always prompt before destructive operations.
  4. Template downloads - Templates are fetched from GitHub main branch. Validate downloads before using.
  5. Cross-platform support - Test on macOS, Linux, and Windows/WSL. Platform-specific code must have proper detection and fallbacks.

Architecture

Single Executable Pattern

The CLI is distributed as a single dotcontext bash script. Source code lives in src/ modules (core/, commands/, setup/) and is bundled into the single executable via make build. All commands are implemented as functions, routed via a case statement. This keeps development modular while simplifying distribution.

Template-Based Init

Templates live in templates/ directory on GitHub and are downloaded during dotcontext init. init is harness-selective — only the chosen agents' files are emitted:

  • templates/AGENTS.md → project AGENTS.md (the canonical instructions, always emitted)
  • templates/CLAUDE.md / templates/GEMINI.md → thin @AGENTS.md import stubs (emitted only for Claude / Gemini)
  • templates/.context/ → project .context/ directory
  • .claude/ (commands, agents, statusline, hooks) is emitted only when Claude is selected

Multi-Agent Integration

Six harnesses are supported (Claude Code, Codex, opencode, Gemini CLI, Copilot, Cursor) via an adapter registry (src/setup/agents.sh). Workflows reach each harness in its native form: Claude .claude/commands/, opencode .opencode/command/, Copilot .github/prompts/, and a ## Workflows section in AGENTS.md for Gemini/Cursor/Codex. Skills (SKILL.md with name/description frontmatter) go to .claude/skills/ and/or .agents/skills/. See ADR-016/017/018.


Additional Context

  • Domain and architecture → .context/CONTEXT.md
  • Architectural decisions → .context/decisions/
  • Task-specific skills → .claude/skills/
  • Bug reproduction guide → .claude/skills/bug-reproduction/SKILL.md

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.