Flags positive (+) or negative (-) behavioral moments from chat history, reconstructs events, discusses lessons, categorizes, crafts entries, and stores weighted lessons.
From thebrainnpx claudepluginhub advenire-consulting/thebrain --plugin thebrain/dopamineDopamine plugin control. Run the appropriate command based on the user's argument: "$ARGUMENTS"
A deliberate "this moment matters" flag. A structured discussion about what just happened and why it matters.
$PLUGIN_ROOT resolution: Read the first line of ~/.claude/rules/brain-tools.md — it contains <!-- PLUGIN_ROOT: /path/to/thebrain -->. Use that path wherever $PLUGIN_ROOT appears below.
Routing:
/dopamine + — Something worked well. Brain file is nucleus accumbens. Still discuss the lesson in step 2./dopamine - — Something burned us. Brain file is amygdala. Still discuss the lesson in step 2./dopamine (bare) — Ask: "Was this a positive spike or a negative one?" Then route.If the answer doesn't cleanly map to nucleus accumbens/amygdala (e.g., a decision rule or routing insight), step 2 determines the brain file.
Do all steps in order:
Review the last 10-15 messages. Describe what happened: what was attempted, what went wrong or right, what the user's reaction was. Present this back for confirmation. Don't proceed until the user confirms the reconstruction is accurate.
What's the takeaway? The polarity (+/-) tells you where it goes, not why it matters. Discuss the lesson with the user.
If brain file is already set by + or -, focus on what the pattern or pain point was. If bare /dopamine, also determine which brain file:
User refines, you adapt.
Does this fit an existing domain/category in the lessons DB? Check:
node $PLUGIN_ROOT/scripts/dopamine-helper.js --lessons
If a match exists, state which one and why. If no match, propose a new domain and discuss where it belongs. Don't force-fit into existing categories.
Collaboratively craft:
critical/moderate/low for amygdala, proven/emerging for nucleus accumbensPresent the final entry for user approval before storing. The summary is critical — without it, the full entry_text bloats the session-start hook and causes tool-index truncation.
After user approves, insert into the lessons table:
node $PLUGIN_ROOT/scripts/dopamine-helper.js --insert \
--brain "<brain_file>" \
--domain "<domain>" \
--title "<title>" \
--entry "<full entry text>" \
--summary "<one-sentence reasoning>" \
--severity "<tag>"
Optional: --weight <0-100> to override the default increment. Use when the user specifies an exact weight.
The --summary flag is required for new entries. Without it, the lesson loads with full entry_text at session start, which can push the hook output past the truncation threshold and lose the tool-index.
This stores with weight = 50 (new) or +50 (reinforces existing, capped at 100). A single dopamine flag lands in Inclination tier. Two flags promote to Rule tier.
Weight scale: 75-100 = Rule (always loaded, directive), 50-74 = Inclination (always loaded, questionable), 25-49 = Awareness (on-demand), <25 = Data (background).
Report: what was stored, which brain file, the weight, the tier it landed in, and that it's immediately available via --surface.