Add cogames-watch-replay skill and headless frame capture script#7
Open
SolbiatiAlessandro wants to merge 3 commits intoMetta-AI:mainfrom
Open
Add cogames-watch-replay skill and headless frame capture script#7SolbiatiAlessandro wants to merge 3 commits intoMetta-AI:mainfrom
SolbiatiAlessandro wants to merge 3 commits intoMetta-AI:mainfrom
Conversation
scripts/capture_frames.py: runs an episode headlessly and saves emoji grid snapshots to a text file at regular intervals. Works with any policy (defaults to StarterPolicy, no LLM required). Useful for diagnosing navigation, gear acquisition, and routing without a GUI. .claude/skills/cogames-watch-replay/SKILL.md: Claude skill that invokes the script and guides analysis — extract agent coordinates programmatically, detect stuck agents by movement delta, zoom into blocked areas with a 15x15 subgrid, compare 1/3/8-agent configs. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
a577b23 to
0454f65
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this adds
scripts/capture_frames.py— runs an episode headlessly and saves emoji grid snapshots to a text file at regular intervals. No GUI, no TTY, no interactive input. Works with any policy; defaults toStarterPolicy(no LLM required)..claude/skills/cogames-watch-replay/SKILL.md— a Claude Code skill that invokes the script and guides structured analysis of the output.Why
Watching what the policy is actually doing spatially is the highest-leverage debugging tool — are agents stuck, are they reaching gear stations, are they spreading across the map? The existing unicode renderer requires interactive keyboard input (SPACE to unpause), which makes it unusable by autonomous Claude agents or in CI.
This script hooks into
Rollout.event_handlersdirectly, runs headlessly, and writes a plain text file that Claude (or a human) can read and parse.Real example: StarterPolicy gets stuck after step 50
Running the script on the default
machina_1mission with 4 agents reveals an immediate problem in the starter policy:All 4 agents freeze near their spawn point around step 50 and never move again. This is exactly the kind of spatial insight the script is designed to surface — numbers alone (reward=0) don't tell you why, but the frame sequence makes it unambiguous.
How to use
From Claude Code:
/cogames-watch-replay --steps 500 --every 50What the skill teaches Claude to do
The skill guides structured analysis beyond just reading the grid visually:
🟦🟧🟩🟨symbols, record (row, col) per frame🤖 Generated with Claude Code