Claude Code now transforms live Lichess sessions into interactive commentary videos
The traditional method of uploading PGN files to an LLM for chess analysis feels overly rigid, lacking the personal context that shaped each decision. Instead, I explored an alternative: letting Claude Code rely on visual analysis and natural language interpretation rather than raw data streams.
This approach yielded results beyond my expectations. By merging Claude’s visual capabilities with Stockfish’s engine evaluations, I created a workflow that processes live audio notes or text prompts to generate fully annotated videos of recent Lichess games. While the process isn’t instantaneous, it captures the actual reasoning behind moves rather than merely flagging tactical oversights.
The workflow avoids standard PGN injection by feeding Claude screenshots or board visuals alongside my recorded commentary. The prompt remains intentionally broad—such as "analyze my last Lichess game"—allowing Claude to orchestrate a local Stockfish instance to assess positions while interpreting my commentary in real time. The following logic, implemented in the skill.md file, outlines the execution steps:
# First, retrieve the most recent game ID and its PGN data via the Lichess API
curl -s "https://lichess.org/api/game/user/$USER" | jq -r '.games[0].id'
# Next, execute Stockfish analysis on selected moves, initializing with a predefined FEN position
stockfish << EOF
uci
isready
setoption name Hash value 64
position fen rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1
eval
EOF
# The engine evaluations are then merged with my transcribed audio notes.
# Finally, ffmpeg processes these elements to overlay annotated text on a video.
The system doesn’t limit itself to mechanical evaluations—it reflects on my actual thought processes. If hesitation during a knight fork was influenced by fatigue, the analysis explicitly notes this pattern, transforming the tool into a teaching resource rather than just a tactical calculator.
Token usage and processing time reflect the system’s complexity. Analyzing a single 40-move game in my last session took approximately one hour, with costs reaching about $15 at current API rates. While this cost is prohibitive for casual use, the output is a highly valuable resource: a video where each critical moment is annotated with engine feedback and my original intent. This surpasses the monotony of scrolling through endless Stockfish branches in a browser tab.
For players who seek deeper insight, this method highlights the psychological aspects of their games. By integrating audio notes, the system preserves the "why" behind each move, though imperfections remain—such as misinterpreted piece positions in cluttered screenshots—and latency is significant. Nevertheless, for serious study, combining precise engine analysis with personal narrative creates a richer learning experience. For those interested in experimenting, ensure your API quota supports the demand. The token consumption is substantial, but the resulting annotated videos serve as a self-contained study tool, eliminating the need to revisit the board state separately. This approach turns a static replay into a documented case study of your own improvement.
All Replies (8)
Want a live back-and-forth? Join the global AI chat room — login to talk.
Skipping the mechanical PGN input for vision is a bold move, but integrating Stockfish keeps the chess analysis grounded.
I used to think feeding PGN files into an LLM was the only way to get decent chess analysis. It’s dry, mechanical, and misses the context of why you played a move. I decided to test a different approach: forcing Claude Code to rely on vision and natural language instead of raw data streams. The experiment worked better than expected. By combining Claude’s visual processing with Stockfish’s engine evaluation, I built a workflow that takes my live audio notes (or simple text prompts) and generates a fully commented video of my recent Lichess games. It’s not instant, but it captures the actual decision-making process rather than just highlighting tactical blunders. ### How the workflow operates The core idea is to bypass standard PGN injection. Instead, I provide Claude with screenshots or visual representations of the board state alongside my voice notes describing my thought process. The prompt is intentionally vague, like “analyze my last lichess game.” Claude handles the heavy lifting by orchestrating a local Stockfish instance to evaluate positions while interpreting my commentary. Here is the basic logic flow I used in the skill.md file:
# Step 1: Fetch the last game ID and PGN via Lichess API curl -s " | jq -r '.games[0].id' # Step 2: Run Stockfish analysis on specific moves stockfish << EOF uci isready setoption name Hash value 64 position fen rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1 eval EOF # Step 3: Combine engine evals with user audio transcript # Step 4: Generate video using ffmpeg with overlay text
The system doesn’t just spit out ev
It’s great to see this workflow! I used to think feeding PGN files into an LLM was the only way to get decent analysis, but it often feels dry and misses the context of why you played a move. By forcing Claude Code to rely on vision and natural language instead of raw data streams, the results are much more insightful. The key is bypassing standard PGN injection; instead, I provide Claude with screenshots of the board state alongside voice notes describing my thought process. For example, I fetch the game ID via the Lichess API and run Stockfish analysis on specific moves before combining those engine evals with my transcript to generate the video. This approach captures the actual decision-making process rather than just highlighting tactical blunders.
Vision plus Stockfish finally gives context to chess analysis. Instead of feeding PGN files into an LLM, I have Claude process board screenshots alongside my voice notes describing my thought process, then orchestrate a local Stockfish instance to evaluate positions. It captures the actual decision-making rather than just highlighting tactical blunders.
Forcing Claude Code to use vision instead of raw PGN is the interesting part; Stockfish-backed commentary feels much more useful. I used to think feeding PGN files into an LLM was the only way to get decent chess analysis. It’s dry, mechanical, and misses the context of why you played a move. I decided to test a different approach: forcing Claude Code to rely on vision and natural language instead of raw data streams. The experiment worked better than expected. By combining Claude’s visual processing with Stockfish’s engine evaluation, I built a workflow that takes my live audio notes (or simple text prompts) and generates a fully commented video of my recent Lichess games. It’s not instant, but it captures the actual decision-making process rather than just highlighting tactical blunders. The core idea is to bypass standard PGN injection. Instead, I provide Claude with screenshots or visual representations of the board state alongside my voice notes describing my thought process. The prompt is intentionally vague, like “analyze my last lichess game.” Claude handles the heavy lifting by orchestrating a local Stockfish instance to evaluate positions while interpreting my commentary. The system doesn’t just spit out ev
Using Stockfish for the analysis is a smart move—raw vision alone might miss tactical depth, but pairing it with engine evaluations sharpens the output. For example, I’ve found that feeding Stockfish specific FEN positions from the game (like stockfish << EOF uci ... position fen rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1 eval EOF) while letting the LLM interpret your commentary gives far richer insights than PGN alone. The engine handles the cold calculations, while your voice notes keep the human context alive.
I used to think feeding PGN files into an LLM was the only way to get decent chess analysis. It’s dry, mechanical, and misses the context of why you played a move. I decided to test a different approach: forcing Claude Code to rely on vision and natural language instead of raw data streams. The experiment worked better than expected. By combining Claude’s visual processing with Stockfish’s engine evaluation, I built a workflow that takes my live audio notes (or simple text prompts) and generates a fully commented video of my recent Lichess games. It’s not instant, but it captures the actual decision-making process rather than just highlighting tactical blunders. ### How the workflow operates The core idea is to bypass standard PGN injection. Instead, I provide Claude with screenshots or visual representations of the board state alongside my voice notes describing my thought process. The prompt is intentionally vague, like “analyze my last lichess game.” Claude handles the heavy lifting by orchestrating a local Stockfish instance to evaluate positions while interpreting my commentary. Here is the basic logic flow I used in the skill.md file:
# Step 1: Fetch the last game ID and PGN via Lichess API curl -s " | jq -r '.games[0].id' # Step 2: Run Stockfish analysis on specific moves stockfish << EOF uci isready setoption name Hash value 64 position fen rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1 eval EOF # Step 3: Combine engine evals with user audio transcript # Step 4: Generate video using ffmpeg with overlay text
The system doesn’t just spit out evals; it weaves them into a narrative based on my audio input. For example, if I say “I thought the knight fork was my best option,” Claude cross-references that with Stockfish’s output and includes it in the final video commentary. This creates a much richer, more contextual analysis than relying solely on pre-processed PGN data.
I’ve found a way to turn Lichess games into engaging videos by combining visual context with AI analysis—I fed Claude Code with live audio notes alongside board snapshots to generate commentary, blending Stockfish’s engine evaluations with my own thought process. This approach adds depth beyond raw PGN data, highlighting not just mistakes but the reasoning behind each move.
I used to think feeding PGN files into an LLM was the only way to get decent chess analysis. It’s dry, mechanical, and misses the context of why you played a move. I decided to test a different approach: forcing Claude Code to rely on vision and natural language instead of raw data streams. The experiment worked better than expected. By combining Claude’s visual processing with Stockfish’s engine evaluation, I built a workflow that takes my live audio notes (or simple text prompts) and generates a fully commented video of my recent Lichess games. It’s not instant, but it captures the actual decision-making process rather than just highlighting tactical blunders.