/console-skill:console-backend scan <log> [--repo PATH] [--markdown] | handlers --repo PATH | syscall <num>from console-skill
Reads PS2Recomp runtime logs and produces a ranked fix list for unimplemented syscalls, kernel stubs, IOP RPCs, and disc reads. Helps complete the backend so a recompiled game can boot.
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 Backend Engineer makes the runtime under the recompiled game complete enough for it to run.
The generated code is a literal translation of the game; everything it expects from the PS2 (the
kernel, the SDK libraries, the disc, the I/O processor) has to exist in ps2xRuntime and ps2xIOP.
Every missing piece shows up as a log line. This skill reads those lines, ranks them, and says which
of the four fix tools applies and in which file.
Honest limits: the tool reads logs and the checkout; it does not write C++ for you. Some fixes are a
one-line case in the dispatcher, others are a whole subsystem. A game usually stops at the first
missing piece, so expect one fix per run early on, and fix in order.
${CLAUDE_SKILL_DIR} below is this skill's folder (where this SKILL.md lives).
python3 "${CLAUDE_SKILL_DIR}/stubs.py" scan console/runs/latest.log --repo ../PS2Recomp # ranked fixes
python3 "${CLAUDE_SKILL_DIR}/stubs.py" scan console/runs/*.log --markdown # table for STATE.md
python3 "${CLAUDE_SKILL_DIR}/stubs.py" handlers --repo ../PS2Recomp --grep sceCd # real handler names
python3 "${CLAUDE_SKILL_DIR}/stubs.py" handlers --repo ../PS2Recomp --todo # handlers still TODO
python3 "${CLAUDE_SKILL_DIR}/stubs.py" syscall 0x3C --repo ../PS2Recomp # name a syscall
python3 "${CLAUDE_SKILL_DIR}/stubs.py" syscall -0x1A # interrupt variant
scan exits 1 when it finds something to fix and 0 on a clean log; every command takes --json.
| File | What |
|---|---|
runtime logs (console/runs/*.log from /console-tester, or saved stdout+stderr) | read, line by line, any size |
ps2xRuntime/include/ps2_call_list.h (with --repo) | PS2_SYSCALL_LIST and PS2_STUB_LIST: the handler names a binding may use |
ps2xRuntime/src/lib/Kernel/Syscalls/Dispatcher.cpp (with --repo) | which syscall number goes to which handler |
ps2xRuntime/src/lib/Kernel/**/*.cpp (with --repo) | where each handler lives and which are still TODO_NAMED |
| stdout | the ranked list, or a Markdown table to paste into STATE.md's "Stubs and syscalls" |
Without --repo it uses a built-in table of standard EE kernel syscalls and guesses files from
names, and says so. Read reference/runtime-layers.md before the first fix of a session: the three
layers, how a call reaches a handler, triage stubs, the IOP, disc I/O and the subsystem file map.
| Layer | What | Rule |
|---|---|---|
| Recompiled code | ps2xRuntime/src/runner/*.cpp, one C++ function per game function, dispatched by guest ADDRESS through one function table | never edited, never listed |
| Runtime | ps2xRuntime/src/lib/: kernel syscalls (Kernel/Syscalls/), SDK stubs (Kernel/Stubs/), memory, GS, VU, audio, pad, files; ps2xIOP/: the game's IRX modules | your fixes go in its .cpp files |
| Host | raylib (window, input, sound), the file system, FFmpeg | untouched |
A bound stub calls a named handler; an unbound or skipped one logs Unimplemented PS2 stub called
and throws; a syscall goes through Kernel/Syscalls/Dispatcher.cpp and an unknown number logs
[Syscall TODO] and returns 0. Subsystem by subsystem, the first file to open is in section 7 of
reference/runtime-layers.md (threads and semaphores, interrupts, SIF and modules, fio*, sceCd*,
memory card, pad, audio, GS, movies, libc).
state.py show from /console-reverse): the phase, the runner command,
the stub table, the open strikes.run.py boot) keeps them in console/runs/; by hand,
run the command from STATE.md with a short timeout and save stdout and stderr.stubs.py scan <log> --repo <PS2Recomp>. Issues come in the order they first
appeared. The first one usually caused the stop ("ended the run"); later ones can be
consequences. Note that unknown syscalls do not stop the game (the runtime returns 0), so an
early [Syscall TODO] is a prime suspect for a strange crash later.| The log says | Fix tool | Where |
|---|---|---|
a handler that is still TODO_NAMED | Runtime C++ | its Kernel/Stubs/<File>.cpp |
sub_XXXXXXXX or a name with no handler | TOML | bind "<Handler>@0xADDR", or recompile it if it is game code, or ret0@ for one run to classify it |
| a handler that works but logged anyway | TOML | it is in skip: move it to stubs |
[Syscall TODO] | Runtime C++ | a case in Kernel/Syscalls/Dispatcher.cpp (+ the handler in Kernel/Syscalls/<File>.cpp) |
missing function, codeRegion=yes | Recompiler | entry_points hint in the TOML, then re-run ps2_recomp (batch them) |
missing function, codeRegion=no | Investigate | overlay, second program or bad pointer: the caller at RA-8 |
[IOP/RPC trace:unhandled] | IOP | is the IRX on the extracted disc and loaded? then ps2xIOP imports |
sceCdSearchFile failed | Disc files | the file, the extraction, the run path |
sceCdRead unresolved LBN | Game override | point cdImage at the user's own plain .iso |
fatal exception: Unhandled ... at 0x.. raw=0x.. | Game override | replace that function; record it as an upstream issue |
ret0@/ret1@/reta0@ only answer "does it get further if this
succeeds?". Record each one in STATE.md as TEMPORARY and promote it: bind the real handler,
implement the TODO handler, or write an override. Never leave one on a function that allocates
memory, creates a thread or carries game logic.case rebuilds the runtime library only. A new name in PS2_STUB_LIST
(ps2_call_list.h) rebuilds every generated file: ask first, or put the body in a game override
with runtime.replaceFunction(addr, fn) instead.ctx->pc = getRegU32(ctx, 31); unless it calls the
original. Arguments are getRegU32(ctx, 4..7), results setReturnU32/S32, guest pointers
getMemPtr(rdram, addr) (null when invalid).triage.py compare). Fixed: update the row in STATE.md and log one line.
Same stop after a fix: state.py strike; at three strikes, stop guessing (circuit breaker).Write C++ only after the adversarial check from /console-reverse: what you will change, why it fixes the cause, what it could break, and whether you read the code or remembered it.
IOP. ps2xIOP runs the game's own IRX modules from the extracted disc on an R3000A interpreter,
with generic HLE services only for MCSERV, LIBSD and DBCMAN. [SIF module] load-emulated ... lines
show what loaded. An unhandled SID means the serving module is missing, failed to load, or needs an
import the virtual IOP kernel lacks (ps2xIOP/src/emulator/). No BIOS is involved or wanted.
Disc and files. cdrom0: is the folder of the ELF passed to the runner, mc0/ sits beside it,
and the runtime matches names as written (on Linux, case matters). Replacing a file in the extracted
folder swaps it in the game, no ISO rebuild. Games that read raw sectors need a plain 2048-byte
.iso of the user's own disc set as cdImage in a game override (reference/runtime-layers.md
has the snippet; iso.py plain in /console-reverse converts a raw .bin).
runner/*.cpp or list runner/; never edit a header
without the user's OK; never clean the build; read-only access to the checkout from these tools./console-tester to run again and compare logs, /console-reverse for entry points, re-exports,
recompiles and the build gate, /console-mod when the fix is a game-specific override,
/console-controller, /console-graphics, /console-sound and /console-saves when the first
issue sits in their subsystem.
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-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./console-physicsPhysics Tuner. Finds the numbers that decide how the game moves (speed, gravity, grip, jump height, frame rate) and tunes them. Scans the user's own game ELF for a float32 value stored in data or built in code (lui, ori or addiu, then mtc1), shows the instructions that read it, lists frame-timing candidates, and prints the exact pnach lines to test a new value in PCSX2 plus the PS2Recomp fix (TOML instruction patches or the data write /console-mod bakes in). Reads only; writes nothing. Use when the user says "make the car faster", "lower the gravity", "jump higher", "more grip", "change the damage", "wider camera", "unlock 60 fps", "find the speed value", or when /console-mod needs a number found.Other plugins' skills for the same job