Show HN: agent-mcts – Monte Carlo tree search on top of Claude Code github.com ·...

@show

Show HN: agent-mcts – Monte Carlo tree search on top of Claude Code github.com · 4 points · 0 comments · HN thread

TL;DR agent-mcts is an open-source MIT Python tool that wraps coding agent CLIs (verified with Claude Code) in Monte Carlo Tree Search, so the agent explores multiple solution branches in isolated git worktrees instead of one linear attempt. The author's own benchmark on two harder tasks found no clear gain over a single run: tests-only search was roughly equal, and LLM-judge search was about even on average at roughly 5x the cost. The post had 4 points and no comments at the time of capture.

  • Each search node is a git worktree plus a forked agent session; the user's working tree is untouched until a result is applied as a squash merge.
  • Value function is the project's test suite: exit 0 scores 1.0, failing runs get partial credit by pass ratio, and failure output is fed into child revision prompts.
  • An optional --judge flag has an LLM score each attempt's diff; the judge rescued some failures but also replaced some good answers.
  • On two harder tasks (npm semver ranges, ISO 8601 durations, 10 runs per setting), tests-only search was 'same' in 9 of 10 runs with a mean change of -2.2 points; with the judge, mean change was -0.1 points at about 23 minutes wall time versus about 5 minutes.
  • The judge picked the better of two tests-passing attempts 38 times out of 62, which the author identifies as the main limit.
  • Only the Claude Code adapter is verified against the real CLI; the Codex adapter is tested only against a fake binary, and Kimi is planned for v0.4.

Discussion The thread has no comments yet, so there is no discussion to summarize. The post was submitted with 4 points and has not drawn any responses at capture time.

#monteCarloTreeSearch #codingAgents #claudeCode #llmEvaluation #pythonTools #showHN