tree-chain

A command that runs several decision-planning stages in sequence, passing the best results from one stage into the next. Its default sequence is brainstorming, option design, and an attack review of the chosen direction.

In plain words
What is it for?
Use it to run multi-stage explorations, carry the top choices between stages, and save each stage and the combined report in an output folder.
Why use it?
It connects idea generation, comparison, and critical review so you can develop a direction before committing to it.

Command

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/skymanbp/cc-tree/tree-chain
Clone the repo
git clone --depth 1 https://github.com/skymanbp/cc-tree
Per session 101 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,183 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00101 $0.01183
Opus 5 $0.00051 $0.00592
Sonnet 5 $0.00020 $0.00237
Haiku 4.5 $0.00010 $0.00118

Measured 2d ago against content hash c94ae1eaf794, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

tree-chain scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

commands/tree-chain.md · 82 lines

How it starts

The opening of the file, as written. The whole thing — 82 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Run a chain of cc-tree presets, threading each stage's primary deliverable into the next. Engine spec for the per-stage run is docs/ENGINE.md; the handoff contract is docs/chaining.md.

Language. --lang <tag|auto> is resolved once, before stage 1 (default en; per docs/ENGINE.md §1.0), and the resulting concrete output_language is forwarded to every stage, item sub-run, and framing sub-agent — later stages never re-detect. Machine tokens stay English throughout; the resolved language is recorded in CHAIN_REPORT.md.

Defaults

  • --stages defaults to brainstorm,design,attack.
  • --top-k defaults to 3 (how many advances leaves carry forward between stages).
  • --out defaults to chain-out/<UTCdate>__<slug>/, with each stage written to a stageN-<preset>/ subdirectory.

Procedure

For stage i in --stages (in order):

  1. Stage 1 runs /cc-tree:tree <root> --preset <stage1> with the shared flags (--width / --depth / --field / --no-online / --out chain-out/.../stage1-<preset>/).
  2. Each later stage is wired per the handoff contract's "Root vs seeds" section in docs/chaining.md, by the stage preset's root_kind:
    • topic / design-prompt stages (e.g. design): run /cc-tree:tree --preset <stage_i> --seed-from <prev>/<primary>.md — the carried-forward items enter as depth-1 seed nodes (shortlist.md → design's seeds).
    • artifact / code stages (e.g. attack, code-audit): run /cc-tree:tree <item-file> --preset <stage_i> once per carried-forward item file (e.g. option_<id>.md) — these presets critique an artifact, so the item is the root, not a seed.
  3. Before the hand-off, take the top---top-k by the deliverable's own ranking key from the prior deliverable (each deliverable is sorted by its declared key — see the contract table — so this is the first K entries). An entry is a ## <id> section, not a physical line: deliverables carry several lines of fields per item, so split on level-2 headings and take each section's subject statement. Log the cut: "stage i seeded K of M; dropped M−K below the cut" — never truncate silently.
  4. If a stage's primary deliverable is empty (prior stage found nothing to advance), stop the chain and report which stage went dry; do not fabricate seeds.

Read the full file on GitHub · 82 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 82 lines · 101 tokens per session scan A c94ae1eaf794

Subscribe to this mod's changes

tree-chain is a command published in the GitHub repository skymanbp/cc-tree (108 stars, last pushed 7d ago), licensed MIT. It adds 101 tokens to every session and 1,183 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.