Production-ready orchestration with Vector RAG Memory
Version: 1.4.0 | 📖 Quick Start → | ⚡ 5-Minute Setup
Claude remembers everything across sessions. Your agents build institutional knowledge.
You: "Add authentication to the API"
Agent: Searches past work → Finds "We use JWT with refresh tokens (users.service.ts)"
↓
Agent: Implements auth matching your existing patterns (no reinventing the wheel)
How it works:
- 📝 Subagents return structured DIGEST blocks (decisions, files changed, contracts)
- 💾 DIGEST auto-stored in pgvector/Supabase/Pinecone (your choice)
- 🔍 New tasks → RAG search suggests relevant past work
- ✨ Agents build on what you already have (coherent codebase, no drift)
Supported Backends (drop-in):
- ✅ pgvector (PostgreSQL + pgvector extension) - Self-hosted, free
- ✅ Supabase (Managed pgvector) - Just add SUPABASE_URL + SUPABASE_KEY
- ✅ Pinecone (Managed vector DB) - Just add PINECONE_API_KEY
Zero vector DB knowledge required. Just paste an API key and go.
- Automatic Per-Project Setup: First use auto-creates
.claude/logs/, updates.gitignore, createsNOTES.md - Zero Manual Work: Just install globally once, then use Claude Code in any project
- Smart Detection: Auto-detects projects (git repos, package.json, pyproject.toml, etc.)
- Runs Once: Creates
.claude/.setup_completemarker to skip future setup - Vector RAG Ready: Auto-configures memory ingestion and retrieval hooks
- Auto-Ingestion: Every DIGEST block automatically stored in vector DB
- Smart Retrieval: RAG search suggests relevant past work on every new task
- Multi-Backend: Drop-in support for Supabase, Pinecone, or self-hosted pgvector
- Zero Config: Just set environment variables - framework handles the rest
- Cross-Project Memory: Search across all your projects (global knowledge base)
- Privacy First: Self-hosted option (pgvector) keeps your data on your infrastructure
- 40+ Specialized Agents: Implementation planner, requirements clarifier, code navigator, implementation engineer, test author, security auditor, and more
- DIGEST-Based Context: Structured JSON summaries (not giant transcript dumps)
- 12+ Automation Hooks: Pre/Post tool use hooks for validation, cost tracking, DIGEST capture, and quality gates
- Pivot Tracking System: Detect direction changes, validate FEATURE_MAP updates, auto-audit obsolete code
- Multi-Model Brainstorming: Claude + GPT-5 dialogue for strategic planning
- Cost Tracking: Automatic cost display for OpenAI and Perplexity API calls
- Pre-Merge Quality Gate: Bash script for comprehensive pre-merge validation
- MD Spam Prevention: Enforces documentation policy to prevent file sprawl
pretooluse_validate.py- Validate permissions, check budgetsposttooluse_validate.py- Lint/typecheck after editscheckpoint_manager.py- Auto-checkpoint before risky operationspivot_detector.py- Detect direction changesfeature_map_validator.py- Validate FEATURE_MAP updateslog_analyzer.py- Suggest specialized agentstask_digest_capture.py- Capture subagent DIGEST blocksprecompact_summary.py- Generate compaction summariesgpt5_cost_tracker.py- Track OpenAI API costsperplexity_tracker.py- Track Perplexity API costsmd_spam_preventer.py- Prevent documentation sprawlready-to-merge.sh- Pre-merge quality gate script
All 40+ specialized agent definitions for routing and delegation.
CLAUDE.md- Global orchestration instructionssettings.json- Hook registrationsFEATURE_MAP.template.md- Project template
openai-bridge- Multi-model brainstorming with GPT-5postgres-bridge- Read-only database queries with AI-generated SQLvector-bridge- Vector RAG memory (pgvector/Supabase/Pinecone backends)
# 1. Install framework
npm install -g claude-orchestration-framework
bash ~/.npm-global/lib/node_modules/claude-orchestration-framework/install.sh
# 2. Create Supabase project at https://supabase.com (free tier)
# Enable pgvector extension in Database → Extensions
# 3. Add to ~/.zshrc or ~/.bashrc (or use .envrc with direnv)
export SUPABASE_URL="https://your-project.supabase.co"
export SUPABASE_SERVICE_KEY="your-service-role-key"
export ENABLE_VECTOR_RAG=true
# 4. Reload shell
source ~/.zshrc
# 5. Done! Open Claude Code in any project - RAG memory is activeGet your keys:
- SUPABASE_URL: Project Settings → API → Project URL
- SUPABASE_SERVICE_KEY: Project Settings → API → service_role key (keep secret!)
# 1. Install framework (same as above)
npm install -g claude-orchestration-framework
bash ~/.npm-global/lib/node_modules/claude-orchestration-framework/install.sh
# 2. Create Pinecone index at https://www.pinecone.io (free tier)
# Index name: "claude-memory"
# Dimensions: 1536 (OpenAI embeddings)
# Metric: cosine
# 3. Add to ~/.zshrc or ~/.bashrc
export PINECONE_API_KEY="your-api-key"
export PINECONE_INDEX="claude-memory"
export ENABLE_VECTOR_RAG=true
# 4. Reload and go
source ~/.zshrcGet your API key:
- Pinecone Dashboard → API Keys → Create Key
# 1. Install framework (same as above)
# 2. Set up PostgreSQL with pgvector
docker run -d \
-e POSTGRES_PASSWORD=yourpassword \
-e POSTGRES_DB=claude_memory \
-p 5432:5432 \
ankane/pgvector
# 3. Add to ~/.zshrc or ~/.bashrc
export DATABASE_URL_MEMORY="postgresql://postgres:yourpassword@localhost:5432/claude_memory"
export ENABLE_VECTOR_RAG=true
# 4. Reload
source ~/.zshrc# In any project, run a task with subagent
# Example: Ask Claude to "implement user authentication"
# After task completes, check NOTES.md - you'll see DIGEST blocks
cat NOTES.md
# Future sessions will reference past work automatically!Linux/macOS:
npm install -g claude-orchestration-framework
bash ~/.npm-global/lib/node_modules/claude-orchestration-framework/install.shWindows (PowerShell):
npm install -g claude-orchestration-framework
powershell -ExecutionPolicy Bypass -File "$env:APPDATA\npm\node_modules\claude-orchestration-framework\install.ps1"- Backs up existing installation (if any)
- Installs hooks to
~/.claude/hooks/(version-controlled) - Installs agents to
~/.claude/agents/ - Configures settings.json (with merge option)
- Sets up environment variables
- Optionally installs MCP servers (postgres-bridge, vector-bridge, openai-bridge)
If you prefer manual installation:
Linux/macOS:
- Clone or download the package
- Run:
bash install.sh
Windows:
- Clone or download the package
- Run:
powershell -ExecutionPolicy Bypass -File install.ps1
Quick automated check:
bash smoke-test.shComprehensive validation:
See MCP test notes in MCP_TEST_REPORT.md and try the sample tool flows.
Stop Hook Performance
STOP_TAIL_WINDOW_BYTES(default 524288): Tail bytes for fast DIGEST scanSTOP_HOOK_MAX_TRANSCRIPT_BYTES(default 524288): Skip full parse when huge (withSTOP_TAIL_FAST_ONLY=true)STOP_TAIL_FAST_ONLY(default false): Only tail-scan; do not full-parse if not foundSTOP_TIME_BUDGET_MS(default 0): Soft cutoff; exit early if exceeded with no DIGESTSTOP_DEBUG(default true): Gate debug log writes
Project Status Updater (CLAUDE.md)
PROJECT_STATUS_COMPACT(default false): compact header + Next Steps; hides decisions/risksPROJECT_STATUS_SHOW_DECISIONS(default true)PROJECT_STATUS_SHOW_ACTIVITY(default true)
Vector Ingestion (Queue)
ENABLE_VECTOR_RAG(default false)INGEST_MCP_TIMEOUT_SEC(default 60): memory_ingest timeout for MCP stdioINGEST_NONFATAL_ERRORS_PATTERN(regex): treat transient errors as retryable (e.g.,timed out|ECONN|ETIMEDOUT)
Implementation Validator (IV)
ENABLE_IV(default false): spawn IV after Stop (non-blocking)IV_FAST_ONLY(default true): local checks onlyIV_WRITE_NOTES(default true): append compact IV note to NOTES.md
Fast, local validation that closes gaps before tests:
- Reads last DIGEST from
.claude/logs/NOTES.mdand recent files from.claude/logs/wsi.json - Flags files listed in DIGEST that weren’t touched recently
- Surfaces pending “Next Steps” to resolve before handing off to TA
Enable: export ENABLE_IV=true
Output:
- WARNINGS.md entry if gaps exist
- Compact IV note in NOTES.md with summary and actionable gaps
Reusable, vector-searchable remediations for known errors.
MCP tools (via vector-bridge):
mcp__vector-bridge__solution_search— find fixpacks by error messagemcp__vector-bridge__solution_preview— DRY‑RUN preview (no changes)mcp__vector-bridge__solution_apply— record success/failure to track effectiveness
Hook integration:
hooks/error_recovery.pyauto‑suggests top fixpacks on hook failure and DRY‑RUN previews the first one
Env toggles:
ENABLE_FIXPACK_SUGGEST=true(default)FIXPACK_MAX_SUGGESTIONS=2FIXPACK_SUGGEST_TIMEOUT_SEC=6FIXPACK_AUTO_PREVIEW=true
Maintains a <project_status> block with:
- Header: project, timestamp, data freshness (and reasons)
- Summary: phase and optional focus component
- Last Digest: agent, task, decisions/files counts
- Next Steps: top items from recent work
- Activity Snapshot: recent components
Compact mode: export PROJECT_STATUS_COMPACT=true
Claude Code looks for MCP configs by scope:
- User (all projects):
~/.claude.json - Project (committable):
<repo>/.mcp.json - Local (per project, private): still
~/.claude.json, scoped to the active project
Best practices:
- Use an absolute Node path in
.mcp.json(e.g.,/Users/you/.nvm/versions/node/v22/bin/node) - Provide real env values (don’t rely on
${VAR}expansion) or set OS env vialaunchctl setenv - To bootstrap per‑project: the auto-setup hook creates
.mcp.jsonfrom~/.claude/mcp-template.jsonif missing
Quick health check (stdio):
printf '%s\n' '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"readme","version":"1.0"}}}' '{"jsonrpc":"2.0","id":2,"method":"tools/list","params":{}}' \
| OPENAI_API_KEY="$OPENAI_API_KEY" DATABASE_URL_MEMORY="$DATABASE_URL_MEMORY" REDIS_URL="$REDIS_URL" \
/Users/you/.nvm/versions/node/v22.15.0/bin/node ~/.claude/mcp-servers/vector-bridge/dist/index.jsTo keep Stop fast on large transcripts:
- Tail scan recent bytes first (
STOP_TAIL_WINDOW_BYTES, default 512KB) - Optional fast‑only mode + size cap (
STOP_TAIL_FAST_ONLY=true,STOP_HOOK_MAX_TRANSCRIPT_BYTES) - Early exit by time budget (
STOP_TIME_BUDGET_MS) - Gate heavy debug I/O (
STOP_DEBUG=false)
For multi-model brainstorming and live data searches:
export OPENAI_API_KEY='sk-...'
export PERPLEXITY_API_KEY='pplx-...'For vector memory and DIGEST ingestion:
Linux/macOS:
export ENABLE_VECTOR_RAG=true
export DATABASE_URL_MEMORY='postgresql://user:pass@host:port/database'
export REDIS_URL='redis://host:port'Windows:
$env:ENABLE_VECTOR_RAG = 'true'
$env:DATABASE_URL_MEMORY = 'postgresql://user:pass@host:port/database'
$env:REDIS_URL = 'redis://host:port'Linux/macOS:
cd ~/your-project
cp ~/.claude/FEATURE_MAP.template.md FEATURE_MAP.mdWindows:
cd C:\your-project
Copy-Item "$env:USERPROFILE\.claude\FEATURE_MAP.template.md" ".\FEATURE_MAP.md"Edit FEATURE_MAP.md to track your project's features and pivots.
Linux/macOS:
# Check hooks are working
python3 ~/.claude/hooks/checkpoint_manager.py list
# Run pre-merge check
cd ~/your-project
bash ~/.claude/hooks/ready-to-merge.shWindows:
# Check hooks are working
python "$env:USERPROFILE\.claude\hooks\checkpoint_manager.py" list
# Run pre-merge check (requires Git Bash or WSL)
cd C:\your-project
bash "$env:USERPROFILE\.claude\hooks\ready-to-merge.sh"The Main Agent automatically routes tasks to specialized subagents:
- Complex features → Implementation Planner
- Vague requests → Requirements Clarifier
- Code changes → Code Navigator + Implementation Engineer
- Testing → Test Author
- Security → Security Auditor
- Performance → Performance Optimizer
- Change direction: "Actually, let's use Railway instead of Supabase"
- Hook detects pivot, shows warning
- Update FEATURE_MAP.md manually
- Say: "I've updated FEATURE_MAP. Run the pivot cleanup workflow."
- Main Agent auto-invokes Relevance Auditor → Auto-Doc Updater
cd ~/your-project
bash ~/claude-hooks/ready-to-merge.sh
# With auto-fix for linting
bash ~/claude-hooks/ready-to-merge.sh --auto-fixSay "brainstorm alternatives" or mention comparing approaches. Main Agent will invoke Multi-Model Brainstormer (Claude + GPT-5 dialogue).
# List checkpoints
python3 ~/claude-hooks/checkpoint_manager.py list
# Restore a checkpoint
python3 ~/claude-hooks/checkpoint_manager.py restore <checkpoint-id>- PreToolUse: Permission validation, budget checks
- PostToolUse: Lint/typecheck after edits, cost tracking, DIGEST capture
- UserPromptSubmit: Agent suggestions, pivot detection, FEATURE_MAP validation
- PreCompact: Generate summary before compaction
- Stop: Extract final DIGEST (fallback)
- FEATURE_MAP.md - Single source of truth
- pivot_detector.py - Auto-detect direction changes
- Relevance Auditor - Find obsolete code
- Auto-Doc Updater - Sync all documentation
Automatically displays costs for:
- OpenAI API calls (GPT-5, GPT-4o, etc.)
- Perplexity API calls (sonar, sonar-pro, sonar-reasoning)
- Pre-merge validation (lint, typecheck, tests, build)
- Integration cohesion audits
- Production readiness verification
- Global Config:
~/.claude/CLAUDE.md - Agent Roster:
~/.claude/agents/*.md - Hook Scripts:
~/.claude/hooks/*.py - Project Template:
~/.claude/FEATURE_MAP.template.md - Logs Migration: See LOGS_MIGRATION.md for per-project log configuration
- Check
~/.claude/settings.jsonhas hook registrations - Verify scripts are executable:
chmod +x ~/claude-hooks/*.py - Check Python version:
python3 --version(need 3.8+)
- Rebuild:
cd ~/.claude/mcp-servers/openai-bridge && npm install && npm run build - Check API keys are set in environment
- Restart Claude Code
- Check NOTES.md exists in project root
- Verify task_digest_capture.py hook is registered
- Run subagents via Task tool (not direct work)
To update to a new version:
- Download new package
- Run
bash install.sh(will backup existing) - Review changes in
~/.claude/settings.json.backup
rm -rf ~/claude-hooks
rm -rf ~/.claude/agents
# Manually remove hook registrations from ~/.claude/settings.json
# Manually remove CLAUDE.md from ~/.claude/For issues or questions:
- Check documentation in
~/.claude/CLAUDE.md - Review agent definitions in
~/.claude/agents/ - Check hook debug logs in
~/claude-hooks/logs/
- Initial release
- 40+ agents
- 12+ hooks
- Pivot tracking system
- Multi-model brainstorming
- Cost tracking
- Pre-merge quality gates
[Your License Here]
Happy Coding! 🚀