Skip to main content

Turn Claude Code plan mode into a visual design tree - verify it against your code and embed it in PRs.

Project description

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.

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 shown as a Mermaid tree. 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 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

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

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cc_plan_tree-0.1.1.tar.gz (15.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cc_plan_tree-0.1.1-py3-none-any.whl (16.5 kB view details)

Uploaded Python 3

File details

Details for the file cc_plan_tree-0.1.1.tar.gz.

File metadata

  • Download URL: cc_plan_tree-0.1.1.tar.gz
  • Upload date:
  • Size: 15.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for cc_plan_tree-0.1.1.tar.gz
Algorithm Hash digest
SHA256 e8859d12521b5cd546d4541650c72177cea614390c285726fa93614e173ce59d
MD5 9bf1f0d6b2c4602e66f605f6d9d79581
BLAKE2b-256 af4d1128bfed78d477f6a444274982035bd21102da7b4618ccc2fae399c6b810

See more details on using hashes here.

Provenance

The following attestation bundles were made for cc_plan_tree-0.1.1.tar.gz:

Publisher: publish.yml on natsu0529/cc-plan-tree

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file cc_plan_tree-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: cc_plan_tree-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 16.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for cc_plan_tree-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 73ae148aa4c63ea807b9c304026d33ee56f94a41a4e42db659af83ddfca0955a
MD5 0e054d7065967a92899ba2d10a06bd75
BLAKE2b-256 4f90efea60c5250d444e740fd4d0a843b705e52bfa961a961e696dd3b570cfee

See more details on using hashes here.

Provenance

The following attestation bundles were made for cc_plan_tree-0.1.1-py3-none-any.whl:

Publisher: publish.yml on natsu0529/cc-plan-tree

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page