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.
npx agentmods add commands/matt-dionis/claude-code-configs/debuggit clone --depth 1 https://github.com/Matt-Dionis/claude-code-configsWhat 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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00000 | $0.01971 |
| Opus 5 | $0.00000 | $0.00986 |
| Sonnet 5 | $0.00000 | $0.00394 |
| Haiku 4.5 | $0.00000 | $0.00197 |
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 2d ago.
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.
Runs shell commandslowCapability
Expected in a hook, worth knowing in a rule or an instructions file.
import { exec, spawn } from 'child_process'; How it starts
The opening of the file, as written. The whole thing — 310 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Debug MCP Server
Provides comprehensive debugging tools for troubleshooting MCP server issues.
Usage
/debug [component] [options]
Components
protocol- Debug protocol messagestools- Debug tool executionresources- Debug resource accesstransport- Debug transport layerall- Enable all debugging (default)
Options
--verbose- Extra verbose output--save- Save debug logs to file--inspector- Launch with MCP Inspector
Implementation
import * as fs from 'fs/promises';
import { exec, spawn } from 'child_process';
import * as path from 'path';
async function debugServer(
component: 'protocol' | 'tools' | 'resources' | 'transport' | 'all' = 'all',
options: {
verbose?: boolean;
save?: boolean;
inspector?: boolean;
} = {}
) {
console.log('🔍 MCP Server Debugger');
console.log('='.repeat(50));
// Set debug environment variables
const debugEnv = {
...process.env,
DEBUG: component === 'all' ? 'mcp:*' : `mcp:${component}`,
LOG_LEVEL: options.verbose ? 'trace' : 'debug',
MCP_DEBUG: 'true',
};
// Create debug configuration
const debugConfig = await createDebugConfig();
// Start debug session
if (options.inspector) {
await launchWithInspector(debugEnv);
} else {
await runDebugSession(component, debugEnv, options);
}
}
async function createDebugConfig(): Promise<string> {
const config = {
logging: {
level: 'debug',
format: 'pretty',
includeTimestamp: true,
includeLocation: true,
},
debug: {
protocol: {
logRequests: true,
logResponses: true,
logNotifications: true,
},
tools: {
logCalls: true,
logValidation: true,
logErrors: true,
measurePerformance: true,
},
resources: {
logReads: true,
logWrites: true,
trackCache: true,
},
transport: {
logConnections: true,
logMessages: true,
logErrors: true,
},
},
};
const configPath = '.debug-config.json';
await fs.writeFile(configPath, JSON.stringify(config, null, 2));
return configPath;
}
async function runDebugSession(
component: string,
env: NodeJS.ProcessEnv,
options: { verbose?: boolean; save?: boolean }
) {
console.log(`\n🔍 Debugging: ${component}`);
console.log('Press Ctrl+C to stop\n');
// Create debug wrapper
const debugScript = `
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
import debug from 'debug';
import pino from 'pino';
// Enable debug logging
const log = {
protocol: debug('mcp:protocol'),
tools: debug('mcp:tools'),
resources: debug('mcp:resources'),
transport: debug('mcp:transport'),
};
// Create logger
const logger = pino({
level: process.env.LOG_LEVEL || 'debug',
transport: {
target: 'pino-pretty',
options: {
colorize: true,
translateTime: 'HH:MM:ss.l',
ignore: 'pid,hostname',
},
},
});
// Wrap server methods for debugging
const originalServer = await import('./src/index.js');
const server = originalServer.server;
// Intercept requests
const originalSetRequestHandler = server.setRequestHandler.bind(server);
server.setRequestHandler = (schema, handler) => {
const wrappedHandler = async (request) => {
const start = Date.now();
log.protocol('→ Request: %O', request);
logger.debug({ request }, 'Incoming request');
try {
const result = await handler(request);
const duration = Date.now() - start;
log.protocol('← Response (%dms): %O', duration, result);
logger.debug({ result, duration }, 'Response sent');
return result;
} catch (error) {
log.protocol('✗ Error: %O', error);
logger.error({ error }, 'Request failed');
throw error;
}
};
return originalSetRequestHandler(schema, wrappedHandler);
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.
- 2d ago First seen · 310 lines · 0 tokens per session scan A 152d4f1344b2
debug is a command published in the GitHub repository Matt-Dionis/claude-code-configs (625 stars, last pushed 1y ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,971 tokens. A static security scan graded it A with 1 finding (runs shell commands). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other commands, from other repositories
checklist
Generate a custom checklist for the current feature based on user requirements.
clarify
Identify underspecified areas in the current feature spec by asking up to 5 highly targeted clarification questions and encoding answers back into the spec.
specify
Create or update the feature specification from a natural language feature description.
analyze
Perform a non-destructive cross-artifact consistency and quality analysis across spec.md, plan.md, and tasks.md after task generation.
converge
Assess the current codebase against the feature's spec, plan, and tasks, then append any remaining unbuilt work as new tasks to tasks.md so implement can complete it.
implement
Execute the implementation plan by processing and executing all tasks defined in tasks.md.