agent-mcts wraps a coding agent with Monte Carlo tree search, a method for exploring alternatives and spending more effort on promising branches. Its 0.4 release, published November 22, adds generated tests that help distinguish fixes when the existing suite already passes.
- Who it is for: Developers with a specific task and runnable tests who want to compare several approaches before accepting a patch.
- What runs: Each attempt gets a separate Git worktree, a working copy on its own branch, and an agent session. Test results guide which attempts get revised.
showinspects the tree;resumecontinues it;applystages the selected branch through a squash merge for human review. - What changed:
--generate-testsasks an agent to write three test suites from the task and base code before searching. Each attempt runs against those same suites. Failures feed into later revisions, and the temporary test files stay off the proposed branches. - Setup: Install
agent-mcts==0.4.0withuv tool install, using Python 3.11 or newer. In your project, runagent-mcts run --agent claude --generate-tests "your specific task". Configure the test command in.agent-mcts.toml; non-pytest runners need an explicit generated-test command. - Access and cost: The MIT-licensed tool is free; the underlying coding agent’s access and usage costs remain separate. Claude Code is the project’s verified backend. Its Codex adapter has only been tested against a simulated binary.
- Spending controls: Episode and reported-cost limits constrain a search. Dollar totals arrive after an episode finishes, so concurrent work can overshoot the stated ceiling. Git worktrees separate file changes, not operating-system permissions.
In the maintainer’s benchmark, generated-test search improved on its own first attempt in 16 of 20 runs and worsened in two. Those runs averaged about 19 minutes and $2.44 each. Tests-only search improved in just one run, illustrating how little branching helps when the scoring tests cannot distinguish solutions.
Caveat: These are maintainer-reported results on two precisely specified tasks with one model, not independent evidence of gains on general codebases.
Configuration and budget limits · Benchmark method and results