Complete installation guide for Universal AI Context Awareness System with Production-Verified Quality.
Current Version: v2.2.0 (October 2025) Latest Features: 3-Layer Footer Enforcement, Zero-Tolerance Co-Author Policy, Docker Safety, 100% Production Verification
- Claude Code - Get it from claude.ai
- Bash shell - macOS/Linux/WSL on Windows
- Git repository - Recommended for full features (optional for basic use)
- jq - Enables enhanced features
- Ubuntu/Debian:
sudo apt-get install jq - macOS:
brew install jq - Windows WSL:
sudo apt-get install jq
- Ubuntu/Debian:
- Project Documentation - SRS, Architecture docs for optimal context quality
Step 1: Clone Repository
git clone https://github.com/kunwar-shah/mini-coder-brain.git
cd mini-coder-brainStep 2: Run Installer
# Make installer executable (first time only)
chmod +x install.sh
# Interactive mode (prompts for project path)
./install.sh
# Or provide path directly
./install.sh /path/to/your/projectWhat the installer does:
- ✅ Detects project type (React, Python, Rust, etc.)
- ✅ Backs up existing
.claudefolder (if any) - ✅ Copies
.claude/system folder with all hooks - ✅ Copies
CLAUDE.mdcontroller - ✅ Creates required directories (tmp, cache, archive)
- ✅ Makes hooks executable
- ✅ Copies templates to memory bank (DO NOT edit templates directly!)
- ✅ Customizes with your project name
- ✅ Verifies installation
⚠️ Shows mandatory/init-memory-bankrequirement
💡 After installation, you MUST run /init-memory-bank - See "Mandatory Initialization" section below.
After running the installer, open your project in Claude Code and run:
/init-memory-bank --docs-path ./docs
Best for: Projects with SRS, ARCHITECTURE.md, API.md, or technical documentation
What it does:
- 🔍 Auto-detects your project type
- 📚 Reads all documentation files
- 🎯 Extracts features, architecture, tech stack
- ✅ Populates memory bank with real data
- 📊 Shows context quality score (aim for 80%+)
/init-memory-bank
Best for: Existing projects with code but no documentation
What it does:
- 🔍 Scans package.json, README.md, code structure
- 🎯 Auto-detects tech stack and patterns
- ✅ Generates project-structure.json
- 📊 Confirms detected info with you
/init-memory-bank
Best for: Brand new projects starting from scratch
What it does:
- 💬 Asks about project name, tech stack, features
- 🎯 Guides you through all required info
- ✅ Creates complete memory bank from your answers
- 📊 Validates minimum requirements met
After initialization, check your context quality:
/validate-context
Expected output:
📊 Context Quality: 85% (Recommended) ✅
✅ Project name: your-project
✅ Tech stack: 5 technologies
✅ Core features: 4 features
✅ Architecture: Defined
✅ Ready for development!
If quality < 60%: Run /validate-context --fix for guided improvements.
If the automatic installer fails, use these manual steps:
Step 1: Clone Repository
git clone https://github.com/kunwar-shah/mini-coder-brain.git
cd mini-coder-brainStep 2: Copy System Files
# Copy .claude folder to your project
cp -r .claude /path/to/your/project/
# Copy CLAUDE.md controller to your project
cp CLAUDE.md /path/to/your/project/Step 3: Initialize Memory Bank from Templates
# Navigate to your project
cd /path/to/your/project
# Copy templates to actual memory files
cp .claude/memory/templates/productContext-template.md .claude/memory/productContext.md
cp .claude/memory/templates/activeContext-template.md .claude/memory/activeContext.md
cp .claude/memory/templates/progress-template.md .claude/memory/progress.md
cp .claude/memory/templates/decisionLog-template.md .claude/memory/decisionLog.md
cp .claude/memory/templates/systemPatterns-template.md .claude/memory/systemPatterns.mdStep 4: Make Hooks Executable
chmod +x .claude/hooks/*.shStep 5: Create Required Directories
mkdir -p .claude/tmp .claude/cache .claude/archiveStep 6: Customize Your Memory Bank
# Edit productContext.md with your project details
nano .claude/memory/productContext.md
# Replace [PROJECT_NAME] with your project name
# Update technology stack, features, and architecturecurl -sL https://raw.githubusercontent.com/kunwar-shah/mini-coder-brain/main/install.sh | bash -s /path/to/your/projectVerify these files exist in your project:
your-project/
├── .claude/
│ ├── hooks/
│ │ ├── session-start.sh ✅
│ │ ├── conversation-capture-user-prompt.sh ✅
│ │ ├── optimized-intelligent-stop.sh ✅
│ │ ├── intelligent-status-notification.sh ✅
│ │ └── memory-cleanup.sh ✅
│ ├── commands/
│ │ ├── memory-cleanup.md ✅
│ │ └── ... (other commands) ✅
│ ├── memory/
│ │ ├── productContext.md ✅
│ │ ├── activeContext.md ✅
│ │ └── ... (other memory files) ✅
│ └── settings.json ✅
└── CLAUDE.md ✅- Open your project in Claude Code
- Start a new conversation
- You should see:
🧠 [CODERBRAIN: ACTIVE] - YourProjectName
🎯 Focus: [Current focus]
📂 Context: .claude/memory/ (loaded)
⚡ Ready for development
Run the mandatory initialization:
/init-memory-bank
Or with documentation:
/init-memory-bank --docs-path ./docs
Try these commands:
/validate-context # Check context quality
/update-memory-bank # Update memory (renamed from /umb)
/memory-cleanup --dry-run # Test cleanup
/import-docs ./path/to/docs # Import documentation (if you have it)
If commands work and context quality >= 60%, installation is successful! ✅
Edit these files for your project:
1. productContext.md - Project overview
nano .claude/memory/productContext.mdUpdate:
- Project name
- Technology stack
- Architecture overview
- Key features
2. systemPatterns.md - Coding standards
nano .claude/memory/systemPatterns.mdAdd your:
- Code style preferences
- Error handling patterns
- Testing approach
- Security requirements
3. activeContext.md - Current focus
nano .claude/memory/activeContext.mdSet your:
- Current development phase
- Active priorities
- Known blockers
Symptoms: Hooks report flag missing
Solution:
# Verify session-start.sh has flag creation
grep "context-loaded.flag" .claude/hooks/session-start.sh
# Should show: echo "$(date +%s)" > "$CLAUDE_TMP/context-loaded.flag"Symptoms: Permission denied errors
Solution:
chmod +x .claude/hooks/*.shSymptoms: Hooks show jq errors
Solution: Install jq (optional but recommended)
# Ubuntu/Debian
sudo apt-get install jq
# macOS
brew install jqNote: System works without jq, but some features disabled.
Symptoms: Error after long conversation
Solution:
- Check if cleanup notification appeared
- Run
/memory-cleanup - Verify activeContext.md reduced from 200+ → ~80 lines
Symptoms: Claude doesn't have project context
Solution:
- Verify
CLAUDE.mdexists in project root - Check
.claude/memory/files exist - Restart Claude Code
- Look for boot status message
# Backup existing .claude folder
cp -r .claude .claude.v1.backup# Run new installer (will backup automatically)
cd mini-coder-brain
./install.sh /path/to/your/project- ✨ 3-Layer Footer Enforcement (85-92% compliance)
- ✨ Zero-Tolerance Co-Author Policy
- ✨ Docker Container Safety Guidelines
- ✨ 100% Production Verification (36/36 checks passed)
- ✨ Enhanced Test Coverage (58% pass rate)
- ✨ Maintains all v2.0/v2.1 features (79.8% token efficiency)
- Memory files compatible (no changes needed)
- Commands compatible (new ones added)
- Hooks incompatible (replaced automatically)
cd your-project
# Backup memory files (optional)
cp -r .claude/memory .claude-memory-backup
# Remove system
rm -rf .claude
rm CLAUDE.md# If you backed up before installing
mv .claude.backup .claude
mv CLAUDE.md.backup CLAUDE.md-
Initialize Context (MANDATORY)
/init-memory-bank --docs-path ./docs # With documentation # OR /init-memory-bank # Auto-detect -
Validate Quality
/validate-context # Check score (aim for 80%+) -
Import Additional Docs (If Needed)
/import-docs ./additional-docs # Add more documentation -
Enable Codebase Mapping
/map-codebase --rebuild # One-time setup /map-codebase # Instant loading -
Work on Your Project
- Claude now has full context
- Perfect continuity across sessions
- Auto-cleanup prevents bloat
- Context quality monitored automatically
-
Update Memory After Major Work
/update-memory-bank "Completed feature X" # After milestones
- 📖 Setup Guide: SETUP.md - Comprehensive setup guide for all scenarios
- 📋 README: README.md - Feature overview and quick start
- 🔧 Commands: Available commands and usage
- 📘 Examples: examples/ - Reference projects (empty/existing/complex)
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Documentation: Full Docs
Installation Complete! 🎉
Mini-CoderBrain v2.2 is now active in your project.
/init-memory-bank to complete setup!
After initialization, Claude will have:
- ✅ Perfect context awareness
- ✅ Memory continuity across sessions
- ✅ Measurable quality scores (60-95%)
- ✅ Intelligent validation and warnings