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

Need installation help?

Installation Guide โ†’