From codebrain
Orchestrated debugging coordinator. Triggers on frustration signals (stuck, hung, broken) and systematically triages: runtime logs -> server health -> test output -> build status. Reports findings at every step. Use when something is not responding, hanging, timing out, or producing no output.
npx claudepluginhub chrsmay/codebrain-plugin --plugin codebrainThis skill uses the workspace's default tool permissions.
Orchestrated debugging coordinator. Systematically triages stuck, hung, or broken systems by checking signals in a structured order. Never guesses — always collects evidence first.
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.
Orchestrated debugging coordinator. Systematically triages stuck, hung, or broken systems by checking signals in a structured order. Never guesses — always collects evidence first.
/codebrain:observe [symptom]
Never skip steps. Follow the triage order. Report what you find at EVERY step using the reporting contract: "Checking X → Found Y → Next step Z" or "Checking X → No signal → Moving to Z".
Execute in this order. Stop when you find a high-confidence root cause.
Check for error output in the most likely location:
Dev server terminal:
npm run dev / next dev / python manage.py is runningApplication logs:
tail -f any .log files in the projectdocker logs <container> if containerizedvercel logs if deployedBrowser console:
What to report:
Check if the server is actually running and accessible:
# Check if port is in use
netstat -tlnp 2>/dev/null | grep :3000 || ss -tlnp | grep :3000
# Check if server responds
curl -sI http://localhost:3000 --max-time 5
# Check process
ps aux | grep -E "node|python|go" | grep -v grep
Common findings:
Run the project's test suite to check for regressions:
npm test 2>&1 | tail -20
# or
pytest -x --tb=short 2>&1 | tail -20
What to look for:
git stash && npm test to test clean state)Check if the project builds cleanly:
npm run build 2>&1 | tail -30
# or
tsc --noEmit 2>&1 | tail -20
What to look for:
Check environment variables and configuration:
# Check if .env exists and has content
ls -la .env* 2>/dev/null
wc -l .env.local 2>/dev/null
# Check for missing required vars
grep -r "process.env\." --include="*.ts" --include="*.js" -h | grep -oP 'process\.env\.(\w+)' | sort -u
Common findings:
.env.local missing → run vercel env pull or copy .env.example| Symptom | Likely Cause | Check |
|---|---|---|
| Server starts then hangs | Missing await on async call | Search for async functions missing await |
| Server starts, first request hangs | Database connection pool exhausted | Check DB connection config, max connections |
| Intermittent hangs | Race condition or deadlock | Check for concurrent writes to shared state |
| Build hangs | Circular dependency | Check import chains |
| Tests hang | Unresolved promise in setup/teardown | Check beforeAll/afterAll hooks |
| Everything worked yesterday | Env var changed, dep updated, or config drift | git diff HEAD~1 + check .env changes |
Stop the triage when:
/codebrain:investigate for deeper analysis## Observation Report
**Symptom:** [user's description]
**Root Cause:** [FOUND | SUSPECTED | UNKNOWN]
### Triage Steps
| Step | Signal Source | Finding | Confidence |
|------|-------------|---------|------------|
| 1 | Runtime Logs | [finding or "No signal"] | High/Low |
| 2 | Server Health | [finding or "No signal"] | High/Low |
| 3 | Test Output | [finding or "No signal"] | High/Low |
| 4 | Build Status | [finding or "No signal"] | High/Low |
| 5 | Environment | [finding or "No signal"] | High/Low |
### Root Cause
[Detailed explanation with evidence]
### Recommended Action
- [ ] [Action item with specific commands/file:line references]
/codebrain:debug — when root cause is found and needs systematic fix/codebrain:investigate — when issue spans multiple systems (frontend + API + DB)/codebrain:deploy — when issue is environment/deployment related