trace-claude-code
Automatically trace Claude Code conversations to Braintrust for observability. Captures sessions, conversation turns, and tool calls as hierarchical traces.
Identify failure modes before they occur using structured risk analysis
$ npx -y skills add parcadei/Continuous-Claude-v3 --skill premortem --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/premortemContext preview
The summary Claude sees to decide when to auto-load this skill.
Identify failure modes before they occur using structured risk analysis
name: premortem description: Identify failure modes before they occur using structured risk analysis allowed-tools: [Read, Grep, Glob, Task, AskUserQuestion, TodoWrite]
Identify failure modes before they occur by systematically questioning plans, designs, and implementations. Based on Gary Klein's technique, popularized by Shreyas Doshi (Stripe).
/premortem # Auto-detect context, choose depth /premortem quick # Force quick analysis (plans, PRs) /premortem deep # Force deep analysis (before implementation) /premortem <file> # Analyze specific plan or code
> "Imagine it's 3 months from now and this project has failed spectacularly. Why did it fail?"
| Category | Symbol | Meaning | |----------|--------|---------| | **Tiger** | `[TIGER]` | Clear threat that will hurt us if not addressed | | **Paper Tiger** | `[PAPER]` | Looks threatening but probably fine | | **Elephant** | `[ELEPHANT]` | Thing nobody wants to talk about |
**Do NOT flag risks based on pattern-matching alone.** Every potential tiger MUST go through verification.
Common mistakes that create false tigers:
Before flagging ANY tiger, verify:
potential_finding: what: "Hardcoded path at line 42" verification: context_read: true # Did I read ±20 lines around the finding? fallback_check: true # Is there try/except, if exists(), or else branch? scope_check: true # Is this even in scope for this code? dev_only_check: true # Is this in __main__, tests/, or dev-only code? result: tiger | paper_tiger | false_alarm
**If ANY verification check is "no" or "unknown", DO NOT flag as tiger.**
Every tiger MUST include:
tiger: risk: "<description>" location: "file.py:42" severity: high|medium # REQUIRED - what mitigation was checked and NOT found: mitigation_checked: "No exists() check, no try/except, no fallback branch"
If you cannot fill in `mitigation_checked` with specific evidence, it's not a verified tiger.
# Auto-detect based on context
if in_plan_creation:
depth = "quick" # Localized scope
elif before_implementation:
depth = "deep" # Global scope
elif pr_review:
depth = "quick" # Localized scope
else:
# Ask user
AskUserQuestion(
question="What depth of pre-mortem analysis?",
header="Depth",
options=[
{"label": "Quick (2-3 min)", "description": "Plans, PRs, localized changes"},
{"label": "Deep (5-10 min)", "description": "Before implementation, global scope"}
]
)Run through these mentally, note any that apply:
**Core Questions:** 1. What's the single biggest thing that could go wrong? 2. Any external dependencies that could fail? 3. Is rollback possible if this breaks? 4. Edge cases not covered in tests? 5. Unclear requirements that could cause rework?
**Output Format:**
premortem:
mode: quick
context: "<plan/PR being analyzed>"
# Two-pass process: first gather potential risks, then verify each one
potential_risks: # Pass 1: Pattern-matching findings
- "hardcoded path at line 42"
- "missing error handling for X"
# Pass 2: After verification
tigers:
- risk: "<description>"
location: "file.py:42"
severity: high|medium
category: dependency|integration|requirements|testing
mitigation_checked: "<what was NOT found>" # REQUIRED
elephants:
- risk: "<unspoken concern>"
severity: medium
paper_tigers:
- risk: "<looks scary but ok>"
reason: "<why it's fine - what mitigation EXISTS>"
location: "file.py:42-48" # Show the mitigation location
false_alarms: # Findings that turned out to be nothing
- finding: "<what was initially flagged>"
reason: "<why it's not a risk>"Work through each category systematically:
**Technical Risks:**
**Integration Risks:**
**Process Risks:**
**Testing Risks:**
**Output Format:**
premortem:
mode: deep
context: "<implementation being analyzed>"
# Two-pass process
potential_risks: # Pass 1: Initial scan findings
- "no circuit breaker for external API"
- "hardcoded timeout value"
# Pass 2: After verification (read context, check for mitigations)
tigers:
- risk: "<description>"
location: "file.py:42"
severity: high|medium
category: scalability|dependency|data|security|integration|testing
mitigation_checked: "<what mitigations were looked for and NOT found>"
suggested_fix: "<how to address>"
elephants:
- risk: "<unspoken concern>"
severity: medium|high
suggested_fix: "<suggested apprA persistent, learning, multi-agent development environment built on Claude Code Continuous Claude transforms Claude Code into a continuously learning system that maintains context across sessions, orchestrates specialized agents, and eliminates wasting
Repo: parcadei/Continuous-Claude-v3
Automatically trace Claude Code conversations to Braintrust for observability. Captures sessions, conversation turns, and tool calls as hierarchical traces.
Guide for integrating Agentica SDK with Claude Code CLI proxy
Reference guide for Agentica multi-agent infrastructure APIs