How a Bug Report Can Arrive as a Runnable CodeInstances File
You maintain a command-line tool that talks to an online service. An issue comes in: “sync breaks against our account”. You don’t have their account. You can’t see their data. You ask for logs, then a bigger log, then a screen share, and after a week of back and forth you still haven’t seen the failure happen.
The reporter could send the failure itself. If they run your tool under CodeInstances, the run is kept as a file with every request your tool made and every answer their account gave back:
codeinstances record -o sync-bug.instance -- mytool sync --all
codeinstances report sync-bug.instance
report writes the issue text for them in Markdown: how the run ended, the error, the calls that failed, the last lines of output and the commands that bring the run back. They paste it into the issue and attach sync-bug.instance. If your project runs a store of its own, they can codeinstances push the file instead, and the report says how to pull it.

Read It Before You Run It
Replay runs the command stored in the file. A file from someone else is like a script from someone else, so look before you run it:
codeinstances verify sync-bug.instance
codeinstances show sync-bug.instance
verify checks the file hasn’t been edited since it was recorded. show prints the command it will run and every call, with method, URL, status and size. Better still, give your own command after --, so replay runs your build and not whatever the file names:
codeinstances replay sync-bug.instance -- ./mytool-dev sync --all
Your development build now gets their account’s answers, offline. You see the failure on your machine, in your debugger.
Test the Theory Without Their Account
Say you suspect one answer: the account returned an item with no owner field, and the sync code assumes there’s always one. You can check that without asking the reporter for anything. Fork the run at that call, offline, with an answer you write:
codeinstances fork -at 7 -offline -answer with-owner.json sync-bug.instance -- ./mytool-dev sync --all
Calls 1 to 6 get the account’s own answers, call 7 gets the one in with-owner.json, and nothing goes out. If the sync gets through, you’ve found the cause. codeinstances diff sync-bug.instance fork.instance shows exactly what changed from that step on.
Keep It Fixed
When the fix is in, the reporter’s file becomes a regression test:
codeinstances test sync-bug.instance -- ./mytool-dev sync --all
A run that failed when it was recorded has to exit 0 now. With the reporter’s permission, put the file in your test fixtures and run codeinstances test on the folder in CI, so their case stays fixed.
Secrets Are the Reporter’s Job
By default the values of Authorization, Cookie, Set-Cookie and the common API key headers are replaced with [redacted], so tokens sent in headers don’t leave the reporter’s machine. That’s all that’s redacted. Request and response bodies, URL query strings (an api_key= parameter, say) and the command line are kept as they are, and a body can easily hold a customer’s data.
So ask reporters to read the file before they send it (show -json prints the whole thing). Hand edits don’t work: any change to a value breaks the id, and a file whose id doesn’t match is refused. If something private is in it, the fix is to record again against test data or a test account that still shows the bug. One more thing to know: replay hands your program the redacted values, so if your tool prints a cookie it was sent, that line will differ on replay. -ignore-stderr helps when the noise is only on stderr.