/console-skill:console-reverse [iso|elf|state] <subcommand> [flags]from console-skill
Reverse engineers PS2 disc images for native recompilation with PS2Recomp. Reads ISO 9660 images, extracts boot ELF metadata (segments, CRC-32, PCSX2 CRC, IRX modules), generates PS2Recomp TOML configs, and maintains project state across the porting workflow.
Ships in console-skill. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
The Reverse Engineer turns a PS2 disc the user owns into a native program with ran-j/PS2Recomp,
one phase at a time: dump, extract, map the functions, recompile, build, boot, then I/O and menus.
It keeps the project memory in console/STATE.md, writes the design doc, and routes each problem
to the skill that owns it. Every Console session starts here.
Be honest about the size of the job. PS2Recomp is experimental: a first boot can take days, a game that plays end to end can take weeks, and GS/VU-heavy games run slowly for now. This skill does not make that disappear; it keeps the work methodical, resumable and inside the four fix tools.
${CLAUDE_SKILL_DIR} below is this skill's folder (where this SKILL.md lives).
python3 "${CLAUDE_SKILL_DIR}/state.py" show # every session starts here
python3 "${CLAUDE_SKILL_DIR}/state.py" detect # what can be found without asking
python3 "${CLAUDE_SKILL_DIR}/state.py" init --game "Title" # first session: console/STATE.md
python3 "${CLAUDE_SKILL_DIR}/iso.py" info game.iso # is the dump complete?
python3 "${CLAUDE_SKILL_DIR}/iso.py" boot game.iso # boot ELF, serial, region, VMODE
python3 "${CLAUDE_SKILL_DIR}/iso.py" extract game.iso --out console/disc
python3 "${CLAUDE_SKILL_DIR}/iso.py" ls game.iso -r # the whole disc tree
python3 "${CLAUDE_SKILL_DIR}/elf.py" info console/disc/SLUS_203.12 # segments, CRCs, IRX modules
python3 "${CLAUDE_SKILL_DIR}/elf.py" toml console/disc/SLUS_203.12 --ghidra-csv console/functions.csv
python3 "${CLAUDE_SKILL_DIR}/state.py" phase PHASE_EXTRACT
python3 "${CLAUDE_SKILL_DIR}/state.py" log "boots to the first file read"
python3 "${CLAUDE_SKILL_DIR}/state.py" strike "PC 0x00123456 hang" "bound ret0, still hangs"
Other commands: iso.py plain game.bin --out console/game.iso (raw 2352-byte dump to a plain
2048-byte image), elf.py crc, elf.py serial SLUS-20312, state.py set runner_cmd "...",
state.py design, state.py show --section Crashes, state.py strike --list. Most take --json;
--workspace PATH points state.py at a game workspace other than the current folder.
| File | What |
|---|---|
your disc image (.iso, or a raw 2352-byte .bin) | read only, streamed; iso.py info says if the dump is short |
console/disc/ | the extracted disc: the runtime's cdrom0: root. extract keeps files that already exist (your edits) unless --force |
console/<serial>.toml | elf.py toml: a starter config; refuses to overwrite |
console/STATE.md | from templates/STATE.md: paths, build config, phase, runner command, stubs, crashes, strikes, upstream issues, learned patterns, dead ends, session log |
console/design.md | from templates/design.md: how the game plays, its loop, menus, files, code map |
console/.gitignore | written once by state.py init: keeps the disc, generated C++ and other game-derived folders out of git |
| the PS2Recomp checkout | read by state.py detect (build dir, CMakeCache.txt, a COUNT of runner files); never written by these tools |
state.py show. If it exists, read it all, rules header included, and resume
at its phase. If it does not, run state.py detect.CMakeCache.txt) and the runner. Ask the user only for what it could not find, in one
message, then record it (state.py init, later state.py set). Never assume a path, and never
assume the game files live inside the PS2Recomp checkout.state.py set runner_cmd "...". From then on read it from
STATE.md verbatim; never retype it from memory.reference/pipeline.md (fresh project or a new phase), reference/guardrails.md (any error,
before any C++), reference/ps2-map.md (addresses, names, CRCs),
reference/ghidra-and-pcsx2.md (reading the original code, A/B debugging).ps2_recomp generate and where does it go; a crash inside a generated function, where
does the fix go (never in that file); how does a TOML name@0xADDR binding differ from a game
override. If any answer is shaky, re-read reference/pipeline.md.Refresh triggers: before writing C++, re-read the prohibitions and STATE.md; before any build, run
the build gate; before running the game, read the runner command from STATE.md; after any error,
STATE.md plus reference/guardrails.md; every 15 or so tool calls, state.py show and the
prohibitions again. Feeling sure without having just checked is the signal to check.
| Phase | Goal | Tools | Done when |
|---|---|---|---|
0 PHASE_SETUP | PS2Recomp builds on this machine | reference/pipeline.md (Windows clang-cl + Ninja or MSVC, macOS, Linux), state.py detect | ps2_recomp, ps2_analyzer, ps2EntryRunner exist; paths recorded |
1 PHASE_EXTRACT | the disc and the boot ELF | iso.py info/boot/extract, elf.py info | console/disc/ holds the disc, the boot ELF is known, design.md started |
2 PHASE_FUNCTION_MAP | every function's bounds | Ghidra + ExportPS2Functions.java (preferred), or ps2_analyzer, or elf.py toml | a TOML (and CSV) in console/ |
3 PHASE_RECOMPILE | C++ from the ELF | ps2_recomp console/<serial>.toml | its report is read and logged; outputs copied into the runtime |
4 PHASE_BUILD_RUN | a native program that boots | build gate, ps2EntryRunner <elf>, /console-tester, /console-backend | builds with exit 0 and gets past boot |
5 PHASE_IO_MENUS | files, menus, input | /console-backend, /console-controller, /console-graphics, /console-sound, /console-saves | menus reached and playable input; temporary stubs replaced |
Move with state.py phase <NAME>: it logs the move and prints the exit test. Phase 0 per OS, the
Ghidra export, every TOML key, the recompiler report, copying outputs and where an override file
must go are all in reference/pipeline.md. Run the ELF that sits inside console/disc/: the
runtime reads cdrom0: from the ELF's folder and keeps the memory card in mc0/ next to it.
At Phase 1 run state.py design and fill console/design.md: what kind of game it is, the core
loop, the screens and menus in boot order, the files on the disc and what each is for, and the
code map as functions get named. Start from what the user says about the game (mark it SAID) and
upgrade lines to SEEN as the port, PCSX2 or Ghidra confirms them. Update it at the end of every
phase. It describes the game in your own words and never copies its text, art or code. The other
skills read it (levels, physics, mods).
| Tool | Where | For |
|---|---|---|
| 1. TOML | console/<serial>.toml, then tool 4 | missing function starts (entry_points), handler bindings (name@0xADDR), temporary ret0@/ret1@/reta0@, instruction patches |
| 2. Runtime C++ | .cpp files under ps2xRuntime/src/lib/ | syscalls, SDK stubs, I/O, GS, audio, pad, IOP glue: anything every game needs |
| 3. Game override | PS2_REGISTER_GAME_OVERRIDE module, source in console/patches/ | one game build only: replace a function, bind an address, write data at load |
| 4. Re-run the recompiler | ps2_recomp, copy outputs, build | after TOML changes, in batches |
Stubs, syscalls, files and the IOP: /console-backend. Graphics: /console-graphics. Input:
/console-controller. Audio: /console-sound. Disc data and levels: /console-levels. Saves:
/console-saves. Behaviour changes and overrides: /console-mod. Numbers like speed and gravity:
/console-physics. Other platforms: /console-anywhere. Runs, crash ranking, regressions:
/console-tester. The decision flow, red flags and the real subsystem map are in
reference/guardrails.md.
--clean-first, --target clean, deleting the build folder or
object files, or CLEAN=1 for vita/build.sh. A full runner rebuild costs hours.ps2xRuntime/src/runner/*.cpp written by ps2_recomp, and the
two generated headers). The next recompile overwrites it, and it is the game's code.ps2_runtime.h, ps2_runtime_macros.h, ps2_syscalls.h, ps2_stubs.h and ps2_call_list.h:
one changed line rebuilds every generated file. Prefer a file-scope static or an extern
between .cpp files; if a header change is unavoidable, stop, give the cost, ask.runner/. It can hold 30,000+ files. Count with
state.py detect; open one named file only when you must.checkout, reset, clean, stash,
pull. Updating PS2Recomp is the user's decision.stubs.py scan.console/; scratch files in a temp folder.--clean-first, no --target clean, no rm/Remove-Item, no
reconfigure of an existing build dir without the user's OK.where cl prints a path, or
VSINSTALLDIR is set). macOS: xcrun --show-sdk-path works. Linux: c++ --version works.CMakeCache.txt.cmake --build <build_dir>, with --target ps2EntryRunner once only the port changes
(plus --config <type> only for the Visual Studio generator, and -j N if wanted). Nothing else.
Read the whole output; exit 0 or it failed.Every failed fix attempt at the same problem is a strike: state.py strike "<problem>" "<what was tried>". Strike 2: before the next attempt, load the reference for that subsystem and re-read the
original code. Strike 3 (the tool exits 1 and prints STOP): no more guessing. Re-read STATE.md and
reference/guardrails.md, decompile the code in Ghidra, A/B it against PCSX2 if available
(reference/ghidra-and-pcsx2.md), search for known community fixes, then ask the user one specific
question with what is known and what was tried. When it is fixed: state.py strike "<problem>" --clear "what fixed it", and write the pattern under "Learned patterns".
The context is finite. Read at most about 200 lines of a file at a time; run tests with short timeouts (boot 10 to 15 s, menus 30 s) and read only the last 5,000 characters; one log per run; load references on demand. Every 15 or so tool calls, check yourself without looking: the build dir name, the files you must not edit, the only safe build command. Two wrong: re-read STATE.md and the prohibitions. Worse: stop and tell the user a fresh session is safer.
Before the session ends: write patterns (not events) under "Learned patterns" ("X causes Y, fix with Z"), what failed under "Dead ends", update the stubs and crash tables and the phase, add a log line, then read STATE.md back once to check it is coherent.
dd from a PC DVD drive on macOS or Linux). Never download ISOs, ELFs or BIOS files, never help
find them, never ask for them. PS2Recomp needs no BIOS.state.py init writes a .gitignore for
this; never remove it to push a repo.--force; the TOML writer
never overwrites a config without --force; these tools never write into the PS2Recomp checkout.Phase 4 onward, /console-tester runs the port and ranks the crashes, and /console-backend turns
stub and syscall logs into fixes. Then /console-graphics, /console-controller, /console-sound,
/console-saves and /console-levels for their systems, /console-mod and /console-physics once
it plays, and /console-anywhere to build it for other machines. Every one of them reads
console/STATE.md first and logs back into it.
elf.py (opens in a new tab)iso.py (opens in a new tab)reference/ghidra-and-pcsx2.md (opens in a new tab)reference/guardrails.md (opens in a new tab)reference/pipeline.md (opens in a new tab)reference/ps2-map.md (opens in a new tab)state.py (opens in a new tab)templates/STATE.md (opens in a new tab)templates/design.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub jakeschincariol/console-skill --plugin console-skill11 skills in this plugin
/console-anywherePlay Anywhere. Builds the port for Windows, Mac, Linux, Steam Deck, Android and PS Vita and packages it without any game files inside. doctor checks this machine's tools for a target and prints the exact install command for anything missing; plan prints the build steps taken from PS2Recomp's own README, android/README.md and vita scripts; package makes a player folder in console/dist/ (the runner, its libraries, an empty game/ folder, PLAYERS.md, a launch script, .recomp.json) and refuses outright if a disc image, PS2 ELF, IRX module, recompiled runner source or other game data is inside; guard runs that check on any folder; recomp-json writes the project's optional .recomp.json. Use when the user says "put it on my Steam Deck", "build it for Android", "play it on my phone", "on my TV", "Vita build", "Mac build", "package it", "make a release folder", "is it safe to zip this", or after the port plays on the machine it was built on./console-backendBackend Engineer. Builds the engine room the recompiled game runs on: syscalls, kernel stubs, file and disc I/O, the IOP. Reads PS2Recomp runtime logs and turns every "Unimplemented PS2 stub", "[Syscall TODO]", missing function, unhandled IOP RPC, failed disc read and untranslated instruction into a ranked fix list: count, first PC and RA, and the exact fix tool (a TOML binding, the runtime .cpp file to implement it in, an entry point and a recompile, or a game override). With the user's PS2Recomp checkout it reads the real handler names and syscall numbers. Writes nothing into the checkout; prints a table for console/STATE.md. Use when the user says "unimplemented stub", "syscall TODO", "it crashes at boot", "fix the backend", "it can't find a file", "the IOP", "what is syscall 0x3C", or after /console-tester reports a stop./console-controllerController Mapper. Hooks the game up to any controller: DualSense, Xbox, Switch Pro, keyboard or touch, remapped how you like. Reads a mapping in console/controls.json (a layout preset plus per-button overrides, radial deadzone, invert Y, stick swap, analog trigger threshold, keyboard keys, two players, Android touch zones) and writes console/ps2_pad.cpp, a drop-in replacement for PS2Recomp's ps2xRuntime/src/lib/ps2_pad.cpp with the same class, signature and DualShock 2 report. Optional input replay and recording for scripted test runs. Backs up the stock file before installing and only touches the PS2Recomp checkout you name. Use when the user says "my controller doesn't work", "remap the buttons", "use my Xbox pad", "Switch Pro buttons are swapped", "invert the camera", "keyboard controls", "two players", "touch controls on Android", or when /console-tester needs scripted input./console-graphicsGraphics Artist. Rebuilds the graphics: dumps every texture, lets you repaint or replace them with your own art, finds the widescreen fix. Converts PS2 TIM2 textures (.tm2, 32/24/16-bit and 8/4-bit indexed) from the user's own extracted disc to PNG, rebuilds them from edited PNGs at the same size and format (GS registers kept, palettes refit or quantised), finds TIM2 blobs inside archives and puts edited ones back, and lists the 4:3 aspect and FOV constants in the ELF with 16:9 pnach lines to try in PCSX2. Reads the packets the game sends the GS from a RAM dump (DMA chains, VIF codes, GIF tags, every register write) and flags what breaks rendering. Writes to console/textures/ and console/patches/, never into the disc image. Use when the user says "dump the textures", "repaint", "replace this texture", "my own art", "HD textures", "make it widescreen", "16:9", "the picture is stretched", "black screen", "garbage textures", "nothing draws", or "how does the port draw"./console-levelsLevel Designer. Maps the disc's data files, unpacks the archives the levels live in, and swaps in your edits. Inventories an extracted PS2 disc (size, type by magic, entropy, a table-of-contents guess with a confidence score), unpacks CRI AFS archives and detected table-of-contents archives into a folder with an index.json, repacks them in the same order and alignment (keeping every offset when your edits fit), diffs two files or folders to show which bytes a change touched, lists strings, and reads the port's log to show which disc files a level loads. Writes under console/ and never modifies the original disc files. Use when the user says "where are the levels", "unpack this archive", "what's in DATA.BIN", "edit the level", "swap in my map", "what changed between these two files", "which files does stage 3 load", or before /console-graphics or /console-sound needs a file that sits inside an archive./console-modMod Maker. Describe any change in plain English and Claude builds it into the game: patches, cheats, new behaviour, as code that never touches the original files. Ports PCSX2 .pnach patches to the PS2Recomp port (code writes become ps2_recomp TOML instruction patches, data writes become a C++ game override that writes RDRAM at load or every frame, the rest are flagged for a manual port with the reason) and scaffolds game overrides that bind, replace or wrap a game function with the real PS2Recomp API. Writes to console/patches/, never to the game's files, the generated runner/*.cpp or headers. Use when the user says "mod this game", "add a cheat", "infinite health", "port this pnach", "make my gun do X", "change how X works", "game override", "turn this PCSX2 patch into the port", or once the port boots and they want to change it.Other plugins' skills for the same job