# Claude Code and Codex write game bots that cooperate with strangers

An Oxford-led preprint finds that off-the-shelf coding agents can write game-playing code that works with partners it never trained with. On two hard benchmarks it beats methods built for this problem.

- Category: Agents
- Readiness level: III (Open source) on Science Underway's four-step scale, as proposed
- Published: 2026-12-01
- Editor: Stefan Perdal
- URL: https://scienceunderway.com/articles/claude-code-and-codex-write-game-bots-that-cooperate-with-strangers

## The study

Coding Agents Are Zero-Shot Coordinators (preprint, not peer reviewed). arXiv 2611.37528. https://arxiv.org/abs/2611.37528

## At a glance

- What it shows: AI coding tools such as Codex and Claude Code were asked to write the rules a game player follows. The code they wrote cooperated well with independently written partners in cooperative games. On two tests built for this problem, it beat every specialised method.
- What it does not show: It does not test play with real people, and it does not leave simulated games. The authors say the results are not evidence of safe coordination with humans in the real world.
- Why it matters: Teaming up with an unknown partner is a core problem for robots, cars and software agents. Here, general-purpose coding tools did better than purpose-built methods on two of the three games tested.

## What the study shows

The problem is called zero-shot coordination. Two AI players are built separately, then must cooperate at test time without having practised together. AI trained only against copies of itself tends to invent private habits. Those habits break when the partner is a stranger.

The authors gave a coding agent a sandbox, the game rules and a goal: write a player, as code, that cooperates with independently written partners. A coding agent here means a large language model paired with its own coding tool, such as Codex for OpenAI models or Claude Code for Anthropic models. Each run had two hours. The agent could test its code only by playing it against itself, then revise it. Each run started fresh, with a differently worded prompt.

The main measure is inter-seed cross-play: how well players from separate runs of the same method score together. On Overcooked V2, a cooking game built to test this, coding agents scored highest on all six layouts. Several earlier methods scored near zero or below on the same layouts. On Yokai, a card game about memory and grouping, coding agents also led in all three settings tested. Code written by different model families also worked together.

Hanabi, a cooperative card game, was harder. There the code players scored below the best existing methods. But when given the written H-group conventions that human players use, they cooperated far better with a community bot that follows those conventions. A hybrid method then used the code player to steer a conventional neural network during training. It matched the best methods and gave the highest scores with bots trained on human games. This is a preprint and has not been peer reviewed.

## Our reading

In our reading, the striking part is not the scores alone. It is that general tools, used as shipped, outperformed methods designed for this exact problem. The authors note the field had expected new algorithms to be needed. Instead, a stronger language model plus the ability to test and revise its own code was enough on these benchmarks.

The test-and-revise loop matters. The authors compared three setups: a single prompt, the agent's first submitted draft, and the final version after feedback. The final version beat the first draft in all 30 comparisons. So the gain comes from iteration as well as from the model itself.

The code also does things that resemble social reasoning. The authors show players that watch whether a partner understood a signal and switch to another signal if not. Because the output is readable code, an engineer can inspect these behaviours directly. That is rarely possible with a trained neural network.

The rest of the article (what it means, limits, what to watch) is free for members: https://scienceunderway.com/articles/claude-code-and-codex-write-game-bots-that-cooperate-with-strangers

## How this was made

An AI model read the study and wrote this article in the structure Science Underway uses. An editor reviewed it and approved it for publication. Check the original study before you rely on the details.

---
Source: Science Underway, https://scienceunderway.com/. Please link to the article when you cite it.
