Agentic debug mode
Use when a bug, regression, race condition, or unexpected behavior has no proven root cause and you must confirm the cause with runtime evidence instead of guessing from source code.From its SKILL.md
npx -y skills add Toubat/agentic-debug-mode --skill agentic-debug-modeAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- 22 days oldThe repository was created 22 days ago. New is not bad, but a brand new repository carrying a familiar-sounding name is the shape a typosquat arrives in, and there has been no time for anyone else to find a problem with it.
- 4 stars4 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
14.2 KB, ~3.2k tokens by cl100k_base, as published. Nobody here has run it
Debugging with Runtime Evidence
Core rule
Source code creates hypotheses. Runtime evidence confirms or rejects them.
Do not implement a bug fix before collecting runtime evidence that identifies the cause. Reading code tells you what could happen; only observations from a real run tell you what did happen.
debug-mode is a small CLI that collects and queries that evidence for you. It manages its own
background service; you never manage processes, ports, or state files. Every command prints
readable text by default — read that text, do not scrape it.
Do the work yourself
Do not ask the user to perform an action you can execute with available tools. Run available CLI commands, tests, and HTTP requests yourself, including installation, session setup, resetting evidence, reproduction, and evidence collection.
Ask the user only for inaccessible interactions: a physical device or on-screen tap you cannot drive, an external system or account you have no credentials for, or subjective confirmation that the observed behavior now looks correct. Before asking, complete every accessible prerequisite — insert observations, reset the session, rebuild — and request only the smallest remaining step.
Vocabulary
Terms used throughout, defined once:
- Session — one debugging investigation, identified by a random UUID. It owns one evidence
record. Every session-scoped command needs
--session <id>. - Hypothesis label — your own name for one falsifiable guess, such as
H1. You invent and track these; the CLI never registers, declares, or validates them. It only groups and filters the labels it sees in evidence. - Helper template — a block of code, inserted once per runtime, that owns transport, envelope construction, size limits, and failure suppression. Treat it as opaque. Its declared placement says where it must go: at file start for C and C++ (their includes must precede declarations), at module or file scope for every other language.
- Call template — a small block copied once per observation, always in statement position.
You replace only its placeholders. Most languages take a native value in
__DATA_EXPRESSION__and serialize it for you; Rust, C++, and C instead take__DATA_JSON_EXPRESSION__, an expression that already evaluates to one complete serialized JSON value (use the application's serializer, or the helper'sjson_string(text)fallback for plain text — never hand-concatenate raw JSON). - Observation — one
agent logregion emitting one event that tests one hypothesis. - Ingest URL — the loopback address an HTTP helper posts to. The session is in the URL path; it is not a secret and needs no header.
- Append path — the file a file helper appends newline-terminated JSON records to.
- Reset cycle — everything between one
resetand the next. Resetting restarts sequence numbering at1and invalidates old log/query cursors. - Runtime evidence — the validated events the CLI returns from
logs,query, andstatus.
Resolve the CLI
Run debug-mode --version. If it is missing, install it with the first channel the host's package
policy allows, then verify again:
- npm:
npm install --global agentic-debug-mode@latest - Bun:
bun install --global agentic-debug-mode@latest - Homebrew only when the project documents its official tap coordinate.
- Zero-install fallback: prefix every command with
npx --yes agentic-debug-mode@latest.
Never use an unverified curl | sh, never request elevated privileges, and never edit shell
startup files. If no supported channel works, stop and report the exact error.
If a command reports The optional package agentic-debug-mode-<platform> is missing, the launcher
installed but its platform binary did not. This is almost always npm skipping the platform
optionalDependencies on an upgrade, or a just-published version whose platform tarballs have not
finished propagating to the registry CDN yet. Recover by reinstalling: npm uninstall --global agentic-debug-mode then npm install --global agentic-debug-mode@latest. If it still reports the
missing package immediately after a release, wait a minute for CDN propagation and reinstall; do
not switch install channels or disable optional dependencies.
Workflow
For one investigation, repeat this loop with one session:
- Create a session.
- Get a language template and insert folded observation regions.
- Reset the session, then reproduce.
- Read evidence with
logs,query, andstatus. - Classify each hypothesis in your own reasoning.
- Change code or observations.
- Reset and reproduce again.
- Compare evidence until it proves the fix.
- Remove observations, then stop.
1. Create a session
debug-mode create
The output returns a Session ID, an Ingest URL, and an Append Path. Keep the Session ID
and pass --session <id> to every later command. Reuse this one session for the whole
investigation — do not create a fresh session per attempt.
Never guess a session. If you lose the ID, recover it (newest first):
debug-mode sessions
sessions lists sessions; it never selects one for you. sessions --all includes older sessions.
2. Get a template and instrument
State expected behavior, actual behavior, and the shortest reproduction. Form three to five
precise, falsifiable hypotheses and label them H1, H2, and so on. Then request the template for
the runtime you are instrumenting.
debug-mode template --language typescript --ingest http
debug-mode template --language python --ingest file
Transport follows runtime reachability. Use HTTP for JavaScript and TypeScript (one shape across browser and server) with the Ingest URL. Use file append for local CLIs and services with the Append Path. Advertised combinations, each verified end-to-end:
| Language | Ingest | Language | Ingest |
|---|---|---|---|
| JavaScript | http | Ruby | file |
| TypeScript | http | PHP | file |
| Python | file | PowerShell | file |
| Go | file | C# | file |
| Swift | file | Rust | file |
| C++ | file | C | file |
| Java | file | Kotlin | file |
The output has four sections: HELPER TEMPLATE, CALL TEMPLATE, PLACEHOLDERS, and EVENT SCHEMA.
Insert the helper template once per runtime boundary. Copy the call template once per observation. Replace only the listed placeholders — for HTTP replace the ingest placeholder with the Ingest URL; for file replace the append placeholder with the Append Path; then fill hypothesis, location, message, and data.
Keep every observation inside its own region, and keep the exact markers so the block stays foldable and mechanically removable:
// #region agent log
__agentDebugEmit({
hypothesisId: "H1",
location: "src/cart.ts:84",
message: "Before discount calculation",
data: { itemCount: items.length, subtotal },
});
// #endregion
Python and Ruby use # region agent log / # endregion; Rust, C, C++, Go, Java, Kotlin, C#, and
Swift use the // #region agent log / // #endregion line-comment form. Keep whichever markers the
template prints. Never put production behavior inside a region, never await an observation, and
never instrument a generated file whose syntax cannot hold the markers.
Event schema
Every observation carries exactly five fields:
hypothesisId— your label for the one hypothesis this observation tests.location— stable source location, preferablypath:line.message— a constant description of the observation; changing values go indata, never here.data— bounded JSON holding the values that change between runs.timestamp— observation time in Unix epoch milliseconds. The helper sets it for you.
Stored evidence adds id, sequence (order within the reset cycle), and receivedAt (receipt
time, also Unix epoch milliseconds). When timestamps tie, sequence breaks the tie.
Keep message constant and put changing values in data. Keep data small and bounded — choose
the smallest diagnostic value that tests the hypothesis. Excluding secrets is your responsibility:
never record passwords, cookies, authorization headers, private keys, full request bodies, or
unrelated personal data. Redaction before stored evidence is a safety net, not permission to send
secrets — and the Rust, C++, and C helpers do no client-side redaction at all, so whatever the call
site passes is what leaves the process. A failed observation must never change application control
flow; the helper isolates transport failures, so missing events mean an unexecuted path or a failed
run, never a crash.
3. Reset and reproduce
Clear the previous evidence for this session, then reproduce:
debug-mode reset --session <id>
Reset preserves the session ID, the append path, and your inserted observations; it only clears evidence and restarts sequence numbering. Reproduce yourself whenever the runtime is accessible (run the test, script, or request). If reproduction needs the currently valid Ingest URL, take it from the reset output before running.
4. Read evidence
Use only debug-mode logs, debug-mode query, and debug-mode status to read runtime
evidence. Never use native file-reading tools, shell commands, tail, sed, awk, a direct
jq/jaq, or ad hoc scripts against the evidence — those bypass validation and session isolation.
Start with a bounded read:
debug-mode logs --session <id> --limit 100
Filter or transform with an embedded jaq program:
debug-mode query --session <id> 'select(.message | test("timeout|deadline"; "i"))'
debug-mode query --session <id> 'select(.hypothesisId == "H1" and .data.durationMs >= 100)'
debug-mode query --session <id> '{seq: .sequence, loc: .location, ms: .data.durationMs}'
Streaming is the default and stays memory-bounded. Collection operations — sort_by, group_by,
whole-run aggregation — need explicit --slurp:
debug-mode query --session <id> --slurp \
'group_by(.hypothesisId) | map({hypothesisId: .[0].hypothesisId, count: length})'
Every result is ordered: warnings first, then the session scope, then statistics, then the records or results, then actionable hints. Read them in that order — check warnings, confirm the session, weigh completeness, then follow the printed continuation commands to page. Those commands carry the query scope; reuse them instead of inventing offsets.
If logs or query reports malformed records, inspect all of them:
debug-mode status --session <id>
status lists every malformed record and evidence-health summary. Fix the emitting observation each
diagnostic identifies, reset the session, and reproduce. Never edit stored evidence.
5. Classify each hypothesis
In your own reasoning, mark every hypothesis and cite event IDs or sequence numbers:
CONFIRMED— events directly demonstrate the causal path.REJECTED— events contradict the hypothesis.INCONCLUSIVE— expected evidence is absent or ambiguous.
Missing events can mean an unexecuted path, a failed run, or stale code — not proof of absence. Add a control observation before rejecting on silence. If nothing is confirmed, form new hypotheses in other subsystems and repeat. Remove speculative edits for rejected hypotheses; implement only the smallest fix the confirmed evidence supports.
6. Verify the fix
Keep every observation in place through verification. Record your baseline conclusions from the
first run in your own notes, apply the fix, then reset and reproduce again and re-run the same
queries. The post-fix evidence must show both that the wrong path or state no longer occurs
and that the expected path or invariant now does. Baseline and post-fix both live in this one
session across reset cycles; nothing persists two separate runs for you.
Remove the complete agent log regions only after post-fix evidence succeeds and the user confirms
the behavior looks correct.
7. Clean up
debug-mode reset --session <id>reuses the same session — it clears evidence but keeps the session and your observations for the next attempt. This is the normal per-attempt command.debug-mode clean --session <id>permanently deletes the session and all its evidence. Use it only when the user explicitly asks to delete the investigation.debug-mode stopends the background service without deleting any evidence. The next command restarts it transparently.
Common mistakes
- Fixing before evidence confirms the cause. Collect first.
- Creating a new session per attempt. Reuse one;
resetbetween attempts. - Reading the evidence file directly. Use
logs,query,statusonly. - Rejecting a hypothesis on missing events without a control observation.
- Removing observations before post-fix evidence and user confirmation.
- Putting changing values in
messageinstead ofdata. - Asking the user to run something you can run yourself.
Quick reference
| Step | Command |
|---|---|
| Create session | debug-mode create |
| Get template | debug-mode template --language <l> --ingest <t> |
| Reset evidence | debug-mode reset --session <id> |
| Read a page | debug-mode logs --session <id> --limit 100 |
| Query evidence | debug-mode query --session <id> '<jaq>' |
| Diagnostics | debug-mode status --session <id> |
| Recover an ID | debug-mode sessions |
| Delete a session | debug-mode clean --session <id> |
| Stop the service | debug-mode stop |
For the full command and jaq-query reference, see REFERENCE.md. For worked end-to-end investigations, see EXAMPLES.md.
What ships with it: 2 files
14.1 KB alongside SKILL.md
- EXAMPLES.md5.8 KB
- REFERENCE.md8.3 KB
Gives 0 of the 12 instructions most context ai engineering skills give in ~3.2k tokens
Counted across 1,193 of the 1,976 authors here whose files we hold, read 2026-08-07
- Dispatch a fresh implementer subagent per taskin 48 of 1193, across 19 files
- Dispatch a final code reviewer after all tasksin 33 of 1193, across 8 files
- Provide full task text to the subagentin 30 of 1193, across 9 files
- Review spec compliance before code qualityin 27 of 1193, across 10 files
- Make the hook script executablein 26 of 1193, across 8 files
- Re-snapshot after navigation or DOM changesin 25 of 1193, across 19 files
- Read files before editing themin 22 of 1193, across 11 files
- Answer subagent questions before proceedingin 22 of 1193, across 7 files
- Mark task complete in TodoWrite after approvalin 22 of 1193, across 6 files
- Merge hook into existing settingsin 21 of 1193, across 3 files
- Ask if installation is global or projectin 20 of 1193, across 2 files
- Copy the hook script to target locationin 20 of 1193, across 2 files
Said here and by no other author read
- run available commands yourself
- use one session per investigation
- keep observations inside marked regions
- put changing values in the data field
- reset the session before reproducing
- classify each hypothesis using evidence
Grouped from the skills themselves: near-identical wordings counted once, and counted by distinct author, so one author publishing three of these counts once. Length counted with cl100k_base; the agent that loads this file may tokenize it differently.