
Troubleshooting Regression
- 48 installs
- 36 repo stars
- Updated July 14, 2026
- oimiragieo/agent-studio
Helps with ai & agent building tasks.
About
troubleshooting-regression is a Claude Code skill for ai & agent building. It helps solo builders move faster with AI-assisted development.
- troubleshooting-regression
- AI & Agent Building
- AI-coding skill
Troubleshooting Regression by the numbers
- 48 all-time installs (skills.sh)
- Ranked #7,473 of 16,546 AI & Agent Building skills by installs in the Skillselion catalog
- Data as of Aug 4, 2026 (Skillselion catalog sync)
npx skills add https://github.com/oimiragieo/agent-studio --skill troubleshooting-regressionAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 48 |
|---|---|
| repo stars | ★ 36 |
| Last updated | July 14, 2026 |
| Repository | oimiragieo/agent-studio ↗ |
What it does
Helps with ai & agent building tasks.
Files
Troubleshooting Regression
Use this skill when the framework appears stale, stuck, or regressed and you need deterministic diagnosis plus fix verification.
When to Use
- Claude debug sessions stall after spawning agents.
- Hooks block expected actions unexpectedly.
- Memory/search/token-saver enforcement appears inconsistent.
- A regression needs a repeatable reproduction and validation run.
Iron Law
Do not declare a regression fixed without:
1. reproducible trigger prompt, 2. trace evidence from pnpm trace:query, 3. hook/tool evidence from debug logs, 4. targeted test pass for touched scope.
Workflow
1. Identify session and log source. 2. Run trace query first (pnpm trace:query --trace-id <traceId> --compact --since <ISO-8601> --limit 200). 3. Extract high-signal errors (excluding known MCP auth/startup noise). 4. Map each error to owning hook/module. 5. Patch minimal code path and add/update regression test. 6. Run targeted checks (tests + lint/format on changed files). 7. Re-run debug prompt and verify error class no longer reproduces. 8. Record learnings/issues in memory.
Evidence Model
- Source of truth:
C:\\Users\\<user>\\.claude\\debug\\*.txt - Trace source of truth:
pnpm trace:queryoutput for the same incident window - Filter: ignore external MCP transport/auth noise; keep framework/runtime errors
- Error classes:
- routing/task lifecycle
- memory/search/token-saver guardrails
- hook contract/schema violations
- workflow phase/idempotency failures
Command Surface
Primary wrapper:
node .claude/skills/troubleshooting-regression/scripts/main.cjs --prompt "search the codebase for any issues or bugs"
pnpm trace:query --trace-id <traceId> --compact --since <ISO-8601> --limit 200Optional direct log analysis:
node .claude/skills/troubleshooting-regression/scripts/main.cjs --log-path "C:\\Users\\<user>\\.claude\\debug\\<session>.txt"Output Contract
ok: booleanlogPath: analyzed log pathfindings[]: normalized findings with severity and owner file hintsnextActions[]: concrete fix/validation actions
Related Artifacts
- Workflow:
.claude/workflows/troubleshooting-regression-skill-workflow.md - Tool:
.claude/tools/troubleshooting-regression/troubleshooting-regression.cjs - Command:
.claude/commands/troubleshooting-regression.md
Examples
# Analyze latest log
node .claude/skills/troubleshooting-regression/scripts/main.cjs --mode quick
# Analyze specific log and fail when critical findings exist
node .claude/skills/troubleshooting-regression/scripts/main.cjs --log-path "<path>" --strictIron Laws
1. ALWAYS collect evidence (logs, trace IDs, error messages) before making any configuration changes 2. NEVER modify hook or routing configuration without first reproducing the failure deterministically 3. ALWAYS validate the fix by running the full regression test suite after each change 4. NEVER mark a regression resolved until the exact failure scenario passes end-to-end 5. ALWAYS document the root cause, fix, and validation evidence in issues.md for future reference
Anti-Patterns
| Anti-Pattern | Why It Fails | Correct Approach |
|---|---|---|
| Making changes without reproducing failure | Can't verify the change fixed the right thing | Reproduce deterministically first, then fix |
| Fixing symptoms without root cause analysis | Problem recurs under different conditions | Use 5 Whys to trace to the root cause |
| Skipping regression suite after fix | Fix may break other functionality | Run full test suite after every change |
| Undocumented fixes | Same regression returns in future sessions | Record root cause, fix, and validation in issues.md |
| Resolving without end-to-end validation | Integration issues are missed | Validate the exact failure path end-to-end |
Memory Protocol
Before starting:
cat .claude/context/memory/learnings.mdAfter completing:
- Regression pattern ->
.claude/context/memory/learnings.md - Open defect or risk ->
.claude/context/memory/issues.md - New enforcement decision ->
.claude/context/memory/decisions.md
ASSUME INTERRUPTION: Your context may reset. If it's not in memory, it didn't happen.
Invoke the troubleshooting-regression skill and follow it exactly as presented to you
'use strict';
/**
* Post-execute hook for troubleshooting-regression
* Auto-generated by enterprise-bundle-scaffolder
*
* Records metrics after skill execution.
*/
function postExecute(_context) {
// Record execution metrics
return { ok: true, skill: 'troubleshooting-regression' };
}
module.exports = { postExecute };
'use strict';
/**
* Pre-execute hook for troubleshooting-regression
* Auto-generated by enterprise-bundle-scaffolder
*
* Validates inputs before skill execution.
*/
function preExecute(context) {
// Validate skill invocation context
if (!context || typeof context !== 'object') {
return { allow: true, message: 'troubleshooting-regression: no context to validate' };
}
return { allow: true };
}
module.exports = { preExecute };
# Reference materials for this skill
troubleshooting-regression Research Requirements
Research Record
- Date: 2026-02-15
- Intent: design a low-overhead regression troubleshooting skill aligned with existing memory/search/token-saver guardrails.
Exa-first Policy
- Preferred: Exa MCP (
mcp__exa__web_search_exa,mcp__exa__get_code_context_exa) for current debugging/agent-orchestration patterns. - Fallback: WebFetch + arXiv when Exa is unavailable.
Evidence-backed constraints
1. Keep diagnosis deterministic and log-first to avoid speculative patching. 2. Prefer retrieval-first (pnpm search:code) before broad direct file reads in triage loops. 3. Use compression (context-compressor) only under context pressure; do not force it for small traces.
Non-goals
- No autonomous remediation loop inside this skill.
- No replacement of existing router/task lifecycle hooks.
- No direct mutation of memory index internals.
troubleshooting-regression Rules
Purpose
Regression troubleshooting workflow for hook/router/memory/search failures with enforced evidence and fix validation
Best Practices
- Follow established patterns
- Validate inputs at boundaries
Integration Points
See SKILL.md for complete documentation.
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "troubleshooting-regression Input Schema",
"type": "object",
"properties": {
"prompt": {
"type": "string",
"description": "Optional prompt to run via claude -p ... -d before log analysis"
},
"logPath": {
"type": "string",
"description": "Optional absolute path to debug log; latest log is used when omitted"
},
"mode": {
"type": "string",
"enum": ["quick", "full"],
"default": "quick"
},
"strict": {
"type": "boolean",
"default": false
}
},
"additionalProperties": false
}
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "troubleshooting-regression Output Schema",
"type": "object",
"required": ["ok", "logPath", "totalFindings", "criticalFindings", "findings", "nextActions"],
"properties": {
"ok": { "type": "boolean" },
"logPath": { "type": ["string", "null"] },
"totalFindings": { "type": "integer", "minimum": 0 },
"criticalFindings": { "type": "integer", "minimum": 0 },
"findings": {
"type": "array",
"items": {
"type": "object",
"required": ["id", "severity", "message", "owner", "action"],
"properties": {
"id": { "type": "string" },
"severity": { "type": "string", "enum": ["low", "medium", "high"] },
"message": { "type": "string" },
"owner": { "type": "string" },
"action": { "type": "string" }
},
"additionalProperties": false
}
},
"nextActions": { "type": "array", "items": { "type": "string" } },
"runResult": { "type": ["object", "null"], "additionalProperties": true },
"error": { "type": "string" }
},
"additionalProperties": true
}
#!/usr/bin/env node
'use strict';
const fs = require('node:fs');
const path = require('node:path');
const os = require('node:os');
const { spawnSync } = require('node:child_process');
const PROJECT_ROOT = path.resolve(__dirname, '../../../..');
function parseArgs(argv) {
const options = {};
for (let i = 0; i < argv.length; i++) {
const arg = argv[i];
if (!arg.startsWith('--')) continue;
const key = arg.slice(2);
const next = argv[i + 1];
const hasValue = next && !next.startsWith('--');
options[key] = hasValue ? next : true;
if (hasValue) i++;
}
return options;
}
function resolveDebugDir() {
const home = process.env.USERPROFILE || os.homedir();
return path.join(home, '.claude', 'debug');
}
function findLatestLog(debugDir) {
if (!fs.existsSync(debugDir)) return null;
const entries = fs
.readdirSync(debugDir)
.filter(name => name.toLowerCase().endsWith('.txt'))
.map(name => {
const full = path.join(debugDir, name);
const stat = fs.statSync(full);
return { full, mtime: stat.mtimeMs };
})
.sort((a, b) => b.mtime - a.mtime);
return entries.length ? entries[0].full : null;
}
function classifyLine(line) {
const checks = [
{
id: 'task_stall',
severity: 'high',
pattern: /running in the background|wave\s+\d+ agents are working/i,
owner: '.claude/hooks/routing/pre-task-unified.cjs',
action:
'Verify Task/TaskUpdate lifecycle writes and completion propagation in pre/post task hooks.',
},
{
id: 'search_first',
severity: 'medium',
pattern: /\[SEARCH-FIRST\]|read blocked until search evidence/i,
owner: '.claude/hooks/routing/pre-tool-unified.read-safety.cjs',
action:
'Run hybrid search first (`pnpm search:code`) and ensure search evidence is recorded.',
},
{
id: 'memory_first',
severity: 'medium',
pattern: /\[MEMORY-FIRST\]|memory review required before task spawn/i,
owner: '.claude/hooks/routing/pre-task-unified-core.cjs',
action:
'Require memory baseline read (`patterns.json` + `gotchas.json`) before spawning parallel agents.',
},
{
id: 'token_saver_gate',
severity: 'medium',
pattern: /\[TOKEN-SAVER\]|token saver required|context pressure/i,
owner: '.claude/hooks/routing/user-prompt-unified.core.cjs',
action: 'Invoke context-compressor when context pressure threshold triggers.',
},
{
id: 'hook_error',
severity: 'high',
pattern: /\[ERROR\].*hook/i,
owner: '.claude/hooks/',
action: 'Inspect failing hook stack and add regression test for the exact blocked path.',
},
];
for (const check of checks) {
if (check.pattern.test(line)) {
return {
id: check.id,
severity: check.severity,
message: line.trim(),
owner: check.owner,
action: check.action,
};
}
}
return null;
}
function isIgnorableLine(line) {
return /mcp|oauth|auth|credentials|connector/i.test(line);
}
function analyzeLog(logText) {
const lines = String(logText || '').split(/\r?\n/);
const findings = [];
for (const line of lines) {
if (!line || isIgnorableLine(line)) continue;
const finding = classifyLine(line);
if (finding) findings.push(finding);
}
const deduped = [];
const seen = new Set();
for (const finding of findings) {
const key = `${finding.id}:${finding.message}`;
if (seen.has(key)) continue;
seen.add(key);
deduped.push(finding);
}
return deduped;
}
function buildNextActions(findings) {
if (!findings.length) {
return [
'No framework regressions detected in analyzed log (excluding MCP noise).',
'Run one additional prompt from troubleshooting matrix to confirm stability.',
];
}
const actions = [];
for (const finding of findings) {
actions.push(`${finding.id}: ${finding.action}`);
}
actions.push(
'After patching, run targeted tests and a fresh debug session to verify non-reproduction.'
);
return Array.from(new Set(actions));
}
function maybeRunPrompt(prompt) {
if (!prompt) return null;
const proc = spawnSync('claude', ['-p', String(prompt), '-d'], {
cwd: PROJECT_ROOT,
encoding: 'utf8',
windowsHide: true,
shell: false,
timeout: 180000,
});
return {
status: proc.status,
stdoutTail: String(proc.stdout || '').slice(-2000),
stderrTail: String(proc.stderr || '').slice(-2000),
};
}
function main(input = {}) {
const prompt = input.prompt ? String(input.prompt) : '';
const strict = Boolean(input.strict);
const explicitPath = input.logPath ? String(input.logPath) : '';
const debugDir = resolveDebugDir();
const runResult = maybeRunPrompt(prompt);
const logPath = explicitPath || findLatestLog(debugDir);
if (!logPath || !fs.existsSync(logPath)) {
return {
ok: false,
error: `No debug log found. Expected under ${debugDir}`,
logPath: logPath || null,
};
}
const text = fs.readFileSync(logPath, 'utf8');
const findings = analyzeLog(text);
const criticalCount = findings.filter(item => item.severity === 'high').length;
const result = {
ok: !(strict && criticalCount > 0),
logPath,
totalFindings: findings.length,
criticalFindings: criticalCount,
findings,
nextActions: buildNextActions(findings),
runResult,
};
if (!result.ok) {
result.error = 'Strict mode failed due to high-severity findings.';
}
return result;
}
function runCli() {
const options = parseArgs(process.argv.slice(2));
if (options.help) {
process.stdout.write(
'Usage: node .claude/skills/troubleshooting-regression/scripts/main.cjs [--prompt "..."] [--log-path <path>] [--strict]\n'
);
process.exit(0);
}
const result = main({
prompt: options.prompt,
logPath: options['log-path'] || options.logPath,
strict: options.strict === true || options.strict === 'true',
});
if (!result.ok) {
process.stderr.write(JSON.stringify(result, null, 2) + '\n');
process.exit(1);
}
process.stdout.write(JSON.stringify(result, null, 2) + '\n');
}
if (require.main === module) {
try {
runCli();
} catch (error) {
process.stderr.write(String(error && error.message ? error.message : error) + '\n');
process.exit(1);
}
}
module.exports = {
main,
parseArgs,
analyzeLog,
buildNextActions,
findLatestLog,
resolveDebugDir,
};
troubleshooting-regression Implementation Template
Inputs
prompt: optional reproduction prompt forclaude -p ... -dlogPath: optional explicit debug log pathmode:quick|fullstrict: fail if high-severity findings exist
Steps
1. Resolve debug log path (explicit or latest in %USERPROFILE%\\.claude\\debug). 2. Parse lines and filter non-framework MCP noise. 3. Normalize findings with owner file + fix action. 4. Emit actionable JSON summary and strict failure state. 5. Record learnings/issues after fix verification.