π¬ 2-minute explainer above β auto-plays muted Β· click π to unmute Β· or open on Release page
Claude Code Β· Cursor Β· Cline Β· Codex Β· Copilot Β· Windsurf Β· Kilo Β· Roo Β· OpenCode Β· Aider β all running on one local brain. What one agent learns, every agent knows. What one sub-agent discovers, every sub-agent inherits.
# 30 seconds. Every agent + sub-agent on your machine becomes smarter.
npx @theihtisham/agent-shadow-brain@latest attach-allπ¬ Video Β· π¦ npm Β· β Star on GitHub Β· π Docs Β· π Issues
# Method 1 β one command, every agent wired, dashboard launches
npx @theihtisham/agent-shadow-brain@latest attach-all
# Method 2 β global install
npm install -g @theihtisham/agent-shadow-brain
shadow-brain attach-all
shadow-brain dash . # β http://localhost:7341/
# Method 3 β in a specific project only
cd my-project
npx @theihtisham/agent-shadow-brain attach-allZero config. Zero API key required. 100 % local-first.
| Without Shadow Brain | With Shadow Brain v6 |
|---|---|
| Every new session β agent starts from zero | 2K-token briefing injected before the first prompt |
| Cursor learns X β Claude doesn't know | One singleton brain every agent shares |
| Claude Task spawns sub-agent β sub-agent starts blind | SABB injects focused context slivers into every sub-agent |
| You can't explain why the AI made a choice | Causal Memory Chains render the full DAG of causes |
| Two agents touching the same file = merge hell | Collision Detective catches it in real time |
| Agents work, then go idle β wasted compute | Dream Engine reflects during idle, runs counterfactuals |
| No verifiable record of agent decisions | Ed25519-signed Reputation Ledger β tamper-proof receipts |
| Token bills explode across Opus / GPT / Gemini | Token Economy routes to cheapest model that passes confidence |
| Needs its own API key for everything | Agent-proxy mode reuses your existing Claude/Cursor/Codex config |
| Every tool runs hot, every key leaks | Air-Gap mode + ChaCha20 encryption at rest |
This isn't a wrapper around someone else's API. All 22 are first-party research-grade implementations, persisted to disk, with real tests.
- Sub-Agent Brain Bridge (SABB) β sync brain context into Claude Task / Cursor Composer / CrewAI / LangGraph / AutoGen sub-agents
- Causal Memory Chains β every decision links to its causes; Graphviz DOT export
- Dream Engine β idle-time reflection: revisit / counterfactual / consolidation / contradiction / pattern-discovery
- Swarm Debate Protocol β pro / con / arbiter sub-agents for critical decisions
- Pre-Mortem Assistant β surfaces past failures from your project before you start
- Branch Brains β git-branch-aware memory context
- Agent Reputation Ledger β Ed25519-signed receipts, portable accuracy score
- Attention Heatmap β weighted attribution showing which memories shaped a decision
- Confidence Calibration Monitor β Brier scores + automatic trust-weighting
- Formal Verification Bridge β natural-language rules β ESLint / Semgrep / LSP diagnostics
- Agent Collision Detective β real-time overlap detection with advisory locks
- Token Economy Engine β cross-agent spend, savings suggestions, routing advice
- Cost-Aware Sub-Agent Spawner β auto-route trivial tasks to cheaper models
- Forgetting Curve + Sleep Consolidation β Ebbinghaus-inspired biological memory
- Air-Gap Mode β zero outbound network, localhost-only
- E2E Encryption β ChaCha20-Poly1305 at rest
- Hallucination Quarantine β isolate suspect memories, auto-expire in 7 days
- Voice Mode β natural-language intent parser for transcripts
- Brain Garden β animated visualization of memory as a living constellation
- PR Auto-Review β GitHub PR comments citing project memories
- Team Brain Sync (WebRTC) β peer-to-peer shared brain, no server
- Brain Exchange β export / import curated shareable brain slices
- Local-First LLM β Ollama default; optional Anthropic / OpenAI / OpenRouter / Moonshot / Gemini / DeepSeek / Mistral
- Hive Accelerator β SSSP (arXiv 2504.17033) + TurboQuant (ICLR 2026) for fast causal traversal + 6Γ vector compression
Start it:
shadow-brain dash .
# β http://localhost:7341/28 tabs. Real-time data. Full control. Every feature has live monitoring + interactive controls. Preview:
β Browse all 29 tab screenshots
Features: dark + light theme Β· command palette (βK) Β· keyboard shortcuts Β· toast notifications Β· Chart.js analytics Β· responsive (mobile / tablet / desktop) Β· real-time WebSocket Β· stop button that actually stops the process.
| Agent | Adapter | Hook target |
|---|---|---|
| Claude Code | β Native | ~/.claude/settings.json hooks.SessionStart |
| Cursor | β Native | .cursor/rules/shadow-brain.md + MCP |
| Cline | β Native | VS Code globalStorage MCP |
| Codex | β Native | ~/.codex/config.json |
| GitHub Copilot | β Native | .github/copilot-instructions.md |
| Windsurf | β Native | .windsurfrules + MCP |
| Kilo Code | β Native | ~/.kilocode/settings.json |
| Roo Code | β Native | ~/.roocode/mcp.json |
| OpenCode | β Native | AGENT.md |
| Aider | β Native | .aider.conf.yml |
Custom agent? Add its config path in the dashboard "Custom Agent Paths" panel β Shadow Brain will auto-read its provider + model + API key.
Sub-agent frameworks supported by SABB: Claude Task, Cursor Composer, Cline Sub-step, CrewAI, LangGraph, AutoGen, generic.
Shadow Brain's ModelRegistry supports 8 providers out of the box:
Ollama (default, local, free) Β· Anthropic Claude Β· OpenAI Β· OpenRouter Β· Moonshot / Kimi Β· Google Gemini Β· DeepSeek Β· Mistral
Plus a unique Agent Proxy mode: if you already use Claude Code / Cursor / Codex with their own API key, Shadow Brain borrows their intelligence β zero new API keys, zero cost.
Auto-discovery reads every agent config on your machine so you never retype a key.
| Metric | Value |
|---|---|
| Brain modules | 48 |
| CLI commands | 90+ |
| MCP tools | 60+ |
| REST endpoints | 50+ |
| Tests passing | 148 / 148 |
| TypeScript errors | 0 |
| Supported agents | 10 (plus custom) |
| Supported LLM providers | 8 (plus agent-proxy) |
| Novel features nobody else has | 22 |
| License | MIT |
| Cost to run | $0 forever (local-first) |
# 1. Install
npx @theihtisham/agent-shadow-brain@latest attach-all
# 2. Launch the dashboard
shadow-brain dash .
# β open http://localhost:7341/
# 3. Seed the brain (optional β populates example data)
shadow-brain reputation sign --agent claude-code --ver 4.7 --project demo \
--decision "use bcrypt cost 12 for all password hashing" \
--category security --confidence 0.92
# 4. Every new AI agent session automatically gets context injectedThat's it. Open any project in Claude Code / Cursor / any supported agent β Shadow Brain is already running under the hood.
βΆ Click here to watch Β· Full motion graphics explainer with voice-over walking through every feature, the live dashboard, and the 30-second install.
Local file: docs/launch/shadow-brain-motion-explainer-narrated.mp4 (2:05 Β· 1080p Β· narrated).
# Attachment + lifecycle
shadow-brain attach-all # wire every detected agent
shadow-brain detach-all # remove every hook
shadow-brain audit-hooks # list what's installed
shadow-brain dash . # launch web dashboard at :7341
shadow-brain mcp # start MCP server at :7342
# v6 Hive Mind
shadow-brain hive status # cross-module status
shadow-brain subagent sliver --parent claude-code --task "refactor auth"
shadow-brain causal trace <id> # render ancestor DAG
shadow-brain dream run # trigger idle reflection now
shadow-brain debate "Redis or Postgres?" --context "10k users"
shadow-brain premortem "migrate auth to passkeys"
shadow-brain reputation sign --agent claude-code --ver 4.7 --project X \
--decision "..." --category security --confidence 0.92
shadow-brain reputation badge claude-code --ver 4.7
# Memory + analytics
shadow-brain global recall --keywords "auth"
shadow-brain tokens report # cross-agent spend + savings
shadow-brain forget consolidate # run sleep cycle
shadow-brain formal generate "always use parameterized SQL"
shadow-brain formal export-eslint
# Privacy + trust
shadow-brain airgap enable --policy strict
shadow-brain encrypt file ~/.shadow-brain/global.json --passphrase ...
shadow-brain quarantine list
# Sharing
shadow-brain exchange export --name "react-expert-v1" --tags react,auth
shadow-brain exchange import ~/brain-packs/react-expert-v1.json
# Full list
shadow-brain --help"Shadow Brain is the first open-source brain that works with sub-agents. Claude Task, Cursor Composer, CrewAI, LangGraph, AutoGen β all finally share context. One
npxcommand. Zero API keys."
"Every AI decision Shadow Brain makes is Ed25519-signed. Every cause is traced. Every collision is caught before it happens. Free forever."
"22 novel features nobody else has. Free. Open source. Local-first.
npx @theihtisham/agent-shadow-brain."
git clone https://github.com/theihtisham/agent-shadow-brain.git
cd agent-shadow-brain
npm install
npm run build
npm test # 148/148 tests
npm run dev # ts-node dev mode
# Rebuild the explainer video
node tools/record-motion-explainer.mjs
# Capture fresh dashboard screenshots
node tools/capture-screenshots.mjs
# Seed the brain with demo data
node tools/seed-brain.mjsIssues, PRs, discussions welcome. See CONTRIBUTING.md.
- CHANGELOG.md β release notes
- docs/versions/v6.0.0.md β v6 release details
- docs/launch/HIVEMIND_VIDEO.md β video production pipeline
- docs/launch/screenshots/ β all 29 dashboard screenshots
- SECURITY.md β security policy
- CODE_OF_CONDUCT.md β community guidelines
- GitHub Issues β bug reports, feature requests
- GitHub Discussions β questions, ideas, show-and-tell
- GitHub Releases β download the explainer MP4 + release assets
If Shadow Brain makes your AI agents smarter, star the repo β
MIT β see LICENSE.
Free to use, modify, fork, commercialize. Local-first by default. Works offline, in air-gapped environments, in privacy-constrained enterprises. No telemetry. No phone-home. No trial expiration.
Built by @theihtisham
npx @theihtisham/agent-shadow-brain@latest attach-all
Topics: ai Β· llm Β· claude-code Β· cursor Β· cline Β· codex Β· copilot Β· hive-mind Β· sub-agent Β· sabb Β· causal-chains Β· dream-engine Β· reputation-ledger Β· swarm-debate Β· pre-mortem Β· branch-brain Β· attention-heatmap Β· token-economy Β· forgetting-curve Β· formal-verification Β· calibration-monitor Β· air-gap Β· e2e-encryption Β· hallucination-quarantine Β· voice-mode Β· brain-garden Β· pr-review Β· team-brain Β· brain-exchange Β· local-first Β· ollama Β· anthropic Β· openai Β· openrouter Β· gemini Β· deepseek Β· moonshot Β· mistral Β· mcp-server Β· model-context-protocol Β· lsp-server Β· cross-agent Β· multi-agent Β· autonomous-agents Β· agentic-ai Β· vibe-coding Β· cursor-ai Β· developer-tools Β· developer-productivity Β· coding-assistant Β· ai-coding Β· code-review Β· static-analysis Β· knowledge-graph Β· semantic-search Β· vector-embeddings Β· prompt-caching Β· json-mode Β· chat-with-memory Β· ed25519 Β· chacha20-poly1305 Β· sssp Β· turboquant Β· iclr-2026 Β· arxiv Β· zero-config Β· typescript Β· open-source Β· free-forever Β· mit-license











