Cambridge Battlecode 2026 · 22 Oct to 13 Nov
Claudus Maximus
My first coding competition. Solo. I never opened an IDE: AI agents wrote every line.
The competition
What is Battlecode?
Battlecode is a programming competition that began at MIT. Each team writes a bot: a program that plays a strategy game by itself against other teams’ bots. In this season’s game, two teams of champions gather gems from monster camps and carry them home. Once a game starts, nobody touches it.
Cambridge Battlecode is the edition run by students in Cambridge. This autumn, 831 teams from around the world played each other on a ranked ladder, and 16 student teams qualified for the final at the Cambridge Union.
Sponsors of Cambridge Battlecode 2026
I entered alone and qualified as one of the eight UK teams. I didn’t write my bot, Claudus Maximus: AI agents wrote all 26,880 lines of it. My job was the system around them: what they worked on, how they tested an idea, and what counted as proof that a change was better. The ladder scored that system against hundreds of teams, and it doesn’t care who wrote the code. This post shows how it worked.
The climb
From #347 to #7 in 22 days
#2 in four days with a first bot. Then I rebuilt it from first principles, and climbed again.
- 1Hill-climb, v1 to v50
- 2Learned-bot experiment
- 3Proofs and plans
- 4New bot, coordinator loop
- 5Director and bets
- 6One lost game at a time
Scale
By the numbers
The machine
A machine that runs without me
My agents lived on a remote server, so work never stopped when my laptop closed. A gateway spread them over 7 Claude subscriptions, and games ran on Imperial's clusters.
50,000 scrim games and the field's public replays flowed back to the agents.
Go deeperSpeed
Faster loops came first
Before improving the bot, I had agents speed up their own tools, each result checked against the slower original.
Games a second on the cluster
- Amap making became the bottleneck, so it was ported to C++
- Ba silent fallback to the slow engine, found and removed
Orchestration
Nine ways to organise agents
I iterated on the organisation as much as on the bot: each design was measured, then replaced. The larger dot is the orchestrator.
one orchestrator, a gate decides
39uploadsreinforcement learning on GPUs; rules won
0uploadsa formal plan; too slow, deleted
0uploadscoordinator writes every fix
0uploadsone lost game each, auto-upload
73uploadsthree levels, 14 leads
3uploadswith a few helpers, then alone
14uploads85 opened, 9 kept
9uploadsreplay it until it is won
0uploadsAgent threads started a day
Go deeperThe human
What I actually did
I set the goal, asked why, watched games and deleted things. I never opened an IDE.
Messages I typed a day
“I want you to be extremely ambitious.”
“Every single loss is a bug.”
“Nothing is impossible. Every limit is an assumption: find it from first principles and break it.”
“The gate and having a fast feedback loop is the number one priority in an agentic workflow.”
Maps
Fake maps, judged by AI
128 official maps were too few to test on. So I had a generator learn their design rules, then set AI judges against it: every tell they found became a new statistic to pass.
- Generate maps
- Compare map statistics
- LLM judges spot the fakes
- Their tells become statistics
AI judges telling real from generated (50% is chance)
A detector trained to spot my maps (2 is chance)
Judging
I measured my own test, and replaced it
Every change had to pass a statistical test against my previous version. I checked that test against the real ladder, found it overstating gains, and replaced it with a league of sparring bots.
The league that replaced it: calls the ladder agreed with
Six test designs in three weeks
- Sequential test
- Confidence sequence
- Betting test
- Paired runs on the same maps
- Only games that flip count
- League of sparring bots
The bot
Code written to be reasoned about
26,880 lines of C++ and 62 decisions a turn. I had agents write each one from first principles: what it decides, the belief behind it, the derivation and the games that showed it.
- Heal
- Keep channel
- Contest altar
- Fight817-weight net
- Tactic
- Bank
- Farm
One decision’s header, from the bot
// DECISION bank // decides: the bag at which this body goes to tribute. // belief: the bag that minimises the cost a gem of the altar trip plus the gems a // death would swing is B* = sqrt(D v g / p) … // derivation: a trip costs D v over a bag B, D v / B a gem; carrying holds B / 2 on // average for B / g rounds, and a death hands the whole bag to the killer: our loss // and their gain, 2 p (B / 2) (B / g) / B = p B / g a gem. The sum is least at B*. … // evidence: deaths cascade: ours a thousand body-rounds were 5.7 with two or more // fewer alive than theirs, 4.0 one fewer, 2.0 even, 2.5 ahead // (b9bc36279 against v50, 32 lost games). // tried: every bag banked while they had more alive: -2.60 points; no bag setting // out while down too: -3.75 (2,000 maps paired with b9bc36279). … // v50: macro.cpp:849 (should_bank): a bag of bank_gems (55, tuned) goes; … Its // reason: fixed thresholds tuned on games, with exceptions for the cases they lost. … // test: bots/model/test/run bank
- Game rule or measurement
- Belief
- Derivation
- Decision
- Test
- Commit that cites the games
Units are types
GemRate income(GemCount gained, RoundCount lived, GemRate prior) {
return (gained + prior * params::income_prior)
/ (lived + params::income_prior);
}Every number names its source
… kDash = rule(Tiles{2 * tile},
"GameRules, Ways to move: dashes move up to 2 steps");
PARAM(hazard_mean, Hazard, Hazard{0.00169f / rd}, measured,
"900 games against v5, v10, v20, 5 Nov")
PARAM(mean_income, GemRate, GemRate{0.1925f * gem / rd}, tuned,
"tools/tune r9, round 65: …")- Rules of the game
- Measured on games
- Tuned by search
What each change was worth, in league Elo
Where the top 3 were still ahead, per game
- Claudus Maximus
- Top 3 teams
Fuel
A proof that no turn runs out
Each unit gets 100,000 units of compute a turn. I asked for a proof, not a test. The proof reads the compiled program the platform meters, counts every instruction, and bounds the worst turn in any game state.
How the worst case is computed
Turns out of fuel, per 100,000 played online
Reading games
Agents can only fix what they can see
So every game became SQL tables an agent can query, and each time I saw agents were blind to something, a tool followed.
- Every game as SQL tables
- Image sheets, a frame every 10 rounds
- Replay with a probe’s prints
- Fork a game from any round
- Scenarios on the official engine
Models
The right model for each job
The strongest model decided. A cheaper one did work a test could check. A second vendor read lost games and reviewed.
- Opus 5.5builders, fixers, tracers · 4,617
- GPT 6.1loss readers, reviewers · 1,879
- Fable 5directors · 149
Subtraction
Delete what the loop doesn’t use
Anything the working loop did not use was deleted, including four days of proofs. Lines removed, by what they were:
Agent instructions on disk, in KB: grown, then cut
Go deeperThe finish
Frozen ladder, 13 Nov
UK qualifier: 2nd of 190
- W 21–0
- W 21–0
- W 21–0
- W 20–1
- W 20–1
- W 14–7
- W 12–9beat the #1 seed
- L 5–16grand final
- L 7–14rematch
Verdict
What worked. What I’d do differently.
What worked
- Hill-climbing behind a statistical test#347 to #2 in four days
- Fast feedback before anything elsegames 15× cheaper, up to 1,906 a second
- Rebuild from first principles, delete the rest+333 rating in 70 hours
- Measure the test itselfa league fitted to the top three teams replaced self-play
- Never test on the live laddera version goes up only once local tests read it better
What I’d do differently
- Skip the learned botsix days; its best won 12 of 140 against my rules bot
- Build before provingfour days of formal plans, all deleted
- Check the test against the ladder from day one+272 claimed, +55 measured
- Freeze the rules during a runagents work better on instructions that don’t move
- Check every fix on unseen mapsten lost games are easy to overfit
Every figure comes from the project’s own record: two repositories, 19,553 commits, 7,720 agent threads and the platform’s frozen ladder.