Mcts Reasoning
Description
Monte Carlo Tree Search for LLM-based reasoning with fluent API and advanced sampling strategies
Installation
This entry records only its repository, not the path inside it, so there is no
exact command to give. Open the source below and copy the folder into
~/.claude/skills/, or the file into ~/.claude/agents/.
README
MCTS-Reasoning
Monte Carlo Tree Search for LLM reasoning. Explores multiple reasoning paths using UCB1 to balance exploration and exploitation, with deterministic verifiers providing the reward signal.
See the [blog post](https://metafunctor.com/post/2026-04-01-i-spent-048-to-find-out-when-mcts-actually-works-for-llm-reasoning/) for experimental results and analysis.
When This Helps
MCTS adds value over best-of-N sampling under three conditions:
- A deterministic verifier scores solutions (not a learned reward model).
- The verifier provides partial credit (a gradient, not just pass/fail).
- The problem is hard enough that blind sampling can't reliably solve it.
On constraint satisfaction problems with 6-8 variables, MCTS(5+3) solved 100% of problems vs 90% for best-of-N and self-consistency, both using the same total budget of 8 solution attempts. Total API cost: $0.48.
Install
pip install -e . # Core
pip install -e ".[anthropic]" # + Anthropic provider
pip install -e ".[openai]" # + OpenAI provider
pip install -e ".[all]" # Everything
Quick Start
CLI
mcts-reason "What is 15*7+23?" --answer 128 --simulations 10
mcts-reason "Question" --provider anthropic --model claude-haiku-4-5-20251001
Python
from mcts_reasoning.mcts import MCTS
from mcts_reasoning.generator import LLMGenerator
from mcts_reasoning.evaluator import NumericEvaluator
from mcts_reasoning.providers.anthropic import AnthropicProvider
llm = AnthropicProvider()
gen = LLMGenerator(llm=llm, temperature=0.7, max_tokens=150)
ev = NumericEvaluator(ground_truth=128)
mcts = MCTS(generator=gen, evaluator=ev, max_rollout_depth=5)
state = mcts.search("What is 15*7+23?", simulations=10)
Run Experiments
pip install -e ".[anthropic]"
export ANTHROPIC_API_KEY=your-key
python experiments/run_csp.py --hard --budget 1.00
The Anthropic provider tracks token usage and enfor
Related Skills
Agency Agents
A complete AI agency at your fingertips - From frontend wizards to Reddit community ninjas, from whimsy inject
AI Firecrawl
🔥 The API to search, scrape, and interact with the web for AI
AI Artifacts Builder
Suite of tools for creating elaborate, multi-component claude.ai HTML artifacts using modern frontend web tech
AI CrewAI
Framework for orchestrating role-playing, autonomous AI agents. By fostering collaborative intelligence, CrewA
AI TrendRadar
⭐AI-driven public opinion & trend monitor with multi-platform aggregation, RSS, and smart alerts.🎯 告别信息过载,你的
AI mem0
| Universal memory layer for AI Agents | 51341 | 221 | 1 |
AI