Help us improve
Share bugs, ideas, or general feedback.
From omo
Generate CLAUDE.md files for project directories and auto-configure Serena MCP for LSP support
npx claudepluginhub mrzhbr/oh_my_openclaude --plugin omoHow this command is triggered — by the user, by Claude, or both
Slash command
/omo:init-deep [directory-path]The summary Claude sees in its command listing — used to decide when to auto-load this command
# Init Deep — Generate Directory CLAUDE.md Files
Analyze the project structure, generate CLAUDE.md files for each significant directory, and auto-configure Serena MCP if the project has language server support.
**Target:** {{arguments}} (default: current project root)
## Workflow
### Step 0: Initialize OmO State
### Step 0.5: Configure Permissions for Autonomous Execution
Check if `.claude/settings.local.json` exists in the project root. If it doesn't, create it with the recommended OmO permissions:
If the file already exists, merge the `permissions.allow` entries without removing...Share bugs, ideas, or general feedback.
Analyze the project structure, generate CLAUDE.md files for each significant directory, and auto-configure Serena MCP if the project has language server support.
Target: {{arguments}} (default: current project root)
mkdir -p .claude/omo/{plans,drafts,notepads,handoffs,evidence}
Check if .claude/settings.local.json exists in the project root. If it doesn't, create it with the recommended OmO permissions:
{
"permissions": {
"allow": [
"Read",
"Edit",
"Write",
"Glob",
"Grep",
"Bash(git *)",
"Bash(mkdir *)",
"Bash(ls *)",
"Bash(cat *)",
"Bash(bash .claude/plugins/omo/scripts/*)",
"mcp__plugin_omo_serena__*",
"mcp__plugin_omo_context7__*",
"mcp__plugin_omo_grep_app__*",
"WebFetch",
"WebSearch"
]
}
}
If the file already exists, merge the permissions.allow entries without removing existing rules. Tell the user what was added.
This enables autonomous execution for Atlas, Hephaestus, and other agents without constant permission prompts. Arbitrary bash commands (beyond git, mkdir, ls, cat, and OmO scripts) still require user approval.
Launch explorer agents in background (run_in_background: true):
Scale agent count with project complexity (more directories = more agents).
While explorers run in background, proceed with Step 2 scoring.
List all directories and score each using weighted factors:
| Factor | Weight | How to Measure |
|---|---|---|
| File count | 3x | Number of files in directory |
| Subdirectory count | 2x | Number of subdirectories |
| Code file ratio | 2x | Code files / total files (exclude generated, config, assets) |
| Symbol density | 2x | Count of exported functions, classes, types (grep for export) |
| Export count | 1x | Number of items exported from index/barrel files |
| Reference centrality | 1x | How many other directories import from this one |
Thresholds:
Check if the project has language server support by looking for:
tsconfig.json or jsconfig.json → TypeScript/JavaScript LSPpyproject.toml or setup.py or setup.cfg → Python LSPCargo.toml → Rust LSPgo.mod → Go LSPpom.xml or build.gradle → Java LSP*.sln or *.csproj → C# LSPGemfile → Ruby LSPPackage.swift → Swift LSPIf any are found, create or update the project's .mcp.json:
{
"serena": {
"command": "uvx",
"args": [
"--from",
"git+https://github.com/oraios/serena",
"serena",
"start-mcp-server",
"--context",
"claude-code",
"--project",
"{absolute-path-to-project-root}"
]
}
}
If .mcp.json already exists in the project, merge the serena entry without overwriting existing MCP servers. If serena is already configured, skip this step.
Also check if .claude/settings.local.json has enableAllProjectMcpServers or enabledMcpjsonServers — if not, inform the user they need to enable the MCP server.
Root CLAUDE.md (50-150 lines):
# {Project Name}
## Overview
{What this project does, 2-3 sentences}
## Tech Stack
{Languages, frameworks, key dependencies}
## Project Structure
{Directory tree with one-line descriptions}
## Where to Look
{Map of "if you need X, look in Y"}
## Conventions
{Code style, naming patterns, architectural patterns}
## Anti-Patterns
{Things to avoid that are specific to this codebase}
## Development
{How to build, test, run}
Subdirectory CLAUDE.md (30-80 lines max):
# {Directory Name}
## Purpose
{What this directory contains and why}
## Key Files
- `file.ts` — {purpose}
- `other.ts` — {purpose}
## Conventions
{Patterns specific to this directory}
## Dependencies
{What this directory depends on and what depends on it}
Generate subdirectory files in parallel. Never duplicate parent content in child files.
Before writing, validate:
Write CLAUDE.md to each directory. Do NOT overwrite existing CLAUDE.md files — instead, merge new information into them.