brain-doctor
Read-only triage of the LastDB brain (Tom's primary brain/kanban daily-driver node — the desktop fold-app process or Mini daemon, reached over the Unix socket…
Skill by EdgeVector
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/edgevector-brain-doctor
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: data, writing
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
- Runs as
- Shell scripts
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/brain-doctor
What's inside
- Skill name
brain-doctor- Description
- Read-only triage of the LastDB brain (Tom's primary brain/kanban daily-driver node — the desktop fold-app process or Mini daemon, reached over the Unix socket ~/.lastdb/data/folddb.sock, also served on the legacy ~/.folddb path) when it's wedged, slow, or down. Bundles the hand-run recipe that recurs on every "is kanban down", "is the brain wedged", "why is my computer so slow", "brain/kanban won't respond", or "LastDB couldn't take over" incident: distinguishes a full sled-IO deadlock from the partial write-path stall, finds duplicate launchd/brew supervisors, catches a stale ~/.folddb/port breadcrumb, and classifies orphan lastdb_server/folddb_server / run.sh / kanban-hook procs vs the real brain. Use when the user (or a routine) reports the brain/board/brain unresponsive or slow, or says "run brain-doctor", "diagnose the brain", "check the brain socket". This is the DIAGNOSE-FIRST companion to machine-hygiene (which does the cleanup/writes); brain-doctor only reads and prints recommended recovery commands — it never kills, restarts, or writes.
- License
- MIT
- Instructions
- 104 lines in SKILL.md · view on GitHub
Before installing
- Ships executable scripts
Agent Skills spec issues
- description: longer than 1024 characters
Files (2)
- SKILL.md
- brain-doctor.sh
SKILL.md (first lines)
# brain-doctor — LastDB socket triage The brain is Tom's primary node — `brain` and `kanban` both run on it. It is the desktop **`fold-app`** process, reached over the **Unix socket `~/.lastdb/data/folddb.sock`** (the same node is also served on the legacy `~/.folddb/data/folddb.sock` path — both return HTTP 200; the legacy local TCP endpoint is shut down). When it stalls, the board and the knowledge base both go dark. This skill codifies the triage recipe that was previously re-derived by hand from 5+ scattered memory notes on every incident. ## Run it ```bash bash ~/.claude/skills/brain-doctor/brain-doctor.sh # primary brain socket bash ~/.claude/skills/brain-doctor/brain-doctor.sh /tmp/dev-node/folddb.sock # an ephemeral dogfood node's socket ``` Exit code: `0` healthy · `1` degraded (drift / partial stall) · `2` wedged (full deadlock) · `3` down (no socket). It is **strictly read-only** — it never kills, restarts, writes a file, or stashes. It prints the exact recommended recovery command for a human (or a supervised session) to run. That honors the standing rule: **never kill the brain unattended; surface, don't act.** ## Situations notices FIRST (before framing an incident) Before treating flapping / timeouts / busy-node as a new outage, check the non-blocking agent-impact feed: ```bash situations notices --since 1h # especially: --system lastdbd or --system last-stack ``` `brain-doctor.sh` also prints a **0. Recent Situations notices** section when the CLI is available. A matching notice (LastDB upgrade, Last Stack upgrade, cutover) means: **expected fallout**, not a new P0 — wait out the notice window before kill/restart recommendations. ## Request ops — name the load (before "wedged") Slow ≠ dead. Before framing a wedge, run: ```bash lastdb status # RSS/CPU/QoS + short request-ops summary lastdb ops # worst clients / kinds / schemas by total time and count lastdb ops --by-app # compact app/verb rows for parsers ``` `lastdb ops` has no `--json` (exits 2: `unexpected argument '--json'`). Use the text tables or `--by-app`. This is Mini's in-process per-request ranking (`status.request_ops`). Clients self-identify via `X-LastDB-Client`. Use `lastdb status`, `lastdb ops`, and `lastdb ops --by-app` to name the top client. Fix or throttle that client; do **not** restart primary `lastdbd` for load alone. ## Reading the output / acting on it The script checks, in order: (0) recent Situations notices, (1) socket + LastDB server PID + uptime/CPU, (2) processes holding the socket (the do-not-kill signal — live client = real brain), (3) responsiveness probe over the socket, (4) duplicate supervisors, (5) vestigial port breadcrumb, (6) orphan folddb procs, (7) disk. Then a verdict. Key triage decisions it encodes: - **WEDGED (full deadlock):** `GET /` over the socket times out **and** CPU ~0%. A plain `brew services restart` / launchctl restart looks successful but leaves the SIGTERM-deaf PID holding the socket. You must `kill -9 <pid>` (confirm first with `sample <pid> 5` showing parked sled `apply_batch`/`make_stable` threads); launchd KeepAlive respawns a healthy PID. **Re-run brain-doctor afterward to confirm the PID changed.** - **DEGRADED (partial write-path stall):** reads + tiny writes are instant but real-sized writes hang >300s (CPU oscillates). A **graceful** `launchctl kickstart -k gui/$(id -u)/com.folddb.daemon` clears it — `kill -9` is NOT needed here. This is uptime-accumulated embedding-path degradation, not data scaling: the same big writes succeed right after restart. - **Duplicate supervisor / stale breadcrumb:** the "LastDB couldn't take over" class. Fix by removing the loser supervisor and/or correcting `~/.folddb/port` (commands are printed). Since fold#812 the breadcrumb is no longer load-bearing for takeover, but it's still drift worth clearing. - **Orphans:** any folddb_server NOT serving the primary socket whose cwd is a **deleted worktree**, plus idle `run.sh --local` harnesses on temp `--home` and hours-old stuck `kanban hooks ingest` procs, are safe sweep candidates — but verify cwd is gone and no live client/builder first, and surface rather than kill in unattended runs. ## When NOT to use this - For actual **cleanup / disk reclaim / worktree pruning** (writes), use the `machine-hygiene` skill — brain-doctor only diagnoses. - It does not touch ephemeral dogfood nodes' teardown — see `~/.claude/scheduled-tasks/_lib/teardown-stale-dogfood-worktrees.sh`. ## Background (memory cross-refs) Historical Brain records still use old slugs: `project_folddb_brain_wedged_2026_06_13` (full vs partial wedge recipe), `project_folddb_desktop_takeover_dup_supervisor` (dup supervisor + stale port), `feedback_dont_kill_primary_folddb_server` (live-brain protection), `project_kanban_orphan_folddb_server` (orphan sweep classifier), `project_cli_status_flake_fixed` / `project_folddb_cli_sled_lock_slow` (slow ≠ wedged).
From EdgeVector/last-stack, MIT.
More from EdgeVector/last-stack
- 0.565score
kanban
EdgeVector
Manage the kanban board — a kanban over LastDB.
SkillAFreshness: AClaude Code +9 - 0.565score
kanban-metrics-dashboard
EdgeVector
Build or refresh an ad-hoc metrics/benchmark view over kanban or LastDB ops data — velocity, throughput, write-timeout benchmarks, board-column funnels…
SkillAFreshness: AClaude Code +9 - 0.565score
board-closeout
EdgeVector
Drain stuck kanban doing cards — merged PRs/CRs to done, true zombies to todo — via the zero-LLM last-stack-board-closeout-sweep.
SkillAFreshness: AClaude Code +9 - 0.565score
factory-health
EdgeVector
Hourly Kanban Factory health check — ship rate, todo depth, doing age vs baselines; ra notify Tom when out of band.
SkillAFreshness: AClaude Code +9 - 0.560score
app-identity-dogfood
EdgeVector
Run the App Identity app-creation flow end-to-end against the DEV environment, autonomously.
SkillAFreshness: AClaude Code +9 - 0.560score
diagram
EdgeVector
Draw a diagram in Tom's preferred style — technical black-and-white line drawings (thin uniform geometric strokes, hatch for solid/stored things, dimension…
SkillAFreshness: AClaude Code +9 - 0.560score
fix-it
EdgeVector
Find and land the permanent fix for a defect, papercut, failing signal, or leftover temporary repair.
SkillAFreshness: AClaude Code +9 - 0.551score
kanban-agent
EdgeVector
Drive a single kanban card all the way to a MERGED PR — a card only reaches `done` when its code is actually in the repo and its outcome is proven.
SkillAFreshness: AClaude Code +9 - 0.551score
close-out
EdgeVector
Run the full close-out loop after finishing a substantive change — worktree PR + auto-merge, file session papercuts, write a full brain report of what was…
SkillAFreshness: AClaude Code +9 - 0.524score
last-stack-machine-leak-scan
EdgeVector
Scan Last Stack for host-machine identity leaks (usernames, home paths, emails, private IPs) that must not ship in the public installable product.
SkillBFreshness: BClaude Code +9 - 0.524score
app-safe-upgrade
EdgeVector
REQUIRED path for upgrading any installed EdgeVector app (kanban, brain, situations, last-stack, search, …).
SkillBFreshness: BClaude Code +9 - 0.524score
kanban-grooming
EdgeVector
Use when auditing or grooming Kanban board health: dependency-stub reconciliation, stale generated blockers, malformed Repo/Base/Kind headers, stale…
SkillBFreshness: BClaude Code +9
Signals
- Stars
- 0
- Forks
- 0
- Open issues
- 0
- Last commit (this folder)
- Sep 27, 2026 (1 month ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- Repository
- github.com/EdgeVector/last-stack
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from EdgeVector
- 0.565score
board-closeout
EdgeVector
Drain stuck kanban doing cards — merged PRs/CRs to done, true zombies to todo — via the zero-LLM last-stack-board-closeout-sweep.
SkillAFreshness: AClaude Code +9 - 0.565score
kanban-metrics-dashboard
EdgeVector
Build or refresh an ad-hoc metrics/benchmark view over kanban or LastDB ops data — velocity, throughput, write-timeout benchmarks, board-column funnels…
SkillAFreshness: AClaude Code +9 - 0.565score
factory-health
EdgeVector
Hourly Kanban Factory health check — ship rate, todo depth, doing age vs baselines; ra notify Tom when out of band.
SkillAFreshness: AClaude Code +9 - 0.565score
kanban
EdgeVector
Manage the kanban board — a kanban over LastDB.
SkillAFreshness: AClaude Code +9 - 0.560score
fix-it
EdgeVector
Find and land the permanent fix for a defect, papercut, failing signal, or leftover temporary repair.
SkillAFreshness: AClaude Code +9 - 0.560score
app-identity-dogfood
EdgeVector
Run the App Identity app-creation flow end-to-end against the DEV environment, autonomously.
SkillAFreshness: AClaude Code +9
Cite this page
brain-doctor skill. Agent Mart. https://agentmart.dev/skills/edgevector-brain-doctor (last updated 2026-10-24)