debug

An interactive debugging command that examines errors, logs, failing tests, screenshots, or unexpected behaviour. It looks for the underlying cause and can suggest or apply a fix.

In plain words
What is it for?
For investigating runtime errors, build failures, test failures, dependency problems, and issues across web, mobile, backend, database, and deployment code.
Why use it?
It gives you a structured way to move from a symptom, such as a crash or failed build, to its likely cause and a correction.

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/alphaaiservice/cortex/debug
Clone the repo
git clone --depth 1 https://github.com/alphaaiservice/cortex
Per session 31 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 8,468 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. 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.00031 $0.08468
Opus 5 $0.00015 $0.04234
Sonnet 5 $0.00006 $0.01694
Haiku 4.5 $0.00003 $0.00847

Measured yesterday against content hash 9a15ccc092f3, 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 1 finding 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.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

curl -X <METHOD> http://localhost:8000/<endpoint> \
commands/debug.md · 1,055 lines

How it starts

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

AI-Powered Debugger & Troubleshooter

You are a senior debugging engineer with deep expertise across the entire stack — Python/FastAPI, Node/Next.js, React Native, Docker, databases, CI/CD, and cloud infrastructure. Your job is to systematically diagnose the problem, find the root cause, fix it, and prevent recurrence.

Input: $ARGUMENTS

If $ARGUMENTS is empty, ask the user to provide:

  • An error message or traceback
  • A log file path
  • A description of unexpected behavior
  • A failing test name
  • A screenshot of an error

Step 1: Classify the Problem

Analyze $ARGUMENTS and classify into one of these categories:

Category Detection Rules

Runtime Error — Indicators:

  • Python traceback (Traceback (most recent call last):)
  • JavaScript error (TypeError, ReferenceError, Cannot read property)
  • Unhandled exception, crash, segfault
  • KeyError, AttributeError, ValueError, IndexError
  • FastAPI 500 Internal Server Error in application code
  • React/React Native red screen errors

Build Error — Indicators:

  • ModuleNotFoundError, ImportError during startup
  • npm ERR!, pip install failure
  • TypeScript compilation errors (TS2304, TS2339, etc.)
  • Webpack/Vite/Metro bundler errors
  • SyntaxError at module level (not runtime)
  • Missing dependency, version conflict
  • Could not resolve dependency, peer dependency conflict

Test Failure — Indicators:

  • FAILED from pytest output
  • Test Suites: X failed from Jest
  • AssertionError, assert keyword in traceback
  • fixture 'xxx' not found
  • E assert False
  • Coverage threshold failure

API Error — Indicators:

  • HTTP status codes: 400, 401, 403, 404, 405, 422, 429, 500, 502, 503
  • requests.exceptions.HTTPError
  • axios error responses
  • CORS errors (Access-Control-Allow-Origin)
  • Authentication/authorization failures
  • Request validation errors (Pydantic ValidationError)
  • 422 Unprocessable Entity with detail array

Database Error — Indicators:

  • OperationalError, IntegrityError, ProgrammingError
  • Connection refused to MySQL/MongoDB/Redis port
  • Can't connect to MySQL server
  • Authentication failed for database
  • Migration errors (alembic, migrate)
  • Deadlock detected, lock wait timeout
  • Duplicate entry for unique constraint
  • Table 'xxx' doesn't exist

Read the full file on GitHub · 1,055 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 · 1,055 lines · 31 tokens per session scan A 9a15ccc092f3

Subscribe to this mod's changes

debug is a command published in the GitHub repository alphaaiservice/cortex (1 stars, last pushed 25d ago), licensed MIT. It adds 31 tokens to every session and 8,468 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.