/byte-engine:inspectorfrom byte-engine
Drives and observes a running Byte Engine application through its HTTP inspector: finds entities, posts messages like TriggerAction for play-test input, waits for ticks/GPU times/settings, captures screenshots, shows debug views, reads CPU/GPU metrics and debug data streams, and closes the app.
Ships in byte-engine. 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.
None: SKILL.md is the whole skill.
Every headed Byte Engine application serves an HTTP inspector on loopback while it runs. It has no
authentication and listens only on 127.0.0.1 and ::1. Use it instead of guessing from source code what the
application does.
Pick a port per instance and pass it on the command line. The default is 6680. If the default port is in use,
the inspector quietly moves to a free port and logs HTTP inspector port 6680 is in use, so the inspector serves on port N instead. A port you set explicitly that is in use stops startup, which is easier to notice.
Run the application in the background with --unattended=<frames per second>, and send its log to a file so
you can read errors and the port later:
cargo run -- --unattended=30 --inspector.port=6699 > app.log 2>&1 &
With --unattended, the window never shows or takes focus, so the user keeps working undisturbed. Every tick
still renders at the rate you give, even while the window can't be seen or the screen is locked, so you never
force frames or bring the window to the front. Each tick advances time by exactly one frame (1/30 s above), so
tick N shows the same simulated time in every run. The rate is required: 30 is enough to watch behavior, 60
matches what a player sees. Leave the flag out only when the user wants to watch or play the window themselves.
Add --metrics-out=metrics.json (summary) or --metrics-out=metrics.ndjson (every retained tick) to keep
metrics after the application closes, and --debug.streams=streams.ndjson to collect debug data streams.
Any startup parameter can be passed as --name=value.
Wait until the inspector answers before you send anything. This is the only wait that needs a retry loop: once
the inspector answers, wait with GET /events instead (see Wait for something to happen):
until curl -sf http://127.0.0.1:6699/configuration > /dev/null; do sleep 1; done
When you are done, close it through the inspector so metrics-out gets written. The response confirms the
request, not that the process has exited:
curl -X DELETE http://127.0.0.1:6699/
| You want to | Call |
|---|---|
| Find an entity's handle, types, name, or position | GET /entities?name=<exact name> or GET /entities?type=<full Rust type path> |
| Learn which messages the app accepts and their payload shapes | GET /messages/types |
| Move, delete, or trigger an input action on an entity | POST /messages |
| See the final frame | GET /screenshots?sink=0 |
| See a render target, or a target right after one pass | GET /screenshots?sink=0&target=<name>[&pass=<pass>] |
| Capture several images from the same frame | POST /screenshots |
| List debug views and the slot each shown view holds | GET /debug-views |
| Check whether a runtime setting took effect, and why not | GET /configuration |
| Get frame-time percentiles per CPU span and GPU pass | GET /metrics?presented=true |
| Get per-tick rows | GET /metrics/frames?since=<tick>&limit=<n> |
| Wait for ticks, GPU times, a setting to take effect, or the app to close | GET /events?after=<cursor>&wait=<ms> |
Filter on the server instead of downloading everything: use ?name= and ?type= on /entities, and since
and limit on /metrics/frames. Pipe JSON through jq to keep only the fields you need.
Don't sleep and then poll. GET /events returns the moment a tick ends, a frame's GPU times arrive, a setting
changes state, or the application starts closing. You learn the exact tick something happened on, you don't wait
longer than needed, and you can't read a stale row.
Get a cursor. The response also lists the state of every configuration update so far:
cursor=$(curl -s http://127.0.0.1:6699/events | jq -r .cursor)
Pass the latest cursor as after and how long to wait in milliseconds, up to 30000. Keep only the events you
need with events=tick, gpu, or configuration, comma-separated. Always replace the cursor with the
response's cursor, even when events is empty:
# Waits until `n` more ticks end, and stops early if the application closes.
wait_ticks() {
local left=$1 batch
while (( left > 0 )); do
batch=$(curl -s "http://127.0.0.1:6699/events?after=$cursor&wait=5000&events=tick") || return 1
cursor=$(jq -r .cursor <<<"$batch")
jq -e 'any(.events[]; .event == "closing")' <<<"$batch" > /dev/null && return 1
left=$(( left - $(jq '[.events[] | select(.event == "tick")] | length' <<<"$batch") ))
done
}
| To wait for | Watch for |
|---|---|
| The next N frames, such as after you post a message | N tick events; each carries the tick's metric row |
| A frame's GPU times | A gpu event for its tick, or a tick event whose gpu map isn't empty |
| A setting to take effect | A configuration event for its parameter whose state.status isn't pending |
| The application to close | A closing event, after which every request returns at once |
lagged event means more than 1,024 ticks ended since your last request. Read what you missed from
/metrics/frames?since=<tick>.503. Keep one wait loop per tool.Find the action's handle by its name. Action names are chosen by the application, such as Move or Jump.
The target is the action entity, not the character it moves:
curl -s 'http://127.0.0.1:6699/entities?name=Jump' | jq '.[].target'
Check the payload shape in GET /messages/types, then post the value. The value's kind must match the
action's declared type, such as Boolean, Float, Integer, or a vector:
curl -s -X POST http://127.0.0.1:6699/messages \
-H 'content-type: application/json' \
-d '{"type":"TriggerAction","target":42,"payload":{"type":"Boolean","value":true}}'
Check the effect. A 204 means the message was published, not that anything reacted to it. Wait for the
ticks the reaction needs with wait_ticks from Wait for something to happen,
instead of sleeping. Then read the affected entity's position from /entities, take a screenshot, or read its
debug data stream.
TransformationUpdate takes a complete transform: position and scale as three numbers and orientation as a
quaternion of four. Delete and Destroy take a null payload.
GET /messages drains a cursor that every client shares, so two tools that both poll it each see only part of
the stream. It reports message ranges by Rust type, not payloads.
X-Byte-Engine-Frame, X-Byte-Engine-Width, and so on). The inspector sends header
names in lowercase (x-byte-engine-frame), so match them without regard to case.format=png is an 8-bit preview that clamps HDR values. Use format=exr to read HDR values or compare images
numerically, and format=raw for the bytes the GPU stores.previous=true with a history target reads what the previous frame wrote. It holds no usable data on a sink's
first frame or right after a resize.curl -s -X POST http://127.0.0.1:6699/screenshots -H 'content-type: application/json' \
-d '{"captures":[{"sink":0},{"sink":0,"target":"Diffuse Radiance History","format":"exr"}]}' \
-o captures.multipart
The batch response is multipart/form-data, one part per capture in request order.
Debug views show values a pass computes, such as normals or motion vectors. They exist in debug builds, and in a
release build only when config.json sets render.debug-views.enabled and the project was baked again.
GET /debug-views lists the views as <pass>.<view>, and says whether the build has them and how many can
be shown at once.--render.debug.view.<pass>.<view>=true. Add --render.debug.targets=<n> to
show more than four at once.GET /configuration reports whether the request was applied, and the reason when it was refused. To know the
moment it settles, wait for its configuration event with GET /events?events=configuration./debug-views lists:
GET /screenshots?sink=0&target=Debug+View+<slot>.--unattended=<rate> so every tick renders, whether or not the window can be seen. Still pass
presented=true to /metrics and /metrics/frames: in an attended run, ticks of a hidden or covered window
present nothing and skew the numbers.dt. To measure the fastest a frame can go, pass a rate above what the machine reaches,
such as --unattended=1000.frame, scene.<pipeline>, pass.<name>, and stage.<name>, with @<sink> on sinks after
the first. CPU metrics are named after tracing spans, such as GraphicsApplication::tick. Every time is in
milliseconds.GET /events?events=tick,gpu instead of
polling /metrics/frames. Each tick event is a row as soon as the tick ends, and no rows are lost between
requests unless a lagged event says so.gpu event repeats the row once they do; replace the row you stored for that tick.A debug data stream reports what a system knows about one entity, one JSON line per update. The application opens
it by creating a DebugDataStream entity for the entity it wants to follow. You choose where the records go with
--debug.streams=<file, stdout, stderr, or log>. Add --debug.streams.changes-only=true to write a line only
when the system's state changed. Each record's tick matches the tick in /metrics/frames, and its entity
matches target in /entities.
jq -c 'select(.name == "Character") | .data' streams.ndjson | tail -20
| Symptom | Likely cause |
|---|---|
| Nothing answers on the port | The application is still starting, it crashed (read its log), or the inspector moved to another port. |
presented_ticks is 0, or screenshots time out | The run is attended and the window is hidden, minimized, or covered, or the screen is locked. Start it again with --unattended=<rate>. |
| The first message of a run takes about a second | On macOS, a covered window in an attended run can block the first frame it presents. Start it with --unattended=<rate>, or send a warm-up message and wait for its tick event before a timed sequence. |
A wait on /events returns 503 | Four other requests already wait. Close the extra wait loops, or retry without wait. |
Startup stops with "The unattended parameter has no valid rendering rate" | --unattended needs a positive rate, such as --unattended=30. |
| A setting has no effect | GET /configuration lists it as pending or not set, with the reason. Some settings keep their startup value. |
An entity query returns [] | Names are exact and case-sensitive, and type needs the full Rust path, such as byte_engine::rendering::window::Window. |
Read these pages for the exact rules. Each is served as Markdown:
What SKILL.md sets; muted values are Claude Code's defaults
2 skills in this plugin
npx claudepluginhub game-tek/byte-engine --plugin byte-engineOther plugins' skills for the same job