Pronounced "crumble"
Break down your monorepo into breadcrumbs for AI agents to navigate efficiently.
crmbl is a CLI tool that scans your monorepo and creates hierarchical documentation (READMEs + JSON map) so AI agents can understand your codebase structure without wasting tokens on deep scans.
Instead of having AI agents blindly explore your entire monorepo, crmbl creates a structured map that agents can use to:
- Quickly understand what each directory does
- Find the right code to modify
- Navigate dependencies between modules
- Identify entry points and key files
- Agent-agnostic: Works with Claude Code, Cursor, and any AI coding assistant
- Two-phase workflow: Fast scanning + separate documentation generation
- Zero AI integration: Just generates files and prompts - you choose how to use them
- CI-friendly: Verify command ensures docs stay current
- Lightweight: Minimal dependencies, fast execution
npm install -g crmblOr use directly with npx:
npx crmbl init# Initialize in your monorepo
cd my-monorepo
crmbl init
# Scan for directories
crmbl scan
# Generate prompt for your AI agent
crmbl prompt
# Copy crmbl-prompt.txt content to your AI agent
# Let it generate READMEs and update crmbl-map.json
# Verify documentation is complete (great for CI)
crmbl verifyCreates a .crmbl-config.json file with default settings.
Options:
-f, --force- Overwrite existing config file
Example:
crmbl initScans your directory tree and compares it against the existing crmbl-map.json to identify:
- New directories (not yet documented)
- Missing directories (in map but deleted from disk)
- Documented directories (already in the map)
Options:
-o, --output <path>- Custom output path for scan results (default:./scan-results.json)-q, --quiet- Suppress detailed output
Example:
crmbl scan
crmbl scan -o ./my-scan.jsonGenerates a prompt file with context about new directories that needs documentation. This prompt can be copied to any AI agent (Claude Code, Cursor, etc.) to generate the READMEs and update the map.
Options:
-o, --output <path>- Custom output path for prompt (default:./crmbl-prompt.txt)-t, --template <path>- Use a custom prompt template
Example:
crmbl prompt
crmbl prompt -o ./docs/prompt.txtVerifies that all documented directories have their corresponding README files. Useful for CI/CD pipelines to ensure documentation stays current.
Options:
-q, --quiet- Only output errors
Example:
crmbl verifyCI Usage:
# .github/workflows/verify-docs.yml
- name: Verify crmbl documentation
run: npx crmbl verifyThe .crmbl-config.json file controls how crmbl scans your repository:
{
"rootPath": "./",
"ignore": [
"node_modules",
".git",
"dist",
"build",
".next",
"coverage",
".cache"
],
"outputPath": "./crmbl-map.json",
"readmeTemplate": "templates/readme-template.md"
}Options:
rootPath- Root directory to scan (relative to config file)ignore- Array of directory patterns to exclude from scanningoutputPath- Where to save/read the monorepo map JSONreadmeTemplate- Path to custom README template (optional)
The JSON map file contains structured metadata about each directory:
{
"generated": "2025-01-15T10:30:00Z",
"directories": {
"/src/api": {
"purpose": "API endpoints and business logic",
"complexity": 4,
"changeFrequency": "Frequently Modified",
"entryPoints": ["index.ts", "routes.ts"],
"internalDeps": ["/src/database", "/src/utils"],
"externalDeps": ["express", "zod"],
"readmePath": "/src/api/README.md",
"keyFiles": [
{"file": "routes.ts", "description": "API route definitions"},
{"file": "middleware.ts", "description": "Auth and validation"}
],
"subdirectories": ["/src/api/v1", "/src/api/v2"]
}
}
}purpose- Brief description of what the directory doescomplexity- Score from 1-5 indicating code complexitychangeFrequency- One of:Stable,Moderate,Frequently ModifiedentryPoints- Main files that serve as entry pointsinternalDeps- Paths to other directories this depends onexternalDeps- External npm packages usedreadmePath- Location of the directory's READMEkeyFiles- Important files with descriptionssubdirectories- Child directories
Here's a complete workflow for documenting a monorepo:
# 1. Set up crmbl
cd my-monorepo
crmbl init
# 2. Initial scan
crmbl scan
# Output: Found 47 new directories
# 3. Generate prompt for AI
crmbl prompt
# 4. Use your AI agent (Claude Code example)
claude-code
# Paste contents of crmbl-prompt.txt
# Agent creates READMEs and updates crmbl-map.json
# 5. Verify everything is documented
crmbl verify
# Output: ✓ All directories have valid READMEs
# 6. Commit the documentation
git add crmbl-map.json **/README.md .crmbl-config.json
git commit -m "Add crmbl documentation"
# 7. Set up CI to keep docs current
# Add `crmbl verify` to your CI pipelineBefore crmbl:
- AI agents waste tokens scanning entire directory trees
- No structured way for agents to understand codebase organization
- Documentation gets stale and isn't machine-readable
- Hard to onboard new AI agents to large codebases
After crmbl:
- Agents navigate efficiently using the JSON map
- Human-readable READMEs + machine-readable metadata
- CI verification keeps docs current
- Works with any AI agent or tool
- Point Claude Code/Cursor at your crmbl-map.json to give instant context
- Reduce token usage by helping agents explore only relevant directories
- Improve AI accuracy with structured documentation
- Maintain living documentation that evolves with your codebase
- Enforce documentation standards across all directories
- Quick onboarding for both humans and AI agents
- Verify all new directories are documented before merging
- Catch missing or stale documentation automatically
- Integrate with code review workflows
- Node.js >= 18.0.0
- npm or yarn
# Clone the repo
git clone https://github.com/yourusername/crmbl.git
cd crmbl
# Install dependencies
npm install
# Run tests
npm test
# Test locally
node src/cli.js initContributions are welcome! Please:
- Fork the repository
- Create a feature branch
- Make your changes with tests
- Submit a pull request
MIT - See LICENSE file for details
Built to make AI agents better at navigating monorepos without token waste.