Claude Code skills for chess post-mortems: Stockfish-backed annotated PGN, HTML viewer, narrated video - brumar/chess-postmortem-skills

75 points•brumar•4 days ago•56 comments•
Hello HN,

It started as an experiment: can Claude play chess properly if it uses vision instead of PGN notation? Somehow it can.

The next experiment was to see whether Claude + Stockfish could explain a game. Somehow it can too.

A few sessions later, I had a system that takes my live audio notes (or text, for that matter) and a vague instruction like "analyze my last lichess game", and gives me a commented video of the game. The result is not perfect and it takes time to deliver (an hour or so), but for me it is a much more pleasant and memorable experience than clicking around Stockfish branches. It burns tokens, so make sure you have enough quota. From the session logs, the last analyzed game would have cost around $15 at API prices.

The fact that it reflects on my own thinking during the game makes it interesting from a teaching point of view, so I thought it was worth sharing.

56 comments

brausepulver4 days ago
Does this give sensible analysis if you don't record your thinking out loud?

I've been using Elogram (https://elogram.gg/, made by a friend), which gives interpretability by showing how difficulty of a position changes with elo.

brumar4 days ago
No it does not help the quality of the analysis from what I saw, but it makes the analysis much more interesting, because it can challenge my wrong judgement and answer the questions that I asked myself out loud.

Very interesting project, is Maia used in this platform?

dverlaeckt804 days ago
As a chess player I feel this is fascinating although there are plenty of analysis options already on lichess on chess.com. Still, sometimes it is more about learning and curiosity. Well done.
Bootvis4 days ago
Already a year ago I vibe coded Babelfish: https://github.com/bobjansen/Babelfish

It integrates an LLM of your choice with StockFish to analyze games. Back then, the results weren't very good and I abandoned the project but a lot has changed (the LLM's got better and I did too) so maybe it is time to take another stab at it.

jeremyjh4 days ago
LLMs have gotten better at things they've been heavily post-trained for; its really post-training that has gotten better.
Bootvis4 days ago
The early GPTs were supposedly reasonable at chess but it indeed is not a very useful skill to have for an LLM (Elo 1800 IIRC) which is stronger than most players and for them it could be a useful tool.

Even at higher levels, I think there could be use. The Dvoretsky example on my GitHub is real but it’s not a guarantee you get it and it could just be reiterating from training. What didn’t work for me was forcing it to look at lines in detail, but maybe with larger context and better engineering, you can get the LLM to extract themes from the search tree. With compare and contrast, it could maybe figure out why a move works in one variant and not in another and produce a coherent explanation of this nuance.

I’m not trying this yet because it would take a lot of tokens and I don’t have the time.

WoodenChair4 days ago
Just a note that this is not novel. Automatic analysis of chess games built on traditional engines has existed for a long time. Without using stockfish as a sidekick, this wouldn’t be interesting because of the poor play of LLMs, however having an LLM enhance the commentary is interesting and I suspect has already been done by chess.com for years.
kuboble4 days ago
I'm an ok chess player (roughly OP level) and slightly more experienced claude code user.

I tried to use claude to analyze my games using stockfish - this is not a problem claude is good at.

I spent few hours (however admittedly around opus 4.8) with claude on this and it was unable to use stockfish in any useful way.

I think if the skill created by OP works then it's a real contribution. I'll give it a try.

brumar4 days ago
Thanks for trying it out! I'd be happy to see how it goes for you and compare our implementation notes if the analysis you got is not too bad.
nonethewiser4 days ago
There is a massive gap between computer analysis and teaching though. And its larger the less you know about chess.

Also dont forget that stockfish and agents are not alternatives. An agent can use stockfish to help players learn.

brumar4 days ago
This what I think too. I also think there are much more refined approaches than the one I tried here. From a cursory look, I saw there are both scientific litterature on the subject of mixing llms and tools like stockfish and some dedicated closed platforms that put that into action.

Let's make clear that I did not spend much time on this project. Ideally I would have tried to put other models into the mix, like maybe Maia to better see the game from a "real player" eyes and pinpoint where expected move and stockfish moves differ.

Anyway, to me, it's good enough to be usable and shared.

kokoe4 days ago
You could also download my free chess app that hooks up to Claude for real time game analysis or chat about the game. https://pwalessi.itch.io/chess-buddy
Simpliplant4 days ago
Looks really cool, would love to try it but I'm on Mac so would appreciate Mac version.
kokoe4 days ago
I don’t have a Mac handy but I’ll see if I can build for Mac in Godot without a Mac
brumar4 days ago
Thanks for sharing! So you gave stockfish to Claude too? Did you try other techniques?
kokoe4 days ago
Yeah I give the board position and stockfish’s analysis to Claude. The opening name too.

Read the full thread on Hacker News →

Related stories