tree-of-thought-cli
v0.2.0
Published
Tree of Thought CLI - Multi-AI mode with Claude + Gemini + Codex for Claude Code
Downloads
155
Maintainers
Readme
@tot/cli
CLI installer for Tree of Thought framework - adds /tot command to Claude Code with Multi-AI support (Claude + Gemini + Codex).
Installation
npm install -g tree-of-thought-cliThat's it! The /tot command is now available in Claude Code.
MCP Setup (Optional but Recommended)
For Multi-AI mode (Claude + Gemini + Codex), install MCP servers:
# Install Gemini MCP (for architecture & design)
claude mcp add gemini-cli -s user -- npx -y gemini-mcp-tool
# Install Codex MCP (for performance & optimization)
# Follow Codex MCP setup instructionsUsage
Multi-AI Mode (Default - Recommended) 🚀
Combines 3 AI perspectives for maximum diversity:
# Default: Claude + Gemini + Codex (2:2:2)
/tot "Memory leak in production - grows 50MB/hour"
# Custom ratio (Claude-focused: 3:2:1)
/tot --ratio 3:2:1 "Design notification system for 100k users"
# Custom ratio (Performance-focused: 1:2:3)
/tot --ratio 1:1:4 "Database query takes 5 seconds"Output: 6 thoughts
- 2 practical solutions (Claude)
- 2 architectural designs (Gemini)
- 2 performance optimizations (Codex)
Hybrid Mode (2 AIs)
Focus on 2 specific perspectives:
# Claude + Gemini (Practical + Architecture)
/tot --hybrid cg "Refactor PaymentService with 500 lines"
# Claude + Codex (Practical + Performance) - Classic
/tot --hybrid cx "Optimize image processing pipeline"
# Gemini + Codex (Architecture + Performance)
/tot --hybrid gx "Design high-throughput message queue"Single-AI Mode
Quick analysis with one AI:
# Claude-only (practical solutions)
/tot -c "Fix authentication bug"
# Gemini-only (architecture focus)
/tot -g "Design microservices system"
# Codex-only (performance focus)
/tot -x "Reduce API latency to <50ms"What Gets Installed
This package installs command definitions to ~/.claude/commands/:
tot.md- Main Tree of Thought command
How It Works
- npm install runs automatically
- postinstall script copies command files to
~/.claude/commands/ - Claude Code recognizes the
/totcommand - Use
/totto solve problems systematically
Features
- 🌳 Systematic Problem Solving: Princeton NLP's Tree of Thought methodology
- 🤖 Multi-AI Intelligence: Claude + Gemini + Codex (3 perspectives)
- 🔍 Maximum Diversity: 6 thoughts from 3 different AI models
- 🎯 Smart Selection: Chooses top 3-4 approaches to expand
- 🔄 Iterative Exploration: BFS/DFS algorithms for thorough analysis
- ⚡ Parallel Execution: All AIs run simultaneously (~20s)
- 🎛️ Flexible Modes: Multi-AI, Hybrid (2 AIs), or Single-AI
AI Role Differentiation
- Claude: Practical, user-focused, proven patterns
- Gemini: Innovative architecture, creative system design
- Codex: Algorithm optimization, performance analysis
Requirements
Required
- Node.js 16+
- Claude Code CLI
Optional (for Multi-AI mode)
- Gemini MCP:
claude mcp add gemini-cli -s user -- npx -y gemini-mcp-tool - Codex MCP: Follow Codex MCP setup guide
Note: /tot works without MCPs (Claude-only mode) but Multi-AI provides best results.
Uninstallation
npm uninstall -g @tot/cli
rm ~/.claude/commands/tot.mdDocumentation
Core Documentation
- Tree of Thought Framework
- Multi-AI Template - Multi-AI usage patterns
- Usage Examples
MCP Integration Guides
- Gemini MCP Integration - Gemini setup & usage
- Codex MCP Integration - Codex setup & usage
Troubleshooting
Command not found after installation
The installation script should have copied files to ~/.claude/commands/. Verify:
ls ~/.claude/commands/tot.mdIf the file is missing, try reinstalling:
npm uninstall -g tree-of-thought-cli
npm install -g tree-of-thought-cliMCP connection issues
If Multi-AI mode falls back to Claude-only:
# Check Gemini MCP
claude mcp list | grep gemini-cli
# Check Codex MCP
claude mcp list | grep codex
# Reinstall if needed
claude mcp add gemini-cli -s user -- npx -y gemini-mcp-toolAuto-fallback: If MCP fails, Claude automatically generates replacement thoughts.
Permission errors
If you get permission errors during installation:
# macOS/Linux
sudo npm install -g tree-of-thought-cli
# Or use npx (no global install needed)
npx tree-of-thought-cliSlow execution
Multi-AI mode takes 15-20s (parallel execution). To speed up:
# Use Hybrid mode (2 AIs) - ~18s
/tot --hybrid cx "problem"
# Use Claude-only - ~15s
/tot -c "problem"Links
License
MIT © youkchansim
