trace

A debugging workflow that adds temporary trace logs to code, captures what happens when the problem is reproduced, and uses the results to fix the bug.

In plain words
What is it for?
Use it when a developer reports a problem in plain text or with a screenshot. It investigates the relevant execution path, gathers trace output, and guides the next debugging action.
Why use it?
It helps locate where a bug occurs without requiring the developer to manually inspect every part of the code path.

Command

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/shiyas1331/devkit/trace
Clone the repo
git clone --depth 1 https://github.com/shiyas1331/devkit
Per session 15 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 3,926 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00015 $0.03926
Opus 5 $0.00008 $0.01963
Sonnet 5 $0.00003 $0.00785
Haiku 4.5 $0.00002 $0.00393

Measured yesterday against content hash 46055498e045, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

trace scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

commands/trace.md · 404 lines

How it starts

The opening of the file, as written. The whole thing — 404 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Trace and Fix

You are tasked with tracing and fixing a bug by strategically instrumenting code with trace logs, capturing output, and analyzing the results. Your goal is to minimize developer effort — they describe the problem, you do the rest.

Response format — always (except Phase 5):

  • What was done (max 2-3 bullets)
  • Exactly what the developer needs to do right now
  • What happens next

Never explain the debugging process. Never narrate your reasoning. Just direct the next action.

STOP marker: Wherever you see STOP — send your response and wait for developer input before continuing.

Mode picker (front door for empty invocations)

Front door A — empty input → interactive picker

Trigger: $ARGUMENTS is empty.

Use the AskUserQuestion tool. Native UI is faster than reading the help file and printing a menu.

question: "How do you want to describe the bug?"
header: "Input type"
multiSelect: false
options:
  - label: "Text description only"
    description: "Plain prose only. Example: 'login button does nothing after submit' — tool analyzes the code path, adds trace logs at strategic layers, then you reproduce."
  - label: "Text + screenshot"
    description: "Visual evidence + your description. Example: screenshot:/tmp/broken-layout.png with 'profile header overlaps the back button on iPhone X'. Tool reads the image as evidence."
  - label: "Text + log file"
    description: "Console/logcat dump + description. Example: logs:/tmp/logcat.txt with 'app crashes on launch after Firebase init'. Tool parses TRACE_* and ERROR entries."
  - label: "Text + screenshot + log file"
    description: "Everything from a single reproduction. Example: visual bug + logs captured at the moment it happened. Strongest signal for the tool — use when you have both."

After the answer, prompt for the actual inputs as plain text:

Choice Follow-up prompt
Text only "Describe the bug:"
Text + screenshot "Describe the bug, then paste the screenshot path on the next line (or include screenshot:/path inline):"
Text + log file "Describe the bug, then paste the log path (or include logs:/path inline):"
Text + both "Describe the bug, then attach both as screenshot:/path and logs:/path:"

Read the full file on GitHub · 404 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 404 lines · 15 tokens per session scan A 46055498e045

Subscribe to this mod's changes

trace is a command published in the GitHub repository shiyas1331/devkit (4 stars, last pushed 1mo ago), licensed MIT. It adds 15 tokens to every session and 3,926 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.