tree-of-thoughts — Claude Code skill: branch out before you build
Runs a hard task through three parallel agents, a pruning vote and a synthesis pass. Useful when the right approach isn't obvious up front.
npx skills add NeoLabHQ/context-engineering-kit --skill tree-of-thoughts -a claude-codeWhat tree-of-thoughts does
The skill follows the Tree of Thoughts pattern. Three agents each propose six high-level approaches to the same task, three judges vote and keep the top three, then those get expanded into full solutions. Judging criteria come from a separate meta-judge that writes a rubric for the specific task instead of reusing a fixed one.
After that an adaptive strategy picks the next move. A clear winner gets polished, a split decision goes to a synthesizer, and a round where every solution scores poorly sends the work back to the expansion phase. Intermediate files land in .specs/research and .specs/reports, so create both directories with mkdir -p .specs/research .specs/reports before you start — otherwise the agents have nowhere to write proposals and reports.
The skill pays off on tasks where several paths are worth exploring before committing to code. On small edits the eight phases just add overhead.
What it helps with
- pick an architecture when several designs look viable
- drop weak ideas before anyone builds them
- score solutions against criteria written for the task
- merge the good parts of several partial solutions
- restart expansion when every candidate fails
Example prompts for the agent
- Run this through tree-of-thoughts: I need to choose a session storage design
- Use the tree-of-thoughts skill to explore approaches for refactoring the payments module
- Run tree-of-thoughts on the API design and keep the top three options
How to install tree-of-thoughts
1Skills CLI (Vercel)
npx skills add NeoLabHQ/context-engineering-kit --skill tree-of-thoughts -a claude-code2Manually: put the files in place
~/.claude/skills/tree-of-thoughts/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/tree-of-thoughts/
1Skills CLI (Vercel)
npx skills add NeoLabHQ/context-engineering-kit --skill tree-of-thoughts -a codex2Manually: put the files in place
.agents/skills/tree-of-thoughts/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add NeoLabHQ/context-engineering-kit --skill tree-of-thoughts -a cursor2Manually: put the files in place
.cursor/skills/tree-of-thoughts/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install NeoLabHQ/context-engineering-kit tree-of-thoughts2Manually: put the files in place
.github/skills/tree-of-thoughts/SKILL.md1Skills CLI (Vercel)
npx skills add NeoLabHQ/context-engineering-kit --skill tree-of-thoughts -a gemini-cli2Platform CLI
gemini skills install https://github.com/NeoLabHQ/context-engineering-kit --path skills/tree-of-thoughtsManually: put the files in place
.devin/skills/tree-of-thoughts/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add NeoLabHQ/context-engineering-kit --skill tree-of-thoughts -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about tree-of-thoughts
How do I install tree-of-thoughts in Claude?
Run npx skills add NeoLabHQ/context-engineering-kit --skill tree-of-thoughts -a claude-code. The skill lands at ~/.claude/skills/tree-of-thoughts/SKILL.md.
What does tree-of-thoughts do?
It splits a task into eight phases: proposing approaches, pruning, expanding solutions, judging and synthesizing. A meta-judge writes the evaluation criteria for the task at hand.
What do I need before running it?
The .specs/research and .specs/reports directories, where proposals, judge reports and the selection are written. Create them with mkdir -p .specs/research .specs/reports.