debug

A command for investigating software errors by classifying them, tracing their source, and comparing expected with actual behaviour.

In plain words
What is it for?
Use it to locate the source of syntax, runtime, type, or logic errors and receive concrete fixes with boundary cases to consider.
Why use it?
It turns an error message and stack trace into a diagnosis by examining the relevant code and the conditions that triggered the problem.

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/echovic/blade-code/debug
Clone the repo
git clone --depth 1 https://github.com/echoVic/blade-code
Per session 5 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 307 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.00005 $0.00307
Opus 5 $0.00003 $0.00153
Sonnet 5 $0.00001 $0.00061
Haiku 4.5 $0.00001 $0.00031

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

Security

Grade A, and why

debug 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.

.blade/commands/debug.md · 62 lines

What it actually says

请帮我分析以下错误。

错误信息

$ARGUMENTS

分析步骤

1. 错误分类

  • 语法错误 / 运行时错误 / 类型错误 / 逻辑错误?
  • 来自哪个模块?

2. 定位源头

  • 从错误堆栈追溯
  • 找到触发错误的代码

3. 上下文分析

  • 阅读相关代码
  • 理解预期行为
  • 找出实际行为与预期的差异

4. 根因分析

  • 为什么会发生这个错误?
  • 什么条件触发了它?

5. 修复建议

  • 提供具体的修复方案
  • 说明修复原理
  • 考虑边界情况

输出格式

🔍 错误类型:[类型]
📍 位置:[文件:行号]
🎯 根因:[简短描述]

📝 详细分析:
...

💡 修复建议:
1. ...
2. ...

⚠️ 注意事项:
- ...

如果需要更多信息来定位问题,请告诉我需要什么。

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 · 62 lines · 5 tokens per session scan A c935c6e615fa

Subscribe to this mod's changes

debug is a command published in the GitHub repository echoVic/blade-code (177 stars, last pushed yesterday), licensed MIT. It adds 5 tokens to every session and 307 once invoked, about $0.0000 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-30.