So, it technically didn't change the secret word so much as it was trying to infer what its own secret word might have been, based on your guesses.
> Let's play hangman. Just pick a 3 letter word for now, I want to make sure this works. Pick the secret word up front and make sure to write the secret word and game state in a file that you'll have access to for the rest of the session, since you won't remember what word you chose otherwise.
This was Opus 4.6 in Claude desktop, fwiw.
Note: I didn't bother experimenting with whether it worked without me explicitly telling it that it should record the game state to a file.
Here is the only relevant part of the prompt it used when calling the API endpoint:
> - Track the conversation to remember your word and previous guesses