Skip to main content

cc-plan-tree 🌳

Turn Claude Code's plan mode into a visual design tree — see every design decision (including the options you didn't take), verify the finished code still matches the design, and embed the tree right in your pull request.

flowchart TD
  root["Add JWT authentication"]
  root --> d{"Where to store the refresh token?"}
  d --> o1["HttpOnly cookie"]
  d -.-> o2["✗ localStorage"]
  o1 --> s1["✓ Set cookie flags (Secure, SameSite)"]
  root --> p["Backend"]
  p --> s2["✓ Auth middleware verifying JWT"]
  p --> s3["… POST /login and /refresh endpoints"]
  classDef rejected fill:#f1f5f9,stroke:#94a3b8,color:#64748b,stroke-dasharray: 4 3
  class o2 rejected

Why

Plan mode produces walls of text. The design decisions — "we considered localStorage but chose HttpOnly cookies because of XSS" — vanish the moment the session ends. cc-plan-tree keeps them:

  • 🌳 Plans become trees. Phases, steps, and every clarifying question as a decision node with chosen/rejected options.
  • 🔍 Design ⇄ code verification. Before your PR is ready, /plan-verify checks each step of the tree against the actual diff and reports what matches, diverges, or is missing.
  • 📎 Lives in your PR. The tree is embedded in the PR body as Mermaid — GitHub renders it natively, reviewers see the design at a glance.
  • 🖼️ PNG export for docs, Slack, and anywhere Mermaid doesn't render.

Install

# with uv (recommended)
uv tool install cc-plan-tree
cc-plan-tree init            # installs the slash commands into ~/.claude/commands

# or with pip
pip install cc-plan-tree && cc-plan-tree init

# or zero-install, one shot
uvx cc-plan-tree init

Use cc-plan-tree init --project to install into the current project's .claude/commands instead.

Upgrading

init copies the slash commands into .claude/commands, so after upgrading the package, re-run init to refresh them:

uv tool upgrade cc-plan-tree && cc-plan-tree init   # pip: pip install -U cc-plan-tree

From source:

git clone https://github.com/natsu0529/cc-plan-tree
cd cc-plan-tree && pip install -e . && cc-plan-tree init

Workflow

Inside Claude Code:

Command What it does
/plan-tree <task> Plans the task. Clarifying questions become decision nodes (rejected options stay visible, greyed out). The plan is saved to .cc-plan-tree/plan.json and opened as an interactive HTML tree (collapsible nodes, hover a rejected option to see why). Approve it and implementation starts; step statuses update as work completes.
/plan-verify Diffs the branch against the design tree. Reports ✅ matches / ⚠️ diverges / ❌ missing per node. On divergence you choose: fix the code, or fix the tree. When consistent, it offers to embed the tree into the PR body via gh (with your confirmation).
/plan-export [path] Renders the tree to PNG (default ./plan-tree.png). No headless browser — pure Pillow.

The CLI also works standalone:

cc-plan-tree render .cc-plan-tree/plan.json --format mermaid   # stdout
cc-plan-tree render --format html --out design.html            # interactive, self-contained
cc-plan-tree render --format svg --out design.svg
cc-plan-tree render --format png --out design.png

Plan file format

.cc-plan-tree/plan.json is a nested tree of nodes:

type meaning
goal The root: what is being built
phase A group of steps
step Concrete work item, carries status: pending / in_progress / done
decision A design question that was asked
option An answer to a decision; chosen: true/false, rejected ones keep a reason
note Free-form annotation

See examples/sample-plan.json for a full example.

Roadmap

  • Adapters for other coding agents (Codex CLI, Gemini CLI) via the shared plan format
  • Plan version diffing (what changed between plan v1 and what shipped)
  • Interactive HTML view (--format html, v0.2)

Contributions welcome — the plan format is intentionally agent-agnostic, so adapters are a great first PR.

License

MIT

Metadata

Release files for cc-plan-tree 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cc-plan-tree 0.2.0
File Size Uploaded Provenance
cc_plan_tree-0.2.0.tar.gz 17.6 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for cc-plan-tree 0.2.0
File Interpreter ABI Platform
cc_plan_tree-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 36.9 kB

Release files / cc_plan_tree-0.2.0.tar.gz

Download URL cc_plan_tree-0.2.0.tar.gz
Size 17.6 kB
Tags Source
SHA-256 checksum
How to use checksums
a846668ab9045d60e9255e21d5a3aaced8381eeaacd4aa22d26d9d345af92818
BLAKE2b-256 checksum
How to use checksums
84534e38bf7b2e0c0074a9f290fbbfe1968e326004086a331d3a3e5657d7c2c8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 2, 2026.

Transparency log

Release files / cc_plan_tree-0.2.0-py3-none-any.whl

Download URL cc_plan_tree-0.2.0-py3-none-any.whl
Size 19.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d506cb86c3b8c14ae77b04f7da1f2cbbb661aba37990b5bb8935359aedf04a27
BLAKE2b-256 checksum
How to use checksums
69f01ecbd3d94dbd83e2c583be234ab91bdb853069611336dcccb5324aa07d8f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 2, 2026.

Transparency log

Security for cc-plan-tree 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for cc_plan_tree-0.2.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 2, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page