Region mapping
Which Claude Code tools light up which brain regions, and how to add your own.
The mapping is straightforward and lives in one place: claude-brain-watcher/lib/regions.js. Editing that file is how you teach the brain to recognise a new tool or shift a mapping.
The eight regions
| Region | Capability | Tools |
|---|---|---|
| Prefrontal cortex | Planning · Reasoning | Task, TodoWrite, ExitPlanMode, long-form thinking |
| Motor cortex | Tool execution | Bash, BashOutput, Write, SlashCommand |
| Parietal lobe | Architecture · Structure | MCP tools, unknown integrations |
| Visual cortex | File reading | Read, Glob, Grep, LS, NotebookRead |
| Broca's area | Code generation | Assistant text containing code blocks |
| Wernicke's area | Language understanding | Assistant text (prose) |
| Temporal lobe | Web search · Retrieval | WebSearch, WebFetch |
| Cerebellum | Precision · Refactoring | Edit, MultiEdit, NotebookEdit |
Why this shape
When we first prototyped the visualization we used a flat counter dashboard — events per minute, token budget, files touched. The numbers were accurate and the page was useless. Nobody looked at it.
The brain works because an AI session is a sequence of cognitive moves, and the moves are not undifferentiated. Reading a file is different from editing one. Searching the web is different from running a shell. Treating all tool calls as the same kind of event throws away the part that's interesting.
So we mapped the tool surface onto regions whose function in the human brain rhymes with what the tool actually does. Reads are sensory input → visual cortex. Shell commands are motor output → motor cortex. Edits are precise micro-movements → cerebellum. The rhymes aren't strict (Broca's area doesn't really write Python) but the visual shorthand is what matters: a debugging session looks different from a refactor at a glance, even with no labels visible.
Adding a new tool
In lib/regions.js:
const TOOL_REGION = {
Read: 'visual',
Edit: 'cerebellum',
Bash: 'motor',
// … add your tool here:
MyCustomTool: 'parietal',
};
Unknown tools fall through to parietal (the "architecture / structure" region) by default. That's intentional — new MCP integrations and bring-your-own tools shouldn't disappear from the visualization just because the hub hasn't been updated to recognise them; they get a default region that signals "this is novel" without misclassifying.
If you're sending events from a non-Claude-Code runtime, you set the region directly in the event payload — see sender integration.
Adjusting firing intensity
The brain decides how brightly to fire a region using two inputs from lib/regions.js:
BASE_INTENSITY[region]— minimum brightness per fire.TOKEN_GAIN— how much each token of output adds.
A read with 200 tokens of file content fires brighter than a LS returning a 3-line directory listing. A long-running Bash that emits one line of output but takes 10 seconds is given a small time-based bump independently. The math is in landing/components/BrainOrb.tsx — viewer-side, so the same event renders consistently across all connected browsers.
Reduce-motion behaviour
When the browser advertises prefers-reduced-motion: reduce, the brain switches from animated firing to a steady glow with intensity proportional to the last 5 seconds of activity. The region you fired most appears brightest, but nothing pulses or flashes. This is the right experience for screen-reader users and for anyone who finds the animated mode tiring on a long session.