Commands Reference
Complete reference for all Mini-CoderBrain slash commands.
๐บ๏ธ Codebase Mapping
/map-codebase
Revolutionary instant file access system.
Usage:
/map-codebase # Load existing map (instant)
/map-codebase --rebuild # Rebuild from scratch (~30 seconds)
/map-codebase --recent # Focus on recent changes only
What it does:
- Scans entire codebase structure
- Creates semantic file mapping
- Enables instant file location
- Provides surgical precision for development
When to use:
- First time: Run
--rebuild
once to create the map - Future sessions: Just
/map-codebase
for instant loading - After major changes: Run
--rebuild
to update - Quick updates: Use
--recent
for incremental updates
Output:
๐บ๏ธ Codebase Mapping Complete
๐ Files indexed: 347
๐ Directories: 52
โก Load time: 0.3s (instant!)
Benefits:
- โ Claude knows exact file locations
- โ No more โWhere is X file?โ questions
- โ Instant file access
- โ Perfect for large codebases
๐พ Memory Management
/memory-sync
Full memory bank synchronization.
Usage:
/memory-sync # Smart sync based on session activity
/memory-sync --full # Full synchronization (all memory files)
/memory-sync --quick # Quick sync (activeContext.md only)
What it does:
- Analyzes session activity and changes
- Updates all relevant memory files
- Appends timestamped entries
- Preserves full history
When to use:
- After completing major features
- After making technical decisions
- At major milestones
- End of productive sessions
Updates:
- โ activeContext.md โ Session summary, achievements, blockers
- โ progress.md โ Sprint status, completed tasks
- โ decisionLog.md โ Technical decisions made
- โ systemPatterns.md โ New patterns discovered
Example:
User: /memory-sync
Claude: Synchronizing memory bank...
โ
activeContext.md updated
- Added: "Completed authentication feature"
- Updated focus: "Building user profile page"
โ
progress.md updated
- Moved "JWT auth" to completed
- Added "Profile UI" to in-progress
โ
decisionLog.md updated
- ADR-20251010-01: Use bcrypt for password hashing
Memory sync complete! Context preserved for next session.
/context-update
Real-time context updates without full sync.
Usage:
/context-update # Interactive mode
/context-update focus "what you're doing" # Update current focus
/context-update blocker "issue description" # Add blocker
/context-update priority "next task" # Add priority
/context-update achievement "what completed" # Record achievement
What it does:
- Quick targeted updates to activeContext.md
- No full memory analysis needed
- Instant context reflection
- Real-time tracking
When to use:
- Starting new work
- Hitting blockers
- Completing tasks
- Changing focus
Examples:
# Starting new feature
/context-update focus "Building user authentication with JWT"
# Hit a blocker
/context-update blocker "API rate limiting on login endpoint"
# Completed something
/context-update achievement "User registration endpoint complete"
# Next priority
/context-update priority "Add email verification flow"
/umb
Quick manual sync with note.
Usage:
/umb "Your note here"
What it does:
- Fast memory bank update
- Appends note to activeContext.md
- Timestamps the entry
- No analysis required
When to use:
- Need quick sync without waiting
- Want to leave a note for next session
- Simple status update
Example:
/umb "Completed authentication feature, starting profile page next"
Output:
โ
Memory bank updated
๐ Note added to activeContext.md
๐ Timestamp: 2025-10-10 14:30:00 UTC
/memory-cleanup
Archive old data to prevent memory bloat.
Usage:
/memory-cleanup # Normal cleanup (keep last 5 updates)
/memory-cleanup --dry-run # Preview what would be cleaned
/memory-cleanup --full # Aggressive cleanup (keep last 3)
What it does:
- Archives old session updates
- Keeps recent history (last 5 or 3 updates)
- Moves old data to
.claude/archive/
- Reduces activeContext.md size
- Prevents โPrompt is too longโ errors
When to use:
- When notified by intelligent notification system
- After high-activity sessions (50+ ops)
- When activeContext.md > 200 lines
- Preventively every few weeks
Impact:
- ~60% token reduction in context files
- No data loss - everything archived
- Perfect continuity - recent work preserved
Example Output:
๐งน Memory Cleanup Started
๐ Before:
activeContext.md: 215 lines
Session updates: 12 entries
๐๏ธ Archiving:
- Session updates 1-7 (archived)
- Keeping updates 8-12 (last 5)
โ
After:
activeContext.md: 87 lines
Archived: .claude/archive/activeContext-2025-10-10.md
Result: 60% reduction, all data preserved!
๐ Other Commands
/init-memory-bank
Initialize memory bank with auto-populated context.
Usage:
/init-memory-bank # Initialize with detected context
/init-memory-bank --dry-run # Preview without creating files
What it does:
- Auto-detects project type
- Creates all memory files from templates
- Populates with detected information
- Sets up initial structure
When to use:
- First-time setup (if not using installer)
- Resetting memory bank
- Starting fresh
๐ฏ Command Workflows
Starting a New Feature
# 1. Update your focus
/context-update focus "Building user authentication system"
# 2. Map codebase (if not done)
/map-codebase
# 3. Start coding
"Create JWT authentication for login endpoint"
Hitting a Blocker
# Record the blocker
/context-update blocker "API rate limiting on external service"
# Continue with workaround or other tasks
Completing a Feature
# Record achievement
/context-update achievement "Completed user authentication with JWT"
# Full sync to preserve context
/memory-sync
# Update focus
/context-update focus "Starting user profile feature"
End of Session
# Optional: Manual sync with note
/umb "Good progress on auth, profile page next"
# Close Claude Code
# (Stop hook auto-saves context)
High Activity Session
# After notification: "๐ Activity: 47 ops. Consider /memory-cleanup"
/memory-cleanup --dry-run # Preview changes
# If looks good
/memory-cleanup # Execute cleanup
Weekly Maintenance
# Full memory sync
/memory-sync --full
# Cleanup old data
/memory-cleanup
# Rebuild codebase map (if many changes)
/map-codebase --rebuild
๐ Command Comparison
Command | Speed | Scope | When to Use |
---|---|---|---|
/context-update |
โก Instant | Single item | Real-time updates |
/umb |
โก Fast | Quick note | End of task |
/memory-sync |
๐ Medium | Full analysis | After features |
/memory-cleanup |
๐งน Medium | Archive old | When notified |
/map-codebase |
๐บ๏ธ Instant* | File access | *After first rebuild |
๐ก Command Tips
DO โ
- Use
/context-update
frequently during development - Run
/memory-cleanup
when notified - Use
/memory-sync
at major milestones - Run
/map-codebase --rebuild
once per project - Trust the automatic hooks
DONโT โ
- Donโt run
/memory-sync --full
after every change (overkill) - Donโt ignore
/memory-cleanup
notifications (causes bloat) - Donโt rebuild map constantly (once is enough)
- Donโt manually edit memory files during active session
๐จ Troubleshooting Commands
โCommands not recognizedโ
Solution:
# Check hooks are executable
chmod +x .claude/hooks/*.sh
# Verify settings.json exists
ls .claude/settings.json
โMemory sync taking too longโ
Solution:
# Use quick sync instead
/memory-sync --quick
# Or use targeted update
/context-update focus "current work"
โCodebase map not loadingโ
Solution:
# Rebuild the map
/map-codebase --rebuild
# Check file exists
ls .claude/memory/codebase-map.json
๐ Command Output Examples
Successful Command
โ
Command executed successfully
๐ Updated: activeContext.md
๐ Timestamp: 2025-10-10 14:30:00 UTC
With Notification
โ
Context updated
๐ก High activity session (42 ops). Consider /memory-sync
Error Handling
โ Command failed: File not found
๐ก Try running: /init-memory-bank
๐ฏ Advanced Usage
Chaining Workflows
# Complete feature โ sync โ cleanup โ new focus
/context-update achievement "Auth complete"
/memory-sync
/memory-cleanup
/context-update focus "Starting profile feature"
Dry-Run Testing
# Preview cleanup before executing
/memory-cleanup --dry-run
# Check output, then execute
/memory-cleanup
Strategic Mapping
# Initial project setup
/map-codebase --rebuild
# Daily work (instant load)
/map-codebase
# After refactoring (update map)
/map-codebase --rebuild
# Quick check recent changes
/map-codebase --recent