CLAUDEMAX
Cognitive autopilot OS for Claude Code β adaptive task routing, persistent session memory, and visual state machine feedback on every prompt.
Ask AI about CLAUDEMAX
Powered by Claude Β· Grounded in docs
I know everything about CLAUDEMAX. Ask me about installation, configuration, usage, or troubleshooting.
0/500
Reviews
Documentation
CLAUDEMAX
A persistent cognitive operating system for Claude Code.
CLAUDEMAX transforms Claude Code from a stateless terminal assistant into a context-aware, self-routing, self-healing execution environment. Every prompt is classified, enriched, and executed through a defined pipeline. Memory accumulates across sessions via NotebookLM and LightRAG. Safety guards run on every write. The system operates without user intervention.
Architecture
CLAUDEMAX is composed of seven layers:
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β LAYER 1 β Cognitive Router (UserPromptSubmit) β
β Classifies prompt against 25 task types. Computes β
β complexity score. Selects model tier. Emits routing β
β directives: EXECUTE / SPAWN / THINK / AUTOCHAIN. β
β Planning Gate enforces 5-step structured thinking. β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β LAYER 2 β Safety Guards (PreToolUse) β
β PII redactor: blocks API keys, tokens, wallet addresses. β
β Code quality gate: rejects hardcoded secrets, empty catch. β
β Runs on every Write / Edit / Bash invocation. β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β LAYER 3 β Event Accumulator (PostToolUse) β
β Writes structured tool events to turn-events.jsonl. β
β Tool-specific failure detection (replaces blind regex). β
β Forwards to daemon for long-term session memory. β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β LAYER 4 β Completion Feedback (Stop) β
β Reads accumulated events. Renders DONE diagram. β
β Writes structured session summary to daemon. β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β LAYER 5 β Session Context (SessionStart) β
β Reads project memory from daemon + NLM notebook. β
β Session intent prediction. Injects NLM-synthesized β
β briefing. Starts Ruflo swarm engine. Status bar. β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β LAYER 6 β NotebookLM + LightRAG (Core Memory) β
β Per-project NLM notebooks auto-created on first session. β
β LightRAG semantic search (sentence-transformers, β
β all-MiniLM-L6-v2, 384-dim dense embeddings). β
β NLM deep recall fallback when LightRAG returns weak. β
β Cross-project knowledge graph. NLM auth auto-refresh β
β via Chrome CDP. β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β LAYER 7 β Anti-Laziness & Token Optimization β
β NLM generates aggressive, task-specific directives. β
β CLAUDE.md per-task segments (16 types, ~500 tokens). β
β Master progress accumulator (infinite memory via NLM). β
β 10-step precompute pipeline on session end. β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Core Components
- Ripple Autopilot β always-on router, prompt enrichment, model selection
- NotebookLM CLI β core memory layer, per-project notebooks, deep recall fallback
- LightRAG β semantic search with sentence-transformers (384-dim dense embeddings)
- Planning Gate β 5-step structured thinking on every prompt
- THINK directive β deep reasoning for complex tasks (>=50% complexity)
- AUTOCHAIN β full autopilot task execution without user intervention
- Anti-laziness enforcement β NLM-generated, aggressive, per-task-type directives
- Session intent prediction β predicts what the user will need before they ask
- Self-healing β tool-specific failure detection, 3-retry with learned strategies
- Status bar β model, context%, weekly limit%, real cost vs API cost
Key Features (v0.7.0)
Memory
- Per-project NLM notebooks auto-created on first session
- Master progress file accumulates decisions/patterns/failures across sessions
- Cross-project knowledge graph (scans gstack + Claude memory)
- NLM auth auto-refresh via Chrome CDP (no silent failures)
- Content-based vector dedup (eliminated 48% duplicates)
- 500-doc index cap with oldest-first pruning
- Type-aware memory pruning (50 sessions, 30 prompts, 10 decisions)
Token Optimization
- CLAUDE.md per-task segments (16 types, ~500 tokens vs ~6,000 full)
- Session briefing synthesized by NLM (87% token reduction)
- Learnings synthesized into 5 rules (96% token reduction)
- Prompt deduplication (stops echoing user prompt)
- Average tokens/prompt: ~478 (down from ~1,200-2,750)
Infrastructure
- 10-step precompute pipeline (background, on session end)
- Tool-specific failure detection (replaces blind regex)
- Shell injection fix (execSync to execFileSync with stdin)
- Session intent prediction
- Status bar with live metrics
Task Taxonomy
The cognitive router classifies prompts against 25 task types. See CLAUDE.md for the full taxonomy.
Entrepreneur: brain-dump, write-content, brainstorm, decide, research, strategy, pitch, fundraise, hire
Engineering: bug-fix, new-feature, deploy-ship, design, security, refactor, performance, investigate, planning, code-review, autoplan
Complexity scoring adjusts dynamically: repeat task types get +15%, large projects get +5%.
Install
curl -fsSL https://raw.githubusercontent.com/Blockchainpreneur/CLAUDEMAX/main/install.sh | bash
Or clone and run locally:
git clone https://github.com/Blockchainpreneur/CLAUDEMAX ~/claudemax
cd ~/claudemax && bash install.sh
Hook Pipeline
Event File Function
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
PreToolUse pii-redactor.mjs Block secrets on Write/Edit/Bash
PreToolUse code-quality-gate.mjs Block hardcoded creds, warn on any/empty-catch
UserPromptSubmit rational-router-apex.mjs Classify β route β Planning Gate β directives
PostToolUse post-tool-use-apex.mjs Accumulate tool events, failure detection
Stop task-complete.mjs DONE diagram + structured session summary
Stop session-stop.mjs Post session end to memory daemon
SessionStart session-start.mjs Welcome panel + status bar
SessionStart session-start-daemon.mjs Inject NLM-synthesized project context
SessionStart ruflo daemon Start swarm engine (60+ agents)
All hooks exit 0 unconditionally. Claude never waits on them.
gstack β AI Software Factory (28 Skills)
Sprint workflow: /office-hours β /plan-ceo-review β /plan-eng-review β /plan-design-review β /design-consultation β /review β /investigate β /design-review β /qa β /qa-only β /cso β /ship β /land-and-deploy β /canary β /benchmark β /document-release β /retro
Power tools: /browse, /autoplan, /codex, /careful, /freeze, /unfreeze, /guard, /setup-deploy, /gstack-upgrade
Non-negotiable: never ship without /review + /qa + /cso. After deploy: /canary then /retro.
Memory System
Session memory stored at ~/.claudemax/contexts/{project-slug}.md. NotebookLM notebooks at ~/.claudemax/nlm/{project-slug}/. LightRAG index at ~/.claudemax/lightrag/.
The 10-step precompute pipeline runs on session end:
- Accumulate tool events β 2. Synthesize session summary β 3. Update NLM notebook β 4. Rebuild LightRAG index β 5. Deduplicate vectors β 6. Prune by type limits β 7. Generate anti-laziness directives β 8. Compress learnings β 9. Build per-task CLAUDE.md segments β 10. Update cross-project knowledge graph
MCP Servers
11 servers available. Use CLI tools first; MCP only when no CLI equivalent exists.
- context7 β live framework/library docs
- shadcn β UI component registry
- supabase β database, auth, storage
- github β PRs, issues, releases (prefer
ghCLI) - sentry β error monitoring
- figma β design file reading
- n8n β workflow automation
- magicuidesign β Magic UI components
- playwright β browser automation (prefer CLI)
- chrome-devtools β Chrome DevTools Protocol
- sequential-thinking β structured reasoning
Requirements
- macOS or Linux
- Node.js >= 18
- Claude Code CLI β
npm install -g @anthropic-ai/claude-code - Bun β
curl -fsSL https://bun.sh/install | bash - Python 3.10+ (for sentence-transformers / LightRAG)
License
MIT
