agentleFS
RajuNaikRajuNaik/Claude-Code/CLAUDE.md

Claude-Code

CLAUDE.md1 starsChanged 8 months agoMITView on GitHub

Claude How To is a tutorial repository for Claude Code features. This is documentation-as-code — the primary output is markdown files organized into numbered learning modules, not an executable application. Architecture: Each module (01-10) covers a specific Claude Code feature with copy-paste templates, Mermaid diagrams, and examples. The build system validates documentation quality and generates an EPUB ebook. All documentation must pass four quality checks before commits (these run automatically via pre-commit hooks): The four checks are: 1. markdown-lint —…

  • Installs packages

The file

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

7 rules. About 0 are common, 6 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈6

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

    All documentation must pass four quality checks before commits (these run automatically via pre-commit hooks):

    line 15
  2. Distinctive:

    All diagrams must parse successfully (checked by pre-commit hook)

    line 123
  3. Distinctive:

    Use Mermaid for flowcharts, sequence diagrams, and architecture visuals

    line 125
  4. Very specific:

    Use relative paths for internal links (e.g., (01-slash-commands/README.md))

    line 128
  5. Distinctive:

    Avoid linking to ephemeral content

    line 134
  6. Distinctive:

    Use permalinks where possible

    line 135
  7. Distinctive:

    Follow conventional commit format:

    line 151

≈ “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

CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

Project Overview

Claude How To is a tutorial repository for Claude Code features. This is documentation-as-code — the primary output is markdown files organized into numbered learning modules, not an executable application.

Architecture: Each module (01-10) covers a specific Claude Code feature with copy-paste templates, Mermaid diagrams, and examples. The build system validates documentation quality and generates an EPUB ebook.

Common Commands

Pre-commit Quality Checks

All documentation must pass four quality checks before commits (these run automatically via pre-commit hooks):

# Install pre-commit hooks (runs on every commit)
pre-commit install

# Run all checks manually
pre-commit run --all-files

The four checks are:

  1. markdown-lint — Markdown structure and formatting via markdownlint
  2. cross-references — Internal links, anchors, code fence syntax (Python script)
  3. mermaid-syntax — Validates all Mermaid diagrams parse correctly (Python script)
  4. link-check — External URLs are reachable (Python script)
  5. build-epub — EPUB generates without errors (on .md changes)

Development Environment Setup

# Install uv (Python package manager)
pip install uv

# Create virtual environment and install Python dependencies
uv venv
source .venv/bin/activate
uv pip install -r scripts/requirements-dev.txt

# Install Node.js tools (markdown linter and Mermaid validator)
npm install -g markdownlint-cli
npm install -g @mermaid-js/mermaid-cli

# Install pre-commit hooks
uv pip install pre-commit
pre-commit install

Testing

Python scripts in scripts/ have unit tests:

# Run all tests
pytest scripts/tests/ -v

# Run with coverage
pytest scripts/tests/ -v --cov=scripts --cov-report=html

# Run specific test
pytest scripts/tests/test_build_epub.py -v

Code Quality

# Lint and format Python code
ruff check scripts/
ruff format scripts/

# Security scan
bandit -c scripts/pyproject.toml -r scripts/ --exclude scripts/tests/

# Type checking
mypy scripts/ --ignore-missing-imports

EPUB Build

# Generate ebook (renders Mermaid diagrams via Kroki.io API)
uv run scripts/build_epub.py

# With options
uv run scripts/build_epub.py --verbose --output custom-name.epub --max-concurrent 5

Directory Structure

├── 01-slash-commands/      # User-invoked shortcuts
├── 02-memory/              # Persistent context examples
├── 03-skills/              # Reusable capabilities
├── 04-subagents/           # Specialized AI assistants
├── 05-mcp/                 # Model Context Protocol examples
├── 06-hooks/               # Event-driven automation
├── 07-plugins/             # Bundled features
├── 08-checkpoints/         # Session snapshots
├── 09-advanced-features/   # Planning, thinking, backgrounds
├── 10-cli/                 # CLI reference
├── scripts/
│   ├── build_epub.py           # EPUB generator (renders Mermaid via Kroki API)
│   ├── check_cross_references.py   # Validates internal links
│   ├── check_links.py          # Checks external URLs
│   ├── check_mermaid.py        # Validates Mermaid syntax
│   └── tests/                  # Unit tests for scripts
├── .pre-commit-config.yaml    # Quality check definitions
└── README.md               # Main guide (also module index)

Content Guidelines

Module Structure

Each numbered folder follows the pattern:

  • README.md — Overview of the feature with examples
  • Example files — Copy-paste templates (.md for commands, .json for configs, .sh for hooks)
  • Files are organized by feature complexity and dependencies

Mermaid Diagrams

  • All diagrams must parse successfully (checked by pre-commit hook)
  • EPUB build renders diagrams via Kroki.io API (requires internet)
  • Use Mermaid for flowcharts, sequence diagrams, and architecture visuals

Cross-References

  • Use relative paths for internal links (e.g., (01-slash-commands/README.md))
  • Code fences must specify language (e.g., ```bash, ```python)
  • Anchor links use #heading-name format

Link Validation

  • External URLs must be reachable (checked by pre-commit hook)
  • Avoid linking to ephemeral content
  • Use permalinks where possible

Key Architecture Points

  1. Numbered folders indicate learning order — The 01-10 prefix represents the recommended sequence for learning Claude Code features. This numbering is intentional; do not reorganize alphabetically.
  2. Scripts are utilities, not the product — The Python scripts in scripts/ support documentation quality and EPUB generation. The actual content is in the numbered module folders.
  3. Pre-commit is the gatekeeper — All four quality checks must pass before a PR is accepted. The CI pipeline runs these same checks as a second pass.
  4. Mermaid rendering requires network — The EPUB build calls Kroki.io API to render diagrams. Build failures here are typically network issues or invalid Mermaid syntax.
  5. This is a tutorial, not a library — When adding content, focus on clear explanations, copy-paste examples, and visual diagrams. The value is in teaching concepts, not providing reusable code.

Commit Conventions

Follow conventional commit format:

  • feat(slash-commands): Add API documentation generator
  • docs(memory): Improve personal preferences example
  • fix(README): Correct table of contents link
  • refactor(hooks): Simplify hook configuration examples

Scope should match the folder name when applicable.

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.