Installation Guide - Mini-CoderBrain v2.0
Complete installation guide for Universal AI Context Awareness System with Intelligent Setup & Validation.
β οΈ IMPORTANT: Version 2.0 requires MANDATORY initialization after installation. Follow all steps carefully!
π Prerequisites
Required
- Claude Code - Get it from claude.ai
- Bash shell - macOS/Linux/WSL on Windows
- Git repository - Recommended for full features (optional for basic use)
Optional (Recommended)
- 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
π Installation Methods
Method 1: Smart Installer (Recommended)
Step 1: Clone Repository
git clone https://github.com/kunwar-shah/mini-coder-brain.git
cd mini-coder-brain
Step 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/project
What the installer does:
- β Detects project type (React, Python, Rust, etc.)
- β
Backs up existing
.claude
folder (if any) - β
Copies
.claude/
system folder with all hooks - β
Copies
CLAUDE.md
controller - β 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-bank
requirement
π‘ After installation, you MUST run /init-memory-bank
- See βMandatory Initializationβ section below.
π΄ MANDATORY: Initialize Context
β οΈ CRITICAL: This step is REQUIRED for mini-coder-brain to work!
After running the installer, open your project in Claude Code and run:
Option A: With Documentation (RECOMMENDED)
/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%+)
Option B: Auto-Detection (Existing Projects)
/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
Option C: Interactive Wizard (New Projects)
/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
Verify Initialization
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.
Method 2: Manual Installation (Fallback)
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-brain
Step 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.md
Step 4: Make Hooks Executable
chmod +x .claude/hooks/*.sh
Step 5: Create Required Directories
mkdir -p .claude/tmp .claude/cache .claude/archive
Step 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 architecture
Method 3: One-Liner (Advanced)
curl -sL https://raw.githubusercontent.com/kunwar-shah/mini-coder-brain/main/install.sh | bash -s /path/to/your/project
β οΈ Security Note: Always review scripts before piping to bash!
β Verify Installation
Step 1: Check Files
Verify 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 β
Step 2: Test Claude Code
- 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
Step 3: Initialize Context (MANDATORY)
Run the mandatory initialization:
/init-memory-bank
Or with documentation:
/init-memory-bank --docs-path ./docs
Step 4: Test Commands
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! β
π§ Configuration
Customize Memory Bank
Edit these files for your project:
1. productContext.md - Project overview
nano .claude/memory/productContext.md
Update:
- Project name
- Technology stack
- Architecture overview
- Key features
2. systemPatterns.md - Coding standards
nano .claude/memory/systemPatterns.md
Add your:
- Code style preferences
- Error handling patterns
- Testing approach
- Security requirements
3. activeContext.md - Current focus
nano .claude/memory/activeContext.md
Set your:
- Current development phase
- Active priorities
- Known blockers
π οΈ Troubleshooting
Issue 1: βcontext-loaded.flag not createdβ
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"
Issue 2: βHooks not executableβ
Symptoms: Permission denied errors
Solution:
chmod +x .claude/hooks/*.sh
Issue 3: βjq command not foundβ
Symptoms: Hooks show jq errors
Solution: Install jq (optional but recommended)
# Ubuntu/Debian
sudo apt-get install jq
# macOS
brew install jq
Note: System works without jq, but some features disabled.
Issue 4: βPrompt is too longβ still appears
Symptoms: Error after long conversation
Solution:
- Check if cleanup notification appeared
- Run
/memory-cleanup
- Verify activeContext.md reduced from 200+ β ~80 lines
Issue 5: βContext not loadingβ
Symptoms: Claude doesnβt have project context
Solution:
- Verify
CLAUDE.md
exists in project root - Check
.claude/memory/
files exist - Restart Claude Code
- Look for boot status message
π Upgrading from v1.0
Backup First
# Backup existing .claude folder
cp -r .claude .claude.v1.backup
Install v2.0
# Run new installer (will backup automatically)
cd mini-coder-brain
./install.sh /path/to/your/project
Key Changes in v2.0
- β¨ Hooks completely rewritten (zero duplication)
- β¨ Memory cleanup system added
- β¨ Context loading strategy changed
- β¨ 79.9% token reduction achieved
Migration Notes
- Memory files compatible (no changes needed)
- Commands compatible (new ones added)
- Hooks incompatible (replaced automatically)
ποΈ Uninstallation
Remove Mini-CoderBrain
cd your-project
# Backup memory files (optional)
cp -r .claude/memory .claude-memory-backup
# Remove system
rm -rf .claude
rm CLAUDE.md
Restore Backup (if needed)
# If you backed up before installing
mv .claude.backup .claude
mv CLAUDE.md.backup CLAUDE.md
π― Post-Installation
Recommended First Steps (v2.0 Workflow)
- 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
π Next Steps
- π 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)
π Support
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Documentation: Full Docs
Installation Complete! π
Mini-CoderBrain v2.0 is now active in your project.
β οΈ REMEMBER: Run /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