How to Use Mini-CoderBrain v2.0
Comprehensive guide for setting up and using mini-coder-brain effectively in any project type.
π Table of Contents
π Quick Start
Installation + Setup (2 Minutes)
Step 1: Install
git clone https://github.com/kunwar-shah/mini-coder-brain.git
cd mini-coder-brain
./install.sh /path/to/your/project
Step 2: Initialize (MANDATORY)
# In Claude Code, run ONE of these:
/init-memory-bank --docs-path ./docs # With documentation
/init-memory-bank # Auto-detect
Step 3: Verify
/validate-context
Expected: π Context Quality: 85% (Recommended) β
π― Project Scenarios
Scenario 1: New Empty Project
Context: Starting from scratch, no code yet
Steps:
- Install mini-coder-brain
- Run
/init-memory-bank
- Answer interactive prompts:
- Project name?
- What type of app?
- Tech stack preference?
- Core features?
- Start building with Claudeβs help
Result: 60-70% quality (minimum but functional)
Example:
You: /init-memory-bank
Claude: What is your project name?
You: my-saas-app
Claude: What type of application?
You: A SaaS platform for team collaboration
Claude: What technology stack?
You: Next.js 14, TypeScript, Prisma, PostgreSQL
β
Context initialized! Quality: 65%
Scenario 2: Existing Project (No Docs)
Context: You have code but no formal documentation
Steps:
- Install mini-coder-brain
- Run
/init-memory-bank
(no arguments) - Claude auto-detects:
- Tech stack from package.json
- Project structure
- Git history
- Coding patterns
- Confirm detected information
- Provide missing details when prompted
Result: 75-85% quality (recommended)
What gets auto-detected:
- β Project name (from package.json)
- β Dependencies β tech stack
- β File structure β frontend/backend
- β Recent commits β progress
- β Test files β testing framework
Scenario 3: Existing Project (With Docs)
Context: You have comprehensive documentation
Steps:
- Install mini-coder-brain
- Run
/init-memory-bank --docs-path ./docs
- Claude reads:
- README.md
- SRS.md
- ARCHITECTURE.md
- API.md
- Any .md files in docs/
- Extracts features, architecture, decisions
- Generates rich context automatically
Result: 90-95% quality (optimal)
Documentation files recognized:
SRS.md
/REQUIREMENTS.md
β FeaturesARCHITECTURE.md
/DESIGN.md
β System designAPI.md
/API_SPEC.md
β API patternsDECISIONS.md
/ADR*.md
β Technical decisionsREADME.md
β Project overview
π οΈ Essential Commands
/init-memory-bank
Purpose: Initialize project context (MANDATORY after installation)
Usage:
/init-memory-bank # Auto-detect
/init-memory-bank --docs-path ./docs # With documentation
/init-memory-bank --dry-run # Preview only
When to use: Once after installation, or after major project changes
/validate-context
Purpose: Check context quality with detailed report
Usage:
/validate-context # Check quality
/validate-context --fix # Interactive improvements
Output:
π Context Quality: 85% (Recommended) β
β
Project name: defined
β
Tech stack: 5 technologies
β
Core features: 4 features
β
Architecture: defined
β οΈ Development goals: missing
Recommendations:
β’ Add development goals to productContext.md
When to use:
- After initialization
- When Claude seems confused
- Periodically to ensure quality
/update-memory-bank
Purpose: Update memory after major development work
Usage:
/update-memory-bank # Standard update
/update-memory-bank "Completed feature X" # With note
When to use:
- After completing major features
- After making technical decisions
- End of development session
- When prompted by footer status
What gets updated:
decisionLog.md
- Technical decisionsprogress.md
- Completed tasksactiveContext.md
- Current focus
/import-docs
Purpose: Import documentation after initialization
Usage:
/import-docs ./docs # Import folder
/import-docs ./specs/SRS.md # Import file
/import-docs ./docs --type srs # With type hint
When to use:
- Found documentation after initial setup
- Documentation was updated
- Want to add more context
/map-codebase
Purpose: Enable instant file access
Usage:
/map-codebase --rebuild # First time (30 seconds)
/map-codebase # Load existing (instant)
When to use: Once per project, rebuild when structure changes
/memory-cleanup
Purpose: Archive old data to prevent βPrompt too longβ
Usage:
/memory-cleanup # Standard cleanup
/memory-cleanup --dry-run # Preview only
/memory-cleanup --full # Aggressive cleanup
When to use: When notified by status footer, or quarterly
π Best Practices
1. Always Provide Documentation Paths
# β
GOOD: With documentation
/init-memory-bank --docs-path ./docs
# β BAD: Without docs (when you have them)
/init-memory-bank
2. Validate Quality After Setup
/init-memory-bank --docs-path ./docs
/validate-context # Always check!
Target: Aim for 80%+ quality
3. Update Memory After Major Work
# After completing features
/update-memory-bank "Completed authentication with JWT"
# After technical decisions
/update-memory-bank "Chose Redis for sessions"
4. Keep productContext.md Current
Manually update when:
- Adding major features
- Changing tech stack
- Updating project goals
5. Run Cleanup When Notified
When you see:
π‘ Memory cleanup recommended: 12 session updates
Run /memory-cleanup
Run: /memory-cleanup
immediately
π Context Quality Guide
Quality Levels
Score | Level | Meaning | Action |
---|---|---|---|
<40% | π΄ Below Minimum | Wonβt work well | CRITICAL: Run /init-memory-bank |
40-60% | π‘ Minimum | Works but limited | Run /validate-context --fix |
60-80% | π’ Recommended | Good effectiveness | Optional improvements |
80-100% | π Optimal | Excellent | Perfect! |
Minimum Requirements
Must Have:
- β Project name (not placeholder)
- β Technology stack (3+ items)
- β Core features (2+ items)
Should Have (for 80%+):
- β Architecture description
- β Development goals
- β Project documentation
Improving Quality
From 60% β 80%:
- Add architecture description
- Define development goals
- Document key patterns
- Run
/import-docs
if you have documentation
From 80% β 95%:
- Import comprehensive documentation
- Add decision history
- Document API patterns
- Include success metrics
π¨ Troubleshooting
Problem: βClaude asks what framework Iβm usingβ
Cause: Context not loaded or quality too low
Solution:
- Run
/validate-context
- If quality <60%, run
/validate-context --fix
- Verify productContext.md has tech stack
- Re-run
/init-memory-bank
if needed
Problem: βContext quality is 45%β
Cause: Insufficient information in memory bank
Solution:
- Run
/validate-context --fix
- Follow interactive prompts
- Or manually edit
.claude/memory/productContext.md
- Add: tech stack, features, architecture
- Re-validate:
/validate-context
Problem: β/init-memory-bank doesnβt populate filesβ
Cause: Templates exist but not initialized
Solution:
- Check if files exist:
ls .claude/memory/*.md
- If they exist, back them up
- Re-run installer
- Run
/init-memory-bank
in Claude Code (not bash!)
Problem: βPrompt is too longβ error
Cause: Memory bank bloat from many sessions
Solution:
- Run
/memory-cleanup
immediately - Verify: check
.claude/archive/
for backed up data - Quality should be maintained
- Run cleanup quarterly
π Additional Resources
- SETUP.md: https://github.com/kunwar-shah/mini-coder-brain/blob/main/SETUP.md
- Examples: https://github.com/kunwar-shah/mini-coder-brain/tree/main/examples
- Commands: Full Command Reference
- Issues: https://github.com/kunwar-shah/mini-coder-brain/issues
β Quick Reference Card
# Installation
./install.sh /path/to/project
# Setup (MANDATORY)
/init-memory-bank --docs-path ./docs
# Validation
/validate-context
# Daily Use
/update-memory-bank "note"
/map-codebase
# Maintenance
/memory-cleanup (when notified)
Ready to master Mini-CoderBrain? Follow these guides and reach 95% context quality!