agent-shadow-brain
Health Warn
- License — License: MIT
- Description — Repository has a description
- Active repo — Last push 0 days ago
- Low visibility — Only 5 GitHub stars
Code Fail
- execSync — Synchronous shell command execution in src/adapters/aider.ts
- execSync — Synchronous shell command execution in src/adapters/claude-code.ts
- os.homedir — User home directory access in src/adapters/claude-code.ts
- os.homedir — User home directory access in src/adapters/cline.ts
- execSync — Synchronous shell command execution in src/adapters/codex.ts
- os.homedir — User home directory access in src/adapters/codex.ts
Permissions Pass
- Permissions — No dangerous permissions requested
This MCP server acts as an autonomous coding assistant that integrates with popular coding agents (Claude, Codex, Cline, Aider). It uses custom memory algorithms, predictive bug detection, and knowledge graphs to store context and evolve its coding capabilities over time.
Security Assessment
The overall risk is rated as High. The codebase extensively accesses the user's home directory (`os.homedir()`) across multiple adapter files. While this is used to locate the configuration files of other AI tools (like Claude Code, Codex, and Cline), it still involves interacting with sensitive filesystem paths.
More critically, the tool executes synchronous shell commands (`execSync`) in at least four different adapter files. Synchronous shell execution is inherently risky as it can be easily exploited to run unintended system commands if malicious inputs are injected. No hardcoded secrets were found, but the presence of arbitrary command execution demands caution.
Quality Assessment
The project is actively maintained with very recent pushes and includes a standard MIT license. However, community trust and visibility are exceptionally low. With only 5 GitHub stars, the tool has not undergone the widespread peer review and community testing expected for a package that executes shell commands and reads local directories. The heavily buzzword-laden description and README may also make it difficult for developers to accurately assess the tool's actual functionality versus marketing claims.
Verdict
Not recommended for production environments due to high-risk synchronous shell execution, sensitive home directory access, and a lack of community oversight.
Self-evolving AI coding intelligence with infinite memory (TurboQuant), genetic algorithm evolution, predictive bug detection, PageRank knowledge graphs, and swarm intelligence. The world's first autonomous coding brain.
The World's #1 Hyper-Cognitive AI Coding Brain
Shadow Brain is a zero-config, self-evolving, infinite-memory intelligence layer that makes every AI coding agent write better, safer, faster code. Install it once, and it automatically detects your project, your AI tools, your frameworks — and starts making your agents smarter forever.
v5.1.1 — Hyper-Cognitive Intelligence Edition: 6 new brain modules — Built-in LSP Server for real-time IDE feedback, Custom LLM Fine-Tuning Engine to train on your codebase, Smart Cache with multi-tier predictive prefetch, Intent Engine for natural language command understanding, Code DNA fingerprinting with 9-gene analysis, and Temporal Intelligence for velocity tracking & bug prediction. Plus all v5.0.1 zero-config features (MCP server, dashboard, plugins, export/import), v5.0.0 infinite intelligence (hierarchical memory, consensus, collective learning), and v4.0.0 hyper-intelligence (TurboQuant, SSSP, self-evolution, adversarial defense, swarm, knowledge graph, predictive engine).
Install Now · Dashboard · v5.1.1 New · Algorithms · CLI Reference · Architecture
The Problem
You use AI coding agents. They're powerful, but:
| Problem | Impact |
|---|---|
| Agents forget everything between sessions | Same mistakes, zero learning |
| Multiple agents don't communicate | Claude doesn't know what Cursor learned |
| Generated code has hallucinations | LLMs fabricate APIs that don't exist |
| No cross-session memory | Every conversation starts from zero |
| No cross-project learning | Discoveries in one project don't help others |
| Setup is complicated | 30 minutes of config before anything works |
| Each tool needs separate config | Claude, Cursor, Cline all need different setup |
The Solution
Shadow Brain v5.1.1 — zero-config, auto-detecting, infinite-intelligence shadow layer:
┌──────────────┐ auto-detect ┌──────────────────────────────────────────┐
│ AI Agents │ ◀──────────────── │ SHADOW BRAIN v5.1.1 │
│ Claude Code │ MCP auto-install │ │
│ Cursor │ zero-config │ ┌─ HYPER-COGNITIVE (v5.1.1 NEW) ────┐ │
│ Kilo Code │ │ │ Built-in LSP Server (stdio+TCP) │ │
│ Cline │ watches │ │ Custom LLM Fine-Tuning Engine │ │
│ OpenCode │ ──────────────▶ │ │ Smart Cache (hot/warm/cold tiers) │ │
│ Codex │ file changes │ │ Intent Engine (NLP commands) │ │
│ Roo Code │ git commits │ │ Code DNA (9-gene fingerprinting) │ │
│ Aider │ activity │ │ Temporal Intelligence (velocity) │ │
│ Windsurf │ │ └────────────────────────────────────┘ │
└──────────────┘ │ ┌─ ZERO-CONFIG (v5.0.1) ─────────────┐ │
▲ │ │ Auto-detect + MCP + Dashboard │ │
│ │ │ Plugins + Export/Import + Hooks │ │
│ │ └────────────────────────────────────┘ │
│ │ ┌─ INFINITE MEMORY (v5.0.0) ────────┐ │
│ │ │ 4-tier hierarchical compression │ │
│ │ │ Context-triggered recall │ │
│ │ │ Multi-agent consensus + trust │ │
│ │ │ Collective cross-project learning │ │
│ │ └────────────────────────────────────┘ │
│ │ ┌─ HYPER-INTELLIGENCE (v4) ──────────┐ │
│ │ │ TurboQuant 6x Compression │ │
│ │ │ SSSP BMSSP Quantum Routing │ │
│ │ │ Self-Evolution + CAIP + Swarm │ │
│ │ │ PageRank + Predictive + Adversarial │ │
└──────────────────────────┴──────────────────────────────────────────┘
v5.1.1 — What's New
6 Hyper-Cognitive Brain Modules
Built-in LSP ServerLanguage Server Protocol — real-time IDE feedback without external tools. Pure Node.js LSP server supporting stdio and TCP transport modes:
Custom LLM Fine-Tuning EngineTrain on your codebase — your brain learns YOUR patterns. Automatic training data generation from code changes, insights, and fixes:
|
Smart Cache (Multi-Tier)Hot/Warm/Cold — intelligent caching with predictive prefetch. Three-tier LRU cache with automatic promotion and demotion:
Intent EngineNatural language → brain actions — understand what you mean. Multi-strategy NLP command understanding:
|
Code DNA Fingerprinting9-gene analysis — every file gets a unique genetic profile. Analyzes code across 9 gene categories to create a structural fingerprint:
|
Temporal IntelligenceTime-series code evolution — velocity tracking & bug prediction. Continuous monitoring of code change patterns over time:
|
v5.0.1 — What's New
Zero-Config Auto-Setup
Install it. That's it. Shadow Brain automatically:
- Detects your project type (frontend, backend, fullstack, mobile, game, systems, data-science)
- Detects 25+ languages, 15+ frameworks, 5+ build tools, 5+ test frameworks
- Detects which AI tools are installed (Claude Code, Cursor, Kilo Code, Cline, OpenCode, Codex, Aider, Windsurf)
- Auto-installs MCP server configuration for every detected AI tool
- Auto-installs git pre-commit and pre-push hooks
- Generates an optimal brain config based on project complexity
npm install @theihtisham/agent-shadow-brain
# → Shadow Brain v5.1.1 auto-configured for my-app (fullstack)
# → AI tools detected: Claude Code, Cursor
# → Run: shadow-brain start
MCP Server — Works with EVERY AI Tool
The brain exposes itself as a Model Context Protocol (MCP) server with 19 tools that any AI tool can call:
| MCP Tool | What It Does |
|---|---|
brain_status |
Get full brain status |
brain_analyze |
Trigger code analysis |
brain_health |
Get health score (A-F) |
brain_insights |
Get recent insights |
brain_fixes |
Get smart fix suggestions |
brain_memory_store |
Store knowledge in hierarchical memory |
brain_memory_search |
Search across all memory tiers |
brain_memory_stats |
Memory compression statistics |
brain_recall |
Context-triggered associative recall |
brain_consensus_propose |
Submit a proposal for agent consensus |
brain_consensus_vote |
Vote on a pending proposal |
brain_collective_propose |
Propose a cross-project rule |
brain_collective_search |
Search collective learning rules |
brain_turbo_search |
Semantic search in compressed memory |
brain_predict |
Predict bug risk for files |
brain_graph_query |
Query knowledge graph |
brain_defense_scan |
Scan for hallucination patterns |
brain_evolve_status |
Get self-evolution status |
brain_dashboard_url |
Get dashboard URL |
Works with Claude Code, Cursor, Kilo Code, Cline, OpenCode, and any MCP-compatible AI tool.
# Start MCP server (auto-started by AI tools)
shadow-brain mcp
# Cursor compatibility (root path POST + /v1/chat)
# Claude Code compatibility (JSON-RPC 2.0 over stdio/HTTP)
Rich Web Dashboard
Real-time browser dashboard at http://localhost:7341 with WebSocket live updates:
- Stats Topbar: 8 live counters — Insights, Fixes, Memory KB, Modules, AI Tools, Evolution Gen, Swarm Convergence, Turbo Compression
- Health Score: A-F grading with dimension breakdown (Security, Quality, Performance, Architecture, Maintainability, Test Coverage)
- Memory Tiers: Visual bars showing Raw (50K), Summary (10K), Pattern (2K), Principle (500) with Turbo compression ratio
- Live Insights Stream: Real-time feed of brain insights with priority badges
- Smart Fixes: Actionable fix suggestions with file/line references
- AI Tools Panel: 8 tools showing connected/detected status
- Brain Modules: 13 modules with active/idle/error indicators
- Control Buttons: Trigger analysis on-demand, refresh data
shadow-brain start . # Dashboard auto-starts at http://localhost:7341
shadow-brain dash . # Dashboard only mode
Natural Language Queries
Ask your brain questions in plain English:
shadow-brain ask "What security issues exist in the auth module?"
shadow-brain ask "Which files have the highest bug risk?"
shadow-brain ask "What patterns have we learned about React hooks?"
Brain Export/Import — Team Sync
Export your brain state and share it with your team:
shadow-brain export # Full export with all modules
shadow-brain export -o ./team-brain # Custom output directory
shadow-brain import brain-export.json # Import + merge
shadow-brain import brain-export.json --merge --skip swarm,evolution
Plugin System
Extend Shadow Brain with custom plugins:
shadow-brain plugin list # List installed plugins
shadow-brain plugin create my-plugin # Create from template
shadow-brain plugin stats # Plugin system statistics
Plugins can hook into pre-analysis and post-analysis pipelines to add custom insights, filter results, or integrate with external services.
5 New Commands
shadow-brain off # Clean shutdown
shadow-brain ask "..." # Natural language query
shadow-brain export # Export brain state
shadow-brain import FILE # Import brain state
shadow-brain plugin CMD # Plugin management
Getting Started — 30 Seconds
# Install globally
npm install -g @theihtisham/agent-shadow-brain
# Or use npx (no install needed)
npx @theihtisham/agent-shadow-brain start .
That's literally it. Shadow Brain will:
- Auto-detect your project, languages, frameworks, AI tools (zero config)
- Auto-install MCP server config for Claude Code, Cursor, Kilo Code, Cline, etc.
- Auto-install git hooks for pre-commit and pre-push
- Watch your project files for changes
- Analyze every change with LLM + 22 brain modules
- Inject expert insights into your agent's memory
- Store all knowledge in hierarchical memory for infinite retention
- Activate past memories automatically based on context
- Share verified patterns across projects via collective learning
- Compress knowledge with TurboQuant for infinite retention
- Evolve its own rules via genetic algorithm
- Share insights across agents via CAIP
- Detect hallucinations with adversarial verification
- Run consensus when multiple agents disagree
- Serve a rich web dashboard at
localhost:7341
Quick Review (No Watch Mode)
shadow-brain review . # One-shot analysis
shadow-brain review . --show-health # + health score
shadow-brain review . --show-fixes # + fix suggestions
shadow-brain review . --output json # JSON for scripting
Web Dashboard
The v5.1.1 dashboard provides a real-time view into your brain:
┌──────────────────────────────────────────────────────────────────────────┐
│ Shadow Brain v5.1.1 [Analyze] [↻] │
├──────────────────────────────────────────────────────────────────────────┤
│ Insights: 142 │ Fixes: 38 │ Memory: 247KB │ Modules: 22/22 │ ... │
├──────────────┬─────────────────────────────────────┬───────────────────┤
│ Health: 87% │ Live Insights Stream │ AI Tools │
│ ████████░░ │ ● [HIGH] SQL injection in login.ts │ ● Claude Code ✓ │
│ Security: A │ ● [MED] Missing error handling │ ● Cursor ✓ │
│ Quality: B+ │ ● [LOW] Unused import in utils │ ● Kilo Code ✓ │
│ Perf: A- │ ● [CRIT] Exposed API key │ ● Cline — │
│ Arch: B │ │ ● OpenCode — │
│ Maintain: A ├─────────────────────────────────────┤ ● Codex — │
│ Tests: C+ │ Smart Fixes │ ● Aider — │
│ │ 1. Add parameterized query... │ ● Windsurf — │
├──────────────┤ 2. Wrap in try/catch with... ├───────────────────┤
│ Memory Tiers │ 3. Remove unused import on L42 │ Brain Modules │
│ Raw: 8421 │ │ ● Hierarchical ✓ │
│ Summ: 1203 │ │ ● TurboMemory ✓ │
│ Patt: 187 │ │ ● Consensus ✓ │
│ Princ: 24 │ │ ● Swarm ✓ │
│ Turbo: 6.2x │ │ ● Evolution ✓ │
│ │ │ ● Adversarial ✓ │
└──────────────┴─────────────────────────────────────┴───────────────────┘
v5.0.0 Infinite Intelligence Engine
4 Breakthrough Modules
Infinite Memory LayerHierarchical Memory Compression — 4-tier pyramid that never forgets. Knowledge flows through compression tiers as it ages:
Drill-down and drill-up between tiers. Older knowledge compresses, never deletes.
Context-Triggered Associative Recall — memories that activate themselves. Instead of requiring explicit search queries, this engine monitors your current work context and automatically surfaces relevant past knowledge:
|
Multi-Agent Intelligence LayerConsensus Engine — voting, trust scoring, conflict resolution. When multiple AI agents observe the same codebase, they may produce conflicting insights. This engine:
Collective Learning — discoveries flow across all projects. When you discover a pattern in Project A, it becomes a verified rule available in Project B:
|
v4.0.0 Hyper-Intelligence Engine
8 Breakthrough Modules (included in v5.1.1)
Quantum Memory LayerTurboQuant Infinite Memory — never forget anything, ever. Based on Google Research's TurboQuant (ICLR 2026):
SSSP Quantum Router — deterministic shortest-path message routing. Based on "Breaking the Sorting Barrier" (arXiv 2504.17033, Duan et al.):
|
Self-Evolution LayerGenetic Algorithm Self-Evolution — rules that write themselves.
Cross-Agent Intelligence Protocol (CAIP) — agents that talk to each other. Your Claude Code session learns what your Cursor session discovered:
|
Defense & Trust LayerAdversarial Hallucination Defense — trust nothing, verify everything.
Swarm Intelligence — Ant Colony Optimization for file prioritization.
|
Analytics & Prediction LayerKnowledge Graph + PageRank — code impact radar.
Predictive Engine — predict bugs before they happen.
|
Algorithms & Research
Shadow Brain v5.1.1 implements algorithms from peer-reviewed research:
| Algorithm | Paper / Origin | Application | Complexity |
|---|---|---|---|
| Hierarchical Compression | Novel 4-tier system | Infinite memory with drill-down | O(n) per tier |
| Associative Recall | Spreading activation model | Context-triggered memory activation | O(n x k) |
| Consensus Protocol | Byzantine fault tolerance | Multi-agent agreement with trust | O(v x log v) |
| TurboQuant | Google Research, ICLR 2026 | Vector compression (PolarQuant + QJL) | O(n) per vector |
| BMSSP (SSSP) | arXiv 2504.17033, Duan et al. | Neural mesh message routing | O(m log2/3 n) |
| Shannon Entropy | Claude Shannon, 1948 | Cross-project insight relevance scoring | O(n) |
| Bayesian Inference | Thomas Bayes, 1763 | Confidence updating, meta-learning | O(1) per update |
| Cosine Similarity | Vector space model | Knowledge deduplication | O(d) per pair |
| PageRank | Brin & Page, 1998 | Code entity impact analysis | O(V + E) per iteration |
| Tarjan's SCC | Robert Tarjan, 1972 | Dependency cycle detection | O(V + E) |
| Winnowing | Schleimer et al., 2003 | Code duplicate fingerprinting | O(n) |
| Box-Muller | Box & Muller, 1958 | Gaussian mutation in genetic algorithm | O(1) per sample |
| Ant Colony (ACO) | Dorigo, 1992 | File priority pheromone system | O(n x m) |
| Tournament Selection | Goldberg, 1989 | Genetic rule selection (k=5) | O(k) per selection |
TurboQuant Pipeline Detail
Input Vector (64-dim, float64)
|
v
+-------------+
| PolarQuant |-- Cartesian -> Polar coordinates
| 2 bits/dim |-- Quantize angles to 4 levels (2 bits each)
+------+-------+ Pack into Uint8Array
|
v
+-------------+
| QJL Residual|-- Random rotation (Hadamard-like)
| 1 bit/dim |-- Sign extraction (1 bit per dim)
+------+-------+ Pack into Uint8Array
|
v
TurboVector { polar: Uint8Array, qjl: Uint8Array, dim: number, radius: number }
= 3 bits/dim total = 6x compression from float64
= ZERO FORGETTING -- compressed knowledge stays searchable forever
Features
Hyper-Cognitive (v5.1.1)
|
Zero Config (v5.0.1)
|
Infinite Intelligence (v5)
|
Hyper-Intelligence (v4)
|
Developer Experience
|
Architecture
v5.1.1 Module Map (22 modules)
| Module | File | What It Does | Since |
|---|---|---|---|
| LSP Server | brain/lsp-server.ts |
Built-in Language Server Protocol (stdio+TCP) | v5.1.1 |
| Fine-Tuning Engine | brain/fine-tuning-engine.ts |
Custom LLM training data generation | v5.1.1 |
| Smart Cache | brain/smart-cache.ts |
Multi-tier caching with predictive prefetch | v5.1.1 |
| Intent Engine | brain/intent-engine.ts |
Natural language command understanding | v5.1.1 |
| Code DNA | brain/code-dna.ts |
9-gene code fingerprinting + similarity | v5.1.1 |
| Temporal Intelligence | brain/temporal-intelligence.ts |
Velocity tracking, heatmaps, bug prediction | v5.1.1 |
| Auto Setup | brain/auto-setup.ts |
Zero-config project + tool detection | v5.0.1 |
| MCP Server | brain/mcp-server.ts |
19-tool MCP server for all AI tools | v5.0.1 |
| Plugin System | brain/plugin-system.ts |
Hookable analysis pipeline | v5.0.1 |
| Brain Portability | brain/brain-portability.ts |
Export/import brain state | v5.0.1 |
| Dashboard | dashboard/server.ts |
Real-time WebSocket dashboard | v5.0.1 |
| Hierarchical Memory | brain/hierarchical-memory.ts |
4-tier infinite memory | v5.0.0 |
| Context Recall | brain/context-recall.ts |
Associative memory activation | v5.0.0 |
| Consensus Engine | brain/consensus-engine.ts |
Multi-agent voting + trust | v5.0.0 |
| Collective Learning | brain/collective-learning.ts |
Cross-project rule sharing | v5.0.0 |
| TurboMemory | brain/turbo-memory.ts |
6x compressed infinite memory | v4.0.0 |
| SSSP Router | brain/sssp-router.ts |
Sub-sorting routing | v4.0.0 |
| Self-Evolution | brain/self-evolution.ts |
Genetic rule optimization | v4.0.0 |
| Cross-Agent | brain/cross-agent-protocol.ts |
Multi-agent broadcast | v4.0.0 |
| Adversarial | brain/adversarial-defense.ts |
Hallucination detection | v4.0.0 |
| Swarm | brain/swarm-intelligence.ts |
File priority pheromones | v4.0.0 |
| Knowledge Graph | brain/knowledge-graph.ts |
PageRank impact analysis | v4.0.0 |
| Predictive | brain/predictive-engine.ts |
Bug risk & debt forecasting | v4.0.0 |
CLI Reference
Core Commands
| Command | Description |
|---|---|
shadow-brain start [dir] |
Start real-time watching + dashboard + MCP |
shadow-brain off |
Clean shutdown |
shadow-brain review [dir] |
One-shot code analysis |
shadow-brain health [dir] |
Health score (A-F grading) |
shadow-brain fix [dir] |
Smart fix suggestions |
shadow-brain report [dir] |
HTML/MD/JSON reports |
shadow-brain metrics [dir] |
Code metrics |
shadow-brain scan [dir] |
Vulnerability scanner |
shadow-brain pr [dir] |
Generate PR description |
shadow-brain commit-msg [dir] |
Generate commit message |
shadow-brain ci [dir] |
GitHub Actions workflow |
shadow-brain hook [dir] |
Pre-commit hook |
shadow-brain dash [dir] |
Web dashboard |
shadow-brain mcp |
MCP server mode |
shadow-brain inject <msg> |
Inject into agent memory |
shadow-brain status |
Current configuration |
shadow-brain setup |
Interactive setup wizard |
shadow-brain doctor |
Health check & diagnostics |
shadow-brain ask <question> |
Natural language brain query |
v5.1.1 Hyper-Cognitive Commands (NEW)
| Command | Description |
|---|---|
shadow-brain lsp [--stdio|--tcp PORT] |
Start built-in LSP server |
shadow-brain fine-tune status |
Fine-tuning training data stats |
shadow-brain fine-tune generate [dir] |
Generate training pairs from code |
shadow-brain fine-tune export [path] |
Export JSONL dataset for fine-tuning |
shadow-brain cache stats |
Smart cache hit rate, tier sizes, memory |
shadow-brain cache clear |
Clear all cache tiers |
shadow-brain intent <text> |
Parse natural language intent |
shadow-brain dna analyze [dir] |
Generate Code DNA profiles |
shadow-brain dna compare <f1> <f2> |
Compare two file fingerprints |
shadow-brain dna similar <file> |
Find structurally similar files |
shadow-brain temporal stats |
Velocity, anomalies, predictions |
shadow-brain temporal hot |
Top 10 hottest files by churn |
shadow-brain temporal predict |
Bug risk predictions |
shadow-brain temporal timeline |
Recent event timeline |
v5.0.1 Commands
| Command | Description |
|---|---|
shadow-brain off |
Clean shutdown of all brain processes |
shadow-brain ask <question> |
Natural language query to the brain |
shadow-brain export [-o dir] |
Export full brain state to JSON |
shadow-brain import <file> [--merge] |
Import brain state |
shadow-brain plugin list |
List installed plugins |
shadow-brain plugin create <name> |
Create plugin from template |
shadow-brain plugin stats |
Plugin system statistics |
v5.0.0 Infinite Intelligence Commands
| Command | Description |
|---|---|
shadow-brain memory stats |
4-tier hierarchical memory stats |
shadow-brain memory store <text> |
Store knowledge at raw tier |
shadow-brain memory search <query> |
Cross-tier semantic search |
shadow-brain recall . --file <f> |
Context-triggered associative recall |
shadow-brain consensus status |
Multi-agent consensus stats |
shadow-brain consensus propose <text> <cat> <conf> |
Submit proposal for voting |
shadow-brain consensus vote <id> <vote> <conf> <reason> |
Vote on a proposal |
shadow-brain consensus results |
All resolved proposals |
shadow-brain collective status |
Cross-project rule stats |
shadow-brain collective propose <text> <cat> |
Propose a collective rule |
shadow-brain collective search <cat> |
Search collective rules by category |
shadow-brain v5 [dir] |
Run ALL v5.0.0 analyses |
v4.0.0 Hyper-Intelligence Commands
| Command | Description |
|---|---|
shadow-brain turbo stats |
TurboQuant infinite memory stats |
shadow-brain turbo search <q> |
Semantic search compressed memory |
shadow-brain route status |
SSSP routing status |
shadow-brain route find <from> <to> |
Shortest path query |
shadow-brain caip status |
Cross-agent protocol status |
shadow-brain caip broadcast <msg> |
Broadcast to all agents |
shadow-brain evolve status |
Genetic algorithm generation stats |
shadow-brain evolve run |
Trigger evolution cycle |
shadow-brain evolve best-rules [cat] |
Top evolved rules by category |
shadow-brain predict bugs [dir] |
Bug risk prediction |
shadow-brain graph build [dir] |
Build knowledge graph + PageRank |
shadow-brain swarm status |
Swarm convergence + priorities |
shadow-brain swarm priorities |
File hotspot ranking |
shadow-brain defense status |
Adversarial defense statistics |
shadow-brain defense scan <text> |
Scan text for hallucination patterns |
shadow-brain v4 [dir] |
Run ALL v4.0.0 analyses |
Programmatic API
import {
Orchestrator,
// v5.1.1 — Hyper-Cognitive modules
LSPServer,
FineTuningEngine,
SmartCache,
IntentEngine,
CodeDNA,
TemporalIntelligence,
// v5.0.1 — Zero-Config modules
AutoSetup,
PluginSystem,
BrainPortability,
// v5.0.0 — Infinite Intelligence modules
HierarchicalMemory,
ContextRecall,
ConsensusEngine,
CollectiveLearning,
// v4.0.0 — Hyper-Intelligence modules
TurboMemory,
SSSPRouter,
SelfEvolution,
CrossAgentProtocol,
AdversarialDefense,
SwarmIntelligence,
KnowledgeGraph,
PredictiveEngine,
NeuralMesh,
} from '@theihtisham/agent-shadow-brain';
// v5.1.1 — Built-in LSP server
const lsp = new LSPServer('./my-project');
lsp.start({ mode: 'tcp', port: 2087 }); // or { mode: 'stdio' }
// v5.1.1 — Smart Cache
const cache = new SmartCache({ maxHotEntries: 200, enablePrefetch: true });
cache.set('analysis:auth', analysisResult, { ttl: 300_000, tags: ['security'] });
const cached = cache.get('analysis:auth');
// v5.1.1 — Temporal Intelligence
const temporal = new TemporalIntelligence('./my-project');
temporal.recordCommit(['src/auth.ts'], 'fix: JWT rotation');
const velocity = temporal.getVelocity(); // { daily, weekly, trend: 'accelerating' }
const bugRisks = temporal.predictBugs(10);
// v5.1.1 — Code DNA
const dna = new CodeDNA('./my-project');
const profile = await dna.analyze('src/auth.ts');
const similar = await dna.findSimilar('src/auth.ts', 5);
// v5.0.1 — Zero-config auto-setup
const setup = new AutoSetup('./my-project');
const config = await setup.detect();
// → { projectType: 'fullstack', languages: ['typescript','python'], frameworks: ['next.js'], aiTools: [...] }
await setup.installMCPForTools(['Claude Code', 'Cursor']);
await setup.installGitHooks();
// Create the brain
const brain = new Orchestrator({
provider: 'anthropic',
projectDir: './my-project',
agents: ['claude-code', 'cursor', 'cline'],
watchMode: true,
autoInject: true,
brainPersonality: 'balanced',
});
// v5.0.1 — Plugin system
const plugins = new PluginSystem('./my-project');
await plugins.loadAll();
await plugins.preAnalysis({ files: ['src/auth.ts'], projectDir: './my-project' });
// v5.0.1 — Brain portability
const porter = new BrainPortability('./my-project');
const { filePath, sizeBytes, checksum } = await porter.exportBrain();
// v5.0.0 — Infinite Intelligence
const hmem = new HierarchicalMemory();
await hmem.store('JWT rotation pattern: rotate every 24h with refresh tokens', 'security', 0.9);
const results = hmem.search('jwt');
const recall = new ContextRecall(hmem);
const activated = recall.recall({
currentFile: 'src/auth/login.ts',
currentCategory: 'security',
recentEdits: ['src/auth/login.ts', 'src/middleware/auth.ts'],
projectType: 'node',
keywords: ['jwt', 'authentication', 'session'],
});
const consensus = new ConsensusEngine('my-agent');
const proposalId = consensus.propose('Use bcrypt cost factor 12', 'security', 0.95);
// Start everything
await brain.start();
Health Score System
| Dimension | Weight | Checks |
|---|---|---|
| Security | 25% | Vulnerabilities, secrets, exposed keys |
| Quality | 25% | Code smells, anti-patterns, complexity |
| Performance | 15% | N+1 queries, memory leaks, blocking ops |
| Architecture | 15% | Coupling, cohesion, dependencies |
| Maintainability | 10% | Duplication, file sizes, comments |
| Test Coverage | 10% | Test presence, assertion quality |
Version History
Full changelogs, migration guides, and detailed release notes:
docs/versions/Compact changelog:
CHANGELOG.md
| Version | Codename | Date | Highlights |
|---|---|---|---|
| v5.1.1 | Hyper-Cognitive | 2026-04-18 | LSP Server, Fine-Tuning Engine, Smart Cache, Intent Engine, Code DNA, Temporal Intelligence |
| v5.0.1 | Zero-Config | 2026-04-15 | Auto-Setup, MCP Server (19 tools), Dashboard, NLP Queries, Plugin System |
| v5.0.0 | Infinite Intelligence | 2026-04-12 | Hierarchical Memory, Associative Recall, Multi-Agent Consensus, Collective Learning |
| v4.0.0 | Hyper-Intelligence | 2026-04-08 | TurboQuant, SSSP Routing, Self-Evolution, CAIP, Adversarial Defense, Swarm, Knowledge Graph |
| v3.0.0 | Hyper-Intelligence | 2026-04-01 | Cognitive Load Analysis, Security Audit Engine, Influence Map |
| v2.1.0 | Quantum Neural Mesh | 2026-03-25 | Shannon Entropy, Cosine Similarity, Bayesian Confidence |
| v2.0.0 | Super-Intelligence | 2026-03-18 | Semantic Analyzer, Dependency Graph, Code Similarity, MCP Server |
| v1.0.0 | Foundation | 2026-02-28 | 7 Agent Adapters, Health Scoring, Smart Fixes, Vulnerability Scanning |
Supported Agents & Tools
| Agent | Status | MCP Support | Injection Target |
|---|---|---|---|
| Claude Code | Full Support | Auto-install | CLAUDE.md, .claude/ |
| Cursor | Full Support | Auto-install | .cursor/mcp.json |
| Kilo Code | Full Support | Auto-install | .kilocode/rules.md |
| Cline | Full Support | Auto-install | .clinerules |
| OpenCode | Full Support | Yes | AGENT.md |
| Codex | Full Support | Yes | AGENTS.md |
| Roo Code | Full Support | Yes | .roo/rules.md |
| Aider | Full Support | Yes | .aider.conf.yml |
| Windsurf | Detection | Yes | .windsurfrules |
Development
git clone https://github.com/theihtisham/agent-shadow-brain.git
cd agent-shadow-brain
npm install
npm run build
npm test
Roadmap
- MCP Server, multi-project, team mode (v2.0)
- Cross-session neural mesh (v2.1)
- TurboQuant infinite memory (v4.0)
- SSSP quantum routing (v4.0)
- Self-evolving rules (v4.0)
- Cross-agent protocol (v4.0)
- Adversarial hallucination defense (v4.0)
- Hierarchical memory compression (v5.0)
- Context-triggered associative recall (v5.0)
- Multi-agent consensus protocol (v5.0)
- Collective cross-project learning (v5.0)
- Zero-config auto-setup (v5.0.1)
- MCP server for Cursor + all tools (v5.0.1)
- Rich web dashboard with real-time WebSocket (v5.0.1)
- Plugin system + brain export/import (v5.0.1)
- Custom LLM fine-tuning (v5.1.1)
- Language server (LSP) (v5.1.1)
- Web dashboard v3 (v5.1.1)
- Visual Studio Code integration — inline insight overlays
- Multi-model orchestration — route insights through multiple LLMs
- Real-time collaboration — team brain with live cursors
License
MIT License — see LICENSE for details.
Author
theihtisham
If Shadow Brain makes your AI agents smarter, give it a star
Built with brains by theihtisham
Topics: ai artificial-intelligence llm claude-code cursor cline kilo-code codex roo-code aider opencode windsurf code-review static-analysis developer-tools npm-package typescript ollama openai anthropic code-quality security-scanner health-score smart-fix vulnerability-scanner pattern-learning agent-tools ai-agent code-metrics pre-commit-hook github-actions developer-productivity neural-mesh quantum-computing shannon-entropy bayesian-inference mcp-server model-context-protocol semantic-analysis dependency-graph turboquant sssp-algorithm genetic-algorithm swarm-intelligence pagerank knowledge-graph hallucination-detection cross-agent self-evolving predictive-engine ant-colony infinite-memory vector-compression iclr-2026 arxiv super-intelligence hyper-intelligence autonomous-agents ai-engineering agentic-coding vibe-coding cursor-ai zero-config auto-setup dashboard plugin-system brain-export natural-language real-time websocket team-collaboration ci-cd open-source trending hierarchical-memory context-recall consensus-engine collective-learning infinite-intelligence coding-assistant lsp-server language-server-protocol fine-tuning smart-cache intent-engine code-dna temporal-intelligence hyper-cognitive
Reviews (0)
Sign in to leave a review.
Leave a reviewNo results found