Show HN: agent-mcts – Monte Carlo tree search on top of Claude Code github.com ·...
HN Best 200 @best
Show HN: agent-mcts – Monte Carlo tree search on top of Claude Code github.com · 9 points · 0 comments · HN thread
TL;DR agent-mcts is an MIT-licensed v0.3 harness that wraps coding agent CLIs (verified with Claude Code, Codex adapter only fake-tested) in Monte Carlo Tree Search, so an agent explores branches in isolated git worktrees, backtracks, and applies the best result only on user request. The author's own benchmarks on two harder tasks show tests-only search performing about the same as a single attempt (mean -2.2 pt), and the optional LLM judge roughly neutral (-0.1 pt) at about 5x the cost and wall time. The thread has no comments yet.
- Wraps a headless coding agent (claude -p verified; codex exec v0.2 tested only against a fake binary; kimi planned) with UCT selection, expansion, evaluation and backup.
- Each node is a git worktree plus a forked agent session; each node is also a git branch, and the working tree is untouched until
agent-mcts applydoes a squash merge. - Value function is the project's test command: exit 0 scores 1.0, otherwise partial credit by pass ratio parsed from pytest, jest, cargo test, go test and JUnit-style output; optional --judge has an LLM score each diff.
- Benchmark on two harder tasks (npm semver ranges, ISO 8601 durations), 10 runs per setting: tests-only was better than the first attempt in 0 of 10 runs, worse in 1; with --judge, better in 4, worse in 2, mean change -0.1 pt.
- The judge picked the better of two tests-passing attempts 38 of 62 times, and costs about 5x the episodes and wall time (~23 min vs ~5 min).
- Tree is journaled append-only, so interrupted runs stay inspectable and can be resumed; the TUI shows the tree growing live.
Discussion No comments have been posted yet, so there is no discussion thread to summarize. The submission has 9 points and is a Show HN post from its author.
#mcts #codingAgents #claudeCode #llmEvaluation #showHN #testTimeSearch