The complete guide to Claude Code setup (Opus 4.6, Sonnet 4.6, Haiku 4.5). 1M token context window. 100+ hours saved. 25 hook events. Agent teams and task management. Production-tested patterns for skills, hooks, and MCP integration.
Evidence: Production Entry #064 — 15 mobile bugs caught, 6 artifacts suggested across 3 levels
Difficulty: Beginner (just run /document)
Time: 5-10 minutes per session
ROI: Prevents knowledge loss between sessions + catches stale artifacts
The original /document (Chapter 32) had three issues:
Phase 1: GATHER + DOCUMENT (automatic — creates Entry, updates context, saves to MCP)
Phase 2: ANALYZE + SUGGEST (6 checks × 3 levels — STOPS for user input)
Phase 3: CREATE SELECTED (only creates what user approves)
| Level | Scope | Location | Example |
|---|---|---|---|
| Machine | All projects on this computer | ~/.claude/rules/, ~/.claude/skills/ |
“Never kill all node processes” |
| Project | All branches of this repo | .claude/rules/, .claude/skills/ |
“Generation uses 3-layer fix priority” |
| Branch | Current branch only | Roadmap, branch rules, branch context | “Phase 12 issues M1-M15” |
| # | Check | What it catches |
|---|---|---|
| 1 | Rules | NEVER/ALWAYS lessons, file-scoped patterns |
| 2 | Skills | Reusable workflows + stale existing skills |
| 3 | Blueprints | Architecture docs that need updating |
| 4 | Roadmap | Completed tasks, new issues, phase status |
| 5 | Project Root | CLAUDE.md, system-status.json, decisions |
| 6 | Memory | Auto-memory entries, Basic Memory MCP, stale entries |
File: ~/.claude/commands/document.md
---
description: "Document session work + 6-check pattern analysis at 3 levels"
allowed-tools: Read, Write, Edit, Bash, Grep, Glob, mcp__basic-memory__write_note, mcp__basic-memory__search_notes
argument-hint: [topic-name]
---
The global command discovers project structure at runtime using:
ls memory-bank/learned/ — does project use Entry files?ls CHANGELOG.md — does project use a changelog?cat CLAUDE.md | head -20 — what does the project configure?File: {project}/.claude/commands/document.md
Adds a path map specific to that project. For example, OGAS has:
memory-bank/learned/ for entriesdocs/memory/hot/ACTIVE.md for active contextdocs/memory/websites/WEBSITES-BLUEPRINT.md for blueprintsLimorAI might have:
CHANGELOG.md for entriesThe global command adapts. The project override makes it precise.
After running /document my-feature, Phase 2 presents:
## PATTERN ANALYSIS — 5 suggestions
MACHINE-LEVEL (all projects):
(none this session)
PROJECT-LEVEL (all branches):
1. UPDATE SKILL — websites-agent-development: missing new architecture docs
2. UPDATE CONTEXT — system-status.json: no generation quality entry
3. UPDATE BLUEPRINT — WEBSITES-BLUEPRINT.md: GQI now 10 categories (was 8)
BRANCH-LEVEL (dev-websites):
4. UPDATE ROADMAP — Phase 12 complete, update status
5. UPDATE BRANCH RULE — websites-agent.md: generation rules outdated
Select (1-5 / all / none):
The user picks which to create. Phase 3 only creates selected items.
Without it, the model creates all artifacts in one shot — no user review. This led to:
A session might produce:
flex-wrap: wrap on keep-row” — applies everywhere)html_generation/ files)Single-level thinking misses 2 out of 3.
The original had: rules, skills, context, overlap-check.
Missing: blueprints (architectural docs), roadmap (branch tracking), and stale-artifact detection.
These 3 gaps caused /document to miss suggestions that the user had to manually request.
Hardcoded paths like memory-bank/learned/ only work for OGAS. Other projects use CHANGELOG.md, docs/, or nothing. The global command runs ls to discover what exists, then adapts.
| Feature | v1 (Ch.23) | v2 (Ch.32) | v3 (Ch.55) |
|---|---|---|---|
| Entry creation | Yes | Yes | Yes |
| Pattern analysis | No | Yes (passive) | Yes (6 checks) |
| Mandatory pause | No | No | Yes |
| Multi-level | No | No | 3 levels |
| Stale detection | No | No | Yes |
| Blueprint check | No | Bundled | Own check |
| Roadmap check | No | No | Own check |
| Cross-project | No | No | Runtime discovery |
| Lines | ~100 | 588 | ~100 |
/document (Entry creation only)