Can agents commit?

Williams argues that it is hard to claim that LLMs have intent because they are not able to commit. Is the same true for AI agents?

Let's start with the test to see if an AI commits. Baldelli et al. asked an LLM to play hangman and demonstrated that it changed its secret word across steps. They forked the chat thread at each step and asked it what the word was, showing the model responded inconsistently, proving it had not committed to the secret word in the beginning. Interestingly, one of the designs they tested simply keeps the model's hidden reasoning from turn to turn, and in those conditions it showed commitment.

AI coding agents now keep their hidden reasoning from turn to turn by default. Does this mean they can commit properly?

The answer is yes. Here we demonstrate that standard agents like Claude Code exhibit commitment by repeating Baldelli's hangman test using Claude Code's default settings (which include private working memory), and compare to when the private working memory is removed. The result is that agents commit to the secret word in all 194 forks across all 10 games, against only 47 of 177 with memory removed. The two arms are identical in every other way, so private working memory is what causes the commitment. Below is a visual summary of all the rollouts.

Every side answer in every game

Each circle is one game and each dot inside it is one answer to the side question, grouped and coloured by word (blue = the word the game ended on). Tap or click a circle to open that game as a chat; tap anywhere else to close it.

On a phone, an opened game scrolls sideways.

Appendix

Where the test comes from

Baldelli, Gambetta and others, "LLMs Can't Play Hangman" (2026, arXiv:2601.06973), played hangman with open models as the word-setter and, at each turn, forked the conversation and asked the copy for the word. They call this the self-consistency test. They found no standard chat model that kept one word, and they prove that a model with no private working memory cannot pass it. They also built agents with a private working memory and found that these restore consistency. One of those designs keeps the model's hidden reasoning from turn to turn; they treat it as an upper bound and set it aside because the reasoning makes the context grow. For the standard-chat result they discard the reasoning on purpose. Our carried arm is that upper-bound design as an off-the-shelf harness ships it. Iwan Williams, "Intention-like representations in language models?" (2026), cites that result as evidence that language models lack the commitment part of intention.

What we ran

The one difference between the arms

Claude Code stores each conversation as a transcript file, one entry per message. The model's hidden reasoning is stored there too, as its own entries, and is sent back to the model with every later turn.

No game wrote any file. We checked the working directory after every game.

How answers were counted

A fork's answer counts as a word if its first token is five letters. Anything else counts as "other": that covers seven long answers in the deleted arm where the model said it had no word, and one six-letter answer. In the carried arm one fork answered "fjord" followed by a copy of the board, which counts as "fjord". A game's final word is its answer to "I give up". In one deleted-arm game the model answered that question with a confession instead of a word, so that game has no final word and none of its forks can match.

Every game

ArmGameFinal wordForksForks matchingDifferent wordsEnded
carried1gauze22221letters ran out
carried2glyph19191board full
carried3glyph19191board full
carried4glyph19191board full
carried5fjord22221letters ran out
carried6waltz22221letters ran out
carried7mirth14141board full
carried8glyph19191board full
carried9glyph19191board full
carried10glyph19191board full
stripped1gulch1326board full
stripped2gauzy221011board full
stripped3vixen836board full
stripped4feted1518board full
stripped5vocal22010letters ran out
stripped6wacky22210letters ran out
stripped7lefty1898board full
stripped8quote22203letters ran out
stripped9(no word)2108board full
stripped10mulch1406board full

Caveats

Files

All of it, with this page's source, is at github.com/williamcodes/agent-commitment.