Error watcher
Wrap your dev server. The moment an error appears, one keypress packages the error, the files it points at and a prompt — while your server keeps running.
How it works
Put contextzip watch -- in front of the command you already run. Output streams through exactly as before; contextzip watches it for stack traces. When it spots one, it asks: D to package debug context, S to skip. Try it:
contextzip watch -- npm run dev
$ contextzip watch -- npm run dev
✓ Watching npm run dev · Ctrl+C to stop
The -- separates contextzip's arguments from your command. Press Ctrl+C to stop; if nothing was packaged during the session, you get one last chance to capture the whole session output.
What's in the ZIP
Pressing D writes .contextzip/output/watch/debug-context.zip:
| File | Contents |
|---|---|
| prompt.txt | An auto-generated description of the problem: the stack, the error type and what to fix |
| terminal-error.txt | The error block with colour codes and noise stripped out |
| source-files.zip | The source files named in the stack trace, with their paths |
always_exclude are left out of source-files.zip, and any secret file a trace happens to name is redacted, never zipped as-is.Recognised errors
Python tracebacks (including Django and FastAPI) and Node.js errors (including Next.js and React) each have their own detection patterns and noise filters, so the extracted error stays clean. If contextzip can't tell which stack you're running, it tries both.
Notes & limitations
- Works best with dev servers that don't read from stdin interactively —
npm run dev,manage.py runserver,cargo watchand similar. - No pseudo-terminal is used. If your process needs a real TTY to behave correctly, run it directly instead.
- On Windows, colour passthrough may be limited; Windows Terminal or the VS Code terminal work best.