Debug issues that occur sporadically and are hard to reproduce. Use monitoring and systematic investigation to identify root causes of flaky behavior.
Intermittent issues are the most difficult to debug because they don't occur consistently. Systematic approach and comprehensive monitoring are essential.
Minimal working example:
// Strategy 1: Comprehensive Logging
// Add detailed logging around suspected code
function processPayment(orderId) {
const startTime = Date.now();
console.log(`[${startTime}] Payment start: order=${orderId}`);
try {
const result = chargeCard(orderId);
console.log(`[${Date.now()}] Payment success: ${orderId}`);
return result;
} catch (error) {
const duration = Date.now() - startTime;
console.error(`[${Date.now()}] Payment FAILED:`, {
order: orderId,
error: error.message,
duration_ms: duration,
error_type: error.constructor.name,
stack: error.stack,
});
throw error;
}
}
// Strategy 2: Correlation IDs
// ... (see reference guides for full implementation)
Detailed implementations in the references/ directory:
| Guide | Contents | |---|---| | Capturing Intermittent Issues | Capturing Intermittent Issues | | Common Intermittent Issues | Common Intermittent Issues | | Systematic Investigation Process | Systematic Investigation Process | | Monitoring & Prevention | Monitoring & Prevention |
Copy a source-pinned command for your client. You run it yourself.
Destination: .claude/skills/intermittent-issue-debugging · pinned to the source commit
git clone https://github.com/aj-geddes/useful-ai-prompts.git
cd useful-ai-prompts
git checkout 3f5182cfd739fc113f4af5244a1cf342ad7f7911
mkdir -p ".claude/skills/intermittent-issue-debugging"
cp -r "skills/intermittent-issue-debugging" ".claude/skills/intermittent-issue-debugging"Review the source before running. This copies files into your project; it is not a one-click install and does not verify runtime safety.
Scanner static-checks@0.1.0 · commit 3f5182cfd739. Static checks cannot prove runtime safety – review the source and the exact diff before installing. How checks work.
No static rules matched. This is not a safety guarantee.