Brainbox — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited Brainbox (Agent Skill) and scored it 45/100 (orange). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 8 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 8 flagged
A base64 string of 128+ characters appears in a documentation file. Encoded prompt injection hides the hostile instruction in base64 — invisible to keyword filters — and relies on the agent's ability to decode it at runtime. There is no normal authoring reason to embed a multi-hundred-byte base64 blob in skill docs.
*.sig, SIGNATURES) outside the documentation.Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
<p align="center"> <img src="assets/brainbox-hero.png" alt="BrainBox — AI with muscle memory" width="800" /> </p>
<p align="center"> <a href="https://www.npmjs.com/package/brainbox-hebbian"><img src="https://img.shields.io/npm/v/brainbox-hebbian.svg" alt="npm version" /></a> <a href="https://github.com/thebasedcapital/brainbox/stargazers"><img src="https://img.shields.io/github/stars/thebasedcapital/brainbox?style=social" alt="GitHub stars" /></a> <a href="https://github.com/thebasedcapital/brainbox/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="License" /></a> </p>
Hebbian memory for AI coding agents. Learns which files you access together, which errors lead to which fixes, and which tool chains you use most — then recalls them instantly.
Not a vector database. Not RAG. Procedural memory.
If BrainBox saved you tokens, give it a star — it helps others find it. Built by @thebasedcapital
Session 1: agent greps for auth.ts, reads it, edits it (2000 tokens)
Session 5: agent recalls auth.ts directly, skips search (500 tokens saved)
Session 20: auth.ts is a superhighway — instant recall, zero search costnpm install brainbox-hebbianThat's it. The postinstall script automatically:
PostToolUse hook to ~/.claude/settings.json (learns from every file read/edit/search)UserPromptSubmit hook (injects neural recall into prompts automatically)claude mcp add (6 tools for manual recall/recording)~/.brainbox/ database directoryBrainBox learns passively from your next Claude Code session. No configuration needed.
The macOS daemon (system-wide FSEvents file watcher) is completely separate and opt-in:
# Only if you want BrainBox to learn from VS Code, Xcode, vim, shell, etc.
brainbox daemon install # installs LaunchAgent, starts watching
brainbox daemon status # check if running
brainbox daemon uninstall # remove completelyThe daemon watches file changes across all your editors — not just Claude Code. It requires explicit opt-in because it registers a LaunchAgent and monitors your configured project directories.
brainbox uninstall # removes hooks + MCP server, preserves databaseKill cold start by bootstrapping from your existing git history:
brainbox bootstrap --repo /path/to/project --importsThis seeds the neural network from git commit co-changes and import graphs so BrainBox starts with knowledge instead of from zero.
BrainBox implements neuroscience-inspired learning:
<details> <summary><strong>Hebbian Learning in Action</strong> (click to play)</summary>
https://github.com/thebasedcapital/brainbox/raw/main/assets/brainbox-animation.mp4
</details>
<details> <summary><strong>Spreading Activation</strong> — recalling one file activates related files through synaptic connections</summary>
https://github.com/thebasedcapital/brainbox/raw/main/assets/brainbox-spreading.mp4
</details>
<details> <summary><strong>Superhighway Formation</strong> — frequently-used pathways become instant-recall superhighways</summary>
https://github.com/thebasedcapital/brainbox/raw/main/assets/brainbox-superhighway.mp4
</details>
<details> <summary><strong>Error-Fix Immune System</strong> — remembers which files fixed which errors</summary>
https://github.com/thebasedcapital/brainbox/raw/main/assets/brainbox-immune.mp4
</details>
If you're not using Claude Code, you can run the MCP server standalone:
# 6 tools: record, recall, error, predict_next, stats, decay
npx tsx node_modules/brainbox-hebbian/src/mcp.tsAdd to ~/.config/kilo/config.json:
{
"plugin": ["node_modules/brainbox-hebbian/src/kilo-plugin.ts"]
}BrainBox can be deployed as an OpenClaw memory slot plugin. See NeuroVault for the reference implementation.
| Aspect | Claude Code | OpenClaw |
|---|---|---|
| Tool names | PascalCase (Read) | Lowercase (read) |
| Context injection | UserPromptSubmit hook | before_agent_start lifecycle |
| Learning trigger | PostToolUse hook | after_tool_call lifecycle |
| Embeddings | all-MiniLM-L6-v2 | Keyword-only (lower confidence gate) |
brainbox recall "authentication login"
brainbox record src/auth.ts --context "authentication"
brainbox stats
brainbox error "TypeError: cannot read 'token'"
brainbox predict Read
brainbox embed # add vector embeddings for semantic recall
brainbox hubs # most connected neurons
brainbox stale # decaying superhighways
brainbox projects # list project tags
brainbox sessions # recent sessions with intents
brainbox streaks # anti-recall ignore streaks
brainbox graph # ASCII neural network
brainbox highways # show superhighways
brainbox decay # weaken unused connectionsFiles accessed together form synapses. Access auth.ts then session.ts 10 times and BrainBox learns they're related — recalling one activates the other.
When you fix a bug, BrainBox remembers which files fixed which errors. Next time a similar error appears, it suggests the fix files immediately.
After 20 Grep-Read-Edit chains, BrainBox predicts you'll Read after Grep and pre-loads likely files.
Strong synapses resist further strengthening (like real neural synapses). Prevents any single connection from dominating the network.
Files recalled but never opened get progressively stronger decay. Consecutive ignores escalate: 1st = 10%, 2nd = 19%, 3rd = 27%. Opening the file resets the streak.
Identify the most-connected neurons in your network and detect decaying superhighways before they fade.
Auto-tag file neurons by project. Recall scoped to current project reduces cross-project noise.
src/
hebbian.ts # Core engine: record, recall, decay, SNAP, BCM, spreading activation
db.ts # SQLite schema: neurons, synapses, access_log, sessions
embeddings.ts # Optional vector embeddings (all-MiniLM-L6-v2, 384 dims)
installer.ts # Auto-installer: adds hooks + MCP to ~/.claude/settings.json
mcp.ts # MCP server (6 tools)
hook.ts # Claude Code PostToolUse hook
prompt-hook.ts # Claude Code UserPromptSubmit hook
kilo-plugin.ts # Kilo/OpenCode native plugin
bootstrap.ts # Git/vault/import seeder
daemon.ts # FSEvents file watcher (macOS, opt-in)
cli.ts # CLI interface
test.ts # 59 tests, all passing| Component | Mechanism |
|---|---|
| Synapse formation | Sequential window (25 items), positional decay |
| Strengthening | SNAP sigmoid plasticity (midpoint 0.5, steepness 8) |
| Myelination | BCM sliding threshold + diminishing returns, 0.95 ceiling |
| Confidence | Multiplicative: contextScore * (1 + myelin + recency + path) |
| Spreading | 2-hop BFS, fan-out cap 10, fan effect 1/sqrt(degree) |
| Decay | Activation -15%, synapses -2%, myelination -0.5% per cycle |
| Error learning | 2x boosted learning rate for error neurons |
| Anti-recall | Compound decay: 1 - (1 - 0.1)^streak, floor at 0.1 |
Full details in WHITEPAPER.md.
npm test # 59 tests, ~2sMIT
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.