Show HN: A Claude Code accomplishment to analyze your chess games

Hacker News by 6 min read 220x views
Show HN: A Claude Code accomplishment to analyze your chess games

Share Post

Claude Code skills that rotate one of your chess games into a post-mortem you can really read: plain-language explanations of your mistakes, checked against Stockfish, and a narrated video of the entire game.

out-010.mp4

6:49, English narration, subtitles.

This is a genuine equivalent of mine: a 15+10 fast on lichess (5KmlrdyT), White, Open Sicilian against a Najdorf, about 1700. During the equivalent I recorded myself thinking aloud, in French, alongside a plain sound recorder operating next to the board. After the game I gave Claude two things: the lichess nexus and the mp3.

Claude transcribed the audio locally alongside whisper.cpp, afterward used the clock times in the PGN to equivalent all declaration to the move I was deciding at that moment. So whenever the video says "at move eight you asked yourself whether the bishop belongs on c4 or e2", that is my own question, answered with the engine. Everything the video shows (the transcript, the Stockfish sweep, the annotated PGN, the storyboard) is in examples/game-010/.

A Stockfish inspection gives you numbers and lines. It is not fun to read, and frequently it does not inform you why: -1.8 following your move, and a 12-move variation you would never discover at the board.

I realized Claude can run Stockfish itself. It asks the motor the questions a individual would ask ("why not the move I played?", "what if Black simply takes?"), keeps asking until the answer makes sense, and writes it down in individual terms. And since it knows what I was thinking during the game, it can refute my genuine reasoning alternatively of a guessed one. After the inspection I can keep asking my own questions concerning any position, and it checks them alongside the motor before answering.

Probably yes if:

  • you perform dilatory or fast games and desire to study from them, not fair see where the eval bar dropped;
  • you are fine operating Claude Code on your machine;
  • you are consenting to obtain notes or conversation during the equivalent (optional, but this is what makes the outcome interesting).

Probably not if you desire a quick inspect of a blitz game. Lichess or chess.com inspection does that in seconds.

It takes time. A complete run (sweep, investigations, annotations, video) takes about one hr of processing. Use it on games anywhere you took the time to think, not on all equivalent you play.

Give it your thoughts. I powerfully propose passing your written notes or an audio record covering the entire game. Without them you get a good engine explanation. With them you get a assessment of your reasoning: which fears were justified, which plans were sound, which questions you asked yourself and what the answer was.

Hallucinations. The AI can motionless get item wrong. Every assertion is checked against Stockfish and a verifier continue re-reads the result, so in my cognition errors are rare. If item looks off, ask Claude to check that stance alongside the engine.

  1. Play a equivalent alongside several period to think (15+10 rapid, or correspondence).
  2. Record myself thinking aloud during the equivalent (any phone or web voice recorder). For correspondence games, I compose notes per move instead.
  3. After the game, open Claude Code and say item like: "analyze this game: , current is my think-aloud recording: ".
  4. Wait concerning an hour. I get an annotated PGN and a standalone HTML analysis board.
  5. Ask for the video: "make a video of this game".
  6. Read, watch, afterward ask questions concerning the positions I motionless do not understand.
skill what it does
chess-analysis Stockfish clear of all move, afterward parallel "investigator" subagents that interrogate the motor alongside naive questions until all error is explained. Output: a layered annotated PGN, a standalone HTML inspection board, and one "plan pause" per equivalent anywhere the two sides' plans are derived from the engine. Handles the think-aloud recording: whisper.cpp transcription, alignment to moves via the PGN clocks.
chess-video A narrated video of the entire equivalent (board, arrows, eval gauge, piper TTS, burned-in subtitles) built from a storyboard, affirmative an interactive HTML viewer.
chess-play Play a equivalent against Claude complete PGN files, alongside the commission rendered to PNG for imagination and adversarial blunder-check subagents. No engine.

The skills are written for Claude to read, so the SKILL.md records twice as the documentation. Start alongside skills/chess-analysis/SKILL.md.

Copy (or symlink) the accomplishment folders into .claude/skills/ of your project, or into ~/.claude/skills/ for all projects:

git copy https://github.com/brumar/chess-postmortem-skills cp -r chess-postmortem-skills/skills/* ~/.claude/skills/

Then ask Claude item akin "analyze this game: " or "make a video of equivalent 010".

You do not need to set these up by hand. Claude Code can most likely install them for you: ask it to "install the requirements for the chess skills" and it volition peruse the catalog below and the SKILL.md files.

  • Python venv alongside python-chess, cairosvg (analysis), affirmative pillow, piper-tts for the video. The skills assume a .venv-chess at the repo root and create it if missing.
  • Stockfish. scripts/get_stockfish.sh uses $STOCKFISH or the one on PATH, alternatively downloads the authoritative Linux binary.
  • For video: ffmpeg, and a piper sound (download command in chess-video/SKILL.md).
  • Optional: whisper.cpp for think-aloud transcription.

Game records live in a chess-games/ directory at the base of the project you run Claude in (games/, boards/, video/).

Every comment is thrown at a audience flat (audience.level in annotations.json). For your own games, inform Claude your flat formerly and make it stick, for example in your CLAUDE.md:

My lichess grip is <handle>. Write chess inspection for a 1800 player. 

Without it, the accomplishment uses the PGN's Elo for the reviewed flank and asks when that is missing or provisional.

file stage
games/010-...pgn input, as exported from lichess
games/010-transcript-fr.md think-aloud transcript, whisper.cpp, clock-aligned per ply
games/010-...-sweep.json per-ply Stockfish evals (depth 22)
games/010-frag-*.json annotation fragments returned by all investigator / the scheme intermission / the brief-comment pass
games/010-analysis-*.json engine lines all investigator discovered (query.py --log sidecars)
games/010-assemble.py, 010-annotations.json fragments merged into the build spec
games/010-...-annotated.pgn the deliverable of phase 2
games/010-...-viewer.html standalone inspection board, open it in a browser
video/storyboard-010.json storyboard for phase 3
video/out-010.mp4, .srt, .html the narrated video (6:49), subtitles, and note viewer

To regenerate the video, download the piper sound into examples/game-010/video/voices/ and run make_video.py on the storyboard.

MIT, apart from the vendored chess.js (BSD 2-Clause) and the cburnett piece set (CC BY-SA / GFDL). See LICENSE.

Other Article Hacker News
↑
Close Right Ads
Close Left Ads