Treat your Claude Code plans like database migrations.
planlog is a Claude Code plugin that auto-captures plan-mode output into immutable, repo-local revisions. Reviewers see both implementation changes and the accepted plan that shaped them.
AI coding sessions often drop planning context once implementation starts. That causes review and maintenance gaps:
- What is the design?
- Why this design?
- What decision trail led to this diff?
planlog turns plan reasoning into durable project history.
- Hooks Claude Code
StopandSessionEndevents - Discovers plan artifacts from Claude plan files and transcripts
- Captures accepted/proposed plans into
plans/revisions/*.md - Maintains linear history with
.head,index.json, andhead_version - Deduplicates by stable fingerprint to avoid duplicate records
- Verifies chain integrity with
planlog verify
Prerequisites:
- Claude Code installed and authenticated
- A git repository (capture is repo-scoped)
- Go is optional.
planlogfirst uses an existing binary from PATH, then tries the plugin bundle, then builds from source. The bundled binary in this repo is currently macOS arm64; other platforms typically need Go orPLANLOG_BIN.
Install:
claude plugin marketplace add https://github.com/lu-zhengda/planlog
claude plugin install planlog@planlogThat is enough for zero-manual capture in git repositories.
planlog head --plans-dir plans
planlog history --plans-dir plans --limit 10
planlog verify --plans-dir plansplans/
.head
index.json
revisions/
20260220_230519_plan-starry-gliding-sparkle.md
index.json key fields:
schema_version: index format versionhead: current revision idhead_version: total revision count in the linear chainfingerprints: dedupe map for idempotent capture
PLANLOG_BIN: explicitplanlogbinary pathPLANLOG_PLANS_DIR: custom plans directory (defaultplans)PLANLOG_HOOK_POLICY:every-plan-event(default) oraccepted-only
- Capture depends on Claude plan-mode artifacts. If a task is executed without entering plan mode, there is no plan artifact to migrate.
- The hook processes one best candidate per hook invocation. Selection is ordered by score first, then newest timestamp. In multi-plan sessions, this is usually the latest accepted plan (often from ~/.claude/plans) at that moment; it does not backfill every prior plan from that session in a single run.
planlog candidates --source claude --for-cwd "$(pwd)"
planlog capture --source claude --for-cwd "$(pwd)"
planlog show head --plans-dir plans
planlog verify --plans-dir plansgo build -o ./bin/planlog ./cmd/planlog
go test ./...See CONTRIBUTING.md.
MIT. See LICENSE.