From codebrain
Deep multi-system investigation for complex issues. Traces problems across boundaries: frontend -> API -> database -> external services. Builds evidence timeline and identifies root cause. Use for intermittent failures, race conditions, data inconsistencies, and issues that span multiple components.
npx claudepluginhub chrsmay/codebrain-plugin --plugin codebrainThis skill uses the workspace's default tool permissions.
Deep investigation for complex, multi-system issues. Goes beyond surface-level debugging to trace problems across system boundaries.
Creates isolated Git worktrees for feature branches with prioritized directory selection, gitignore safety checks, auto project setup for Node/Python/Rust/Go, and baseline verification.
Executes implementation plans in current session by dispatching fresh subagents per independent task, with two-stage reviews: spec compliance then code quality.
Dispatches parallel agents to independently tackle 2+ tasks like separate test failures or subsystems without shared state or dependencies.
Deep investigation for complex, multi-system issues. Goes beyond surface-level debugging to trace problems across system boundaries.
/codebrain:investigate [description of issue]
/codebrain:observe couldn't resolveBuild a hypothesis tree, not a linear search. Complex issues often have multiple contributing factors. Track all hypotheses simultaneously, eliminating them with evidence.
Reproduce the issue (or document the reproduction failure)
git log --oneline -20, env changes, dep updates)Map the system boundaries
User → Frontend → API Gateway → Backend → Database
→ Cache (Redis)
→ External API
→ Message Queue
Identify which boundaries the failing request crosses.
Collect timestamps
For each system boundary, verify data integrity:
Frontend → API:
# Capture the exact request
curl -v -X POST http://localhost:3000/api/endpoint \
-H "Content-Type: application/json" \
-d '{"test": "data"}' 2>&1
API → Database:
API → External Services:
API → Cache:
## Hypothesis Tree
Root Issue: [description]
├── H1: [First hypothesis]
│ ├── Evidence FOR: [what supports this]
│ ├── Evidence AGAINST: [what contradicts this]
│ └── Status: CONFIRMED | ELIMINATED | NEEDS DATA
├── H2: [Second hypothesis]
│ ├── Evidence FOR: ...
│ ├── Evidence AGAINST: ...
│ └── Status: ...
└── H3: [Third hypothesis]
├── Evidence FOR: ...
├── Evidence AGAINST: ...
└── Status: ...
Rules for hypothesis management:
Based on the hypothesis tree, run targeted checks:
For timing/race conditions:
await or fire-and-forget patternsFor data inconsistencies:
For intermittent failures:
# Investigation Report
**Issue:** [one-line description]
**Severity:** Critical | Major | Minor
**Date:** [ISO date]
**Time to Root Cause:** [duration]
## Symptom
[Exact description of what the user sees]
## System Boundary Map
[ASCII diagram showing the data flow and where the issue occurs]
## Evidence Timeline
| Time | Event | Source | Notes |
|------|-------|--------|-------|
| T-0 | Issue first reported | User | ... |
| T-1 | Last known working state | Git/Deploy log | ... |
| T-2 | Change X deployed | CI/CD | ... |
## Hypothesis Tree (Final)
[Show which hypotheses were confirmed/eliminated with evidence]
## Root Cause
**What:** [Exact description of the bug/misconfiguration/race condition]
**Where:** [file:line or system boundary]
**Why:** [Why this wasn't caught earlier]
**When introduced:** [commit, deploy, or config change]
## Reproduction Steps
1. [Step 1]
2. [Step 2]
3. [Observe: ...]
## Recommended Fix
- [ ] [Primary fix with file:line reference]
- [ ] [Regression test to prevent recurrence]
- [ ] [Monitoring/alerting to detect if it happens again]
## Prevention
- [ ] [What process/check would have caught this?]
/codebrain:plan — root cause found, fix needs a structured implementation plan/codebrain:deploy — root cause is configuration or environment related/codebrain:debug — root cause is isolated to a single component