Skip to content

Add Amygdala habit learning feature to memento #126

@dpuglielli

Description

@dpuglielli

Summary

Add Amygdala as a feature within memento that extracts behavioral habits from session history and injects them as low-context reflexes. While memento handles declarative memory (what happened), amygdala handles procedural memory (how to behave).

Background

Analysis of 139 sessions across 2 projects revealed consistent behavioral patterns (85-100% frequency) that could be extracted as "habits" - low-token reflexes that reinforce good practices without the overhead of full mantra rules.

Design document: docs/plans/2026-01-17-amygdala-design.md

Phase 1: Manual Curation

Features

  • Storage: ~/.claude/amygdala/habits.md (global) + .claude/amygdala/habits.md (project)
  • Format: Ultra-compact stimulus→response (error|bug → reproduce → evidence → fix)
  • Injection: Via memento's SessionStart hook with 🧠 emoji
  • Skills:
    • /memento:amygdala - Show current habits
    • /memento:amygdala add "<verbose>" - Add habit with auto-compaction

Acceptance Criteria

  • Habits appear in session context with 🧠 emoji
  • /memento:amygdala shows current global and project habits
  • /memento:amygdala add "verbose description" compacts to stimulus→response format
  • /memento:amygdala add prompts for global vs project destination
  • Global habits (~/.claude/amygdala/habits.md) work across all projects
  • Project habits (.claude/amygdala/habits.md) are additive to global
  • Total habit injection stays under ~100 tokens
  • Tests cover habit loading and skill functionality

Files to Create/Modify

memento/
├── hooks/
│   └── session-start.js    # MODIFY: add habit loading
├── commands/
│   ├── amygdala.md         # NEW: show habits
│   └── amygdala-add.md     # NEW: add habit (verbose→compact)
├── lib/
│   └── amygdala.js         # NEW: habit loading utilities
└── __tests__/
    └── amygdala.test.js    # NEW: tests

Phase 2: Automatic Learning (Future)

  • /memento:amygdala learn - Analyze sessions, suggest habits
  • /memento:amygdala prune - Remove stale habits
  • Confidence scoring and trend tracking

Related

  • Exploration branch: chore/explore-amygdala
  • Session file: .claude/sessions/chore-explore-amygdala.md

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions