Skip to main content
skill Claude Code CX Codex Cursor GitHub Copilot

deepinit — Claude Code skill: what it does, how to install

Walks a repository and writes an AGENTS.md per directory: what sits there, how the parts connect, what an agent should know before editing.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add Yeachan-Heo/oh-my-claudecode --skill deepinit -a claude-code
Open on GitHub

What deepinit does

The skill produces a tree of AGENTS.md files, one per directory. Every file except the root carries a **Parent context:** line pointing at its parent, so an agent can move from the root down and keep its bearings. Each file covers the directory's purpose, a table of key files, subdirectory links, testing requirements and notes for whoever edits there.

It maps directories first through an explore subagent, skipping node_modules, dist, __pycache__ and similar. Then it generates level by level, parents before children, since a child's parent reference has to resolve. Existing files are merged rather than replaced: the auto-generated sections and timestamps get refreshed, while the ## Manual Notes heading and everything beneath it stay. Validation runs at the end, checking that parent paths exist, no AGENTS.md is orphaned and no directory was missed.

The catch is how those nested files load. Claude Code does not pick up a nested AGENTS.md by basename, and a root @AGENTS.md import does not reach into subdirectories. OMC's PostToolUse hook injects the nearest one as files are accessed, so with DISABLE_OMC=1 or OMC_SKIP_HOOKS=post-tool-use the whole hierarchy goes unread. Check your hooks first; for the root, a CLAUDE.md symlink or the import still works.

What it helps with

  • generate AGENTS.md for every directory in a repo
  • refresh per-directory docs without wiping manual notes
  • catch broken parent-context links after files move
  • give an agent a map of an unfamiliar codebase

Example prompts for the agent

  • run deepinit across the repo, I want an AGENTS.md in every directory with code
  • regenerate `src/components/AGENTS.md` but leave the `## Manual Notes` section alone
  • validate the hierarchy: find every AGENTS.md and confirm the `**Parent context:**` paths resolve

How to install deepinit

1Skills CLI (Vercel)

npx skills add Yeachan-Heo/oh-my-claudecode --skill deepinit -a claude-code

2Manually: put the files in place

~/.claude/skills/deepinit/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/deepinit/

From the same set26

The whole set →
ai-slop-cleaner Yeachan-Heo Cleans bloated AI-generated code by deleting dead logic and duplicate abstractions. It keeps current behavior locked under regression tests. Claude Code CX Codex Cursor +1 1,500installs ralplan Yeachan-Heo A skill that runs iterative planning with three agents (Planner, Architect, Critic) until consensus. Blocks vague requests before execution, never runs changes without your approval. Claude Code CX Codex Cursor +1 1,200installs hud Yeachan-Heo The hud skill configures a HUD display in Claude Code's statusline, showing git branch, context usage, running subagents, and other metrics. Track session state and keep tabs on complex work without losing context. Claude Code CX Codex Cursor +1 1,100installs autopilot Yeachan-Heo A skill that takes a task description and runs the full development cycle: requirements analysis, design, implementation, testing, and validation—all hands-off. Use it when you want to describe what you need and get working code back. Claude Code CX Codex Cursor +1 999installs deep-interview Yeachan-Heo A skill that runs a Socratic interview on your idea, scores ambiguity across weighted dimensions, and blocks coding until the score falls under the threshold. Claude Code CX Codex Cursor +1 998installs omc-setup Yeachan-Heo Canonical setup and repair wizard for oh-my-claudecode. It configures CLAUDE.md files, HUD statusline, and agent team defaults. Claude Code CX Codex Cursor +1 987installs ralph Yeachan-Heo A persistence loop that works through tasks in prd.json until all stories pass and get reviewer verification. Useful for multi-step jobs that need guaranteed completion. Claude Code CX Codex Cursor +1 971installs visual-verdict Yeachan-Heo A visual QA skill that compares generated UI screenshots against reference images and returns a structured JSON verdict for layout iterations. Claude Code CX Codex Cursor +1 890installs

Similar

deep-agents-core langchain-ai Skill for building multi-step agents with task planning, context management, and task delegation. Built-in filesystem tools, persistent memory across sessions, and subagent spawning—configure, don't code. Claude Code CX Codex Cursor +1 15,900installs browseros-neo browseros-ai Routes website tasks to BrowserOS neo, using a browser with a persistent profile and active account sessions. Use it for forms, downloads, page checks, and account actions. Claude Code CX Codex Cursor +1 604installs spartan spartan-ng Helps manage spartan/ui components in Angular projects, from adding and composing them to styling and debugging. It covers the Brain and Helm layers. Claude Code CX Codex Cursor +1 2,200installs workflow-automation sickn33 Teaches durable execution for multi-step jobs: when a step dies mid-flow, the workflow picks up where it stopped instead of replaying from the start. Claude Code CX Codex Cursor +1 1,500installs setup-matt-pocock-skills Matt Pocock This skill configures a repository for Matt Pocock's engineering skills by setting its issue tracker, triage labels, and domain docs layout. Run it before using the other skills. Claude Code 1,052,851installs to-tickets Matt Pocock Turns a plan, spec, or conversation into small end-to-end tickets with explicit blockers. Use it to agree on the work breakdown before tickets go to a tracker. Claude Code 711,230installs writing-plans Jesse Vincent This skill turns requirements for a multi-step task into an implementation plan before code changes begin. It helps when another engineer needs exact files, interfaces, and checks. Claude Code CX Codex 282,859installs stitch-loop official google-labs-code Guides agents through iterative website creation with Stitch MCP. The agent reads the baton file, generates UI, integrates the page, and prepares tasks for the next run. Claude Code CX Codex Cursor +1 56,300installs

Questions about deepinit

How do I install deepinit in Claude Code?

Run npx skills add Yeachan-Heo/oh-my-claudecode --skill deepinit -a claude-code. The skill lands at ~/.claude/skills/deepinit/SKILL.md.

What does deepinit do?

It builds a hierarchical set of AGENTS.md files across the codebase, describing each directory's purpose, key files and subdirectories along with instructions for AI agents. Re-runs keep the ## Manual Notes section intact.

Do nested AGENTS.md files load on their own?

No. Claude Code discovers nested CLAUDE.md by name and ignores a nested AGENTS.md, and a root @AGENTS.md import stays at the root. OMC's PostToolUse hook delivers the nested files, so the hierarchy needs the plugin registered and its hooks enabled.

Source text

SKILL.md · MIT
---
name: deepinit
description: Deep codebase initialization with hierarchical AGENTS.md documentation
level: 4
---

# Deep Init Skill

Creates comprehensive, hierarchical AGENTS.md documentation across the entire codebase.

## Core Concept

AGENTS.md files serve as **AI-readable documentation** that helps agents understand:
- What each directory contains
- How components relate to each other
- Special instructions for working in that area
- Dependencies and relationships

## Hierarchical Tagging System

Every AGENTS.md (except root) includes a parent reference line:

```markdown
**Parent context:** `../AGENTS.md`
```

This MUST be visible prose, never an HTML comment. Claude Code strips HTML
comments before a memory file reaches the model, so `<!-- Parent: ... -->`,
`<!-- Generated: ... -->` and a commented MANUAL boundary are invisible to the
agent that is supposed to act on them.

This creates a navigable hierarchy:
```
/AGENTS.md                          ← Root (no parent line)
├── src/AGENTS.md                   ← **Parent context:** `../AGENTS.md`
│   ├── src/components/AGENTS.md    ← **Parent context:** `../AGENTS.md`
│   └── src/utils/AGENTS.md         ← **Parent context:** `../AGENTS.md`
└── docs/AGENTS.md                  ← **Parent context:** `../AGENTS.md`
```

## Loading Model

Stock Claude Code discovers nested `CLAUDE.md` by basename and never loads a
nested `AGENTS.md`; a root `@AGENTS.md` import does not reach subdirectories
either. The nested files generated here are delivered by OMC's PostToolUse
directory-context injector, which walks up from each accessed file and injects
the nearest `AGENTS.md`/`README.md` once per session.

That means the hierarchy requires OMC's hooks to be active. When OMC hooks are
disabled (`DISABLE_OMC=1`, `OMC_SKIP_HOOKS=post-tool-use`) or the plugin is not
registered, add a root-level `CLAUDE.md` symlink or `@AGENTS.md` import for the
root file and expect nested files to stay unread.

## AGENTS.md Template

```markdown
# {Directory Name}

**Parent context:** `{relative_path_to_parent}/AGENTS.md`
**Generated:** {timestamp} · **Updated:** {timestamp}

## Purpose
{One-paragraph description of what this directory contains and its role}

## Key Files
{List each significant file with a one-line description}

| File | Description |
|------|-------------|
| `file.ts` | Brief description of purpose |

## Subdirectories
{List each subdirectory with brief purpose}

| Directory | Purpose |
|-----------|---------|
| `subdir/` | What it contains (see `subdir/AGENTS.md`) |

## For AI Agents

### Working In This Directory
{Special instructions for AI agents modifying files here}

### Testing Requirements
{How to test changes in this directory}

### Common Patterns
{Code patterns or conventions used here}

## Dependencies

### Internal
{References to other parts of the codebase this depends on}

### External
{Key external packages/libraries used}

## Manual Notes

Notes under this heading are written by humans and preserved on regeneration.
```

## Execution Workflow

### Step 1: Map Directory Structure

```
Task(subagent_type="explore", model="haiku",
  prompt="List all directories recursively. Exclude: node_modules, .git, dist, build, __pycache__, .venv, coverage, .next, .nuxt")
```

### Step 2: Create Work Plan

Generate todo items for each directory, organized by depth level:

```
Level 0: / (root)
Level 1: /src, /docs, /tests
Level 2: /src/components, /src/utils, /docs/api
...
```

### Step 3: Generate Level by Level

**IMPORTANT**: Generate parent levels before child levels to ensure parent references are valid.

For each directory:
1. Read all files in the directory
2. Analyze purpose and relationships
3. Generate AGENTS.md content
4. Write file with proper parent reference

### Step 4: Compare and Update (if exists)

When AGENTS.md already exists:

1. **Read existing content**
2. **Identify sections**:
   - Auto-generated sections (can be updated)
   - Manual sections (the `## Manual Notes` heading and everything under it are preserved)
3. **Compare**:
   - New files added?
   - Files removed?
   - Structure changed?
4. **Merge**:
   - Update auto-generated content
   - Preserve manual annotations
   - Update timestamp

### Step 5: Validate Hierarchy

After generation, run validation checks:

| Check | How to Verify | Corrective Action |
|-------|--------------|-------------------|
| Parent references resolve | Read each AGENTS.md, check the `**Parent context:**` path exists | Fix path or remove orphan |
| No orphaned AGENTS.md | Compare AGENTS.md locations to directory structure | Delete orphaned files |
| Completeness | List all directories, check for AGENTS.md | Generate missing files |
| Timestamps current | Check the `**Generated:**` / `**Updated:**` dates | Regenerate outdated files |

Validation script pattern:
```bash
# Find all AGENTS.md files
find . -name "AGENTS.md" -type f

# Check parent references
grep -r "\*\*Parent context:\*\*" --include="AGENTS.md" .
```

## Smart Delegation

| Task | Agent |
|------|-------|
| Directory mapping | `explore` |
| File analysis | `architect` |
| Content generation | `writer` |
| AGENTS.md writes | `writer` |

## Empty Directory Handling

When encountering empty or near-empty directories:

| Condition | Action |
|-----------|--------|
| No files, no subdirectories | **Skip** - do not create AGENTS.md |
| No files, has subdirectories | Create minimal AGENTS.md with subdirectory listing only |
| Has only generated files (*.min.js, *.map) | Skip or minimal AGENTS.md |
| Has only config files | Create AGENTS.md describing configuration purpose |

Example minimal AGENTS.md for directory-only containers:
```markdown
# {Directory Name}

**Parent context:** `../AGENTS.md`

## Purpose
Container directory for organizing related modules.

## Subdirectories
| Directory | Purpose |
|-----------|---------|
| `subdir/` | Description (see `subdir/AGENTS.md`) |
```

## Parallelization Rules

1. **Same-level directories**: Process in parallel
2. **Different levels**: Sequential (parent first)
3. **Large directories**: Spawn dedicated agent per directory
4. **Small directories**: Batch multiple into one agent

## Quality Standards

### Must Include
- [ ] Accurate file descriptions
- [ ] Correct parent references
- [ ] Subdirectory links
- [ ] AI agent instructions

### Must Avoid
- [ ] Generic boilerplate
- [ ] Incorrect file names
- [ ] Broken parent references
- [ ] Missing important files

## Example Output

### Root AGENTS.md
```markdown
# my-project

**Generated:** 2024-01-15 · **Updated:** 2024-01-15

## Purpose
A web application for managing user tasks with real-time collaboration features.

## Key Files
| File | Description |
|------|-------------|
| `package.json` | Project dependencies and scripts |
| `tsconfig.json` | TypeScript configuration |
| `.env.example` | Environment variable template |

## Subdirectories
| Directory | Purpose |
|-----------|---------|
| `src/` | Application source code (see `src/AGENTS.md`) |
| `docs/` | Documentation (see `docs/AGENTS.md`) |
| `tests/` | Test suites (see `tests/AGENTS.md`) |

## For AI Agents

### Working In This Directory
- Always install dependencies after modifying the project manifest
- Use TypeScript strict mode
- Follow ESLint rules

### Testing Requirements
- Run tests before committing
- Ensure >80% coverage

### Common Patterns
- Use barrel exports (index.ts)
- Prefer functional components

## Dependencies

### External
- React 18.x - UI framework
- TypeScript 5.x - Type safety
- Vite - Build tool

## Manual Notes

Custom project notes can be added under this heading.
```

### Nested AGENTS.md
```markdown
# components

**Parent context:** `../AGENTS.md`
**Generated:** 2024-01-15 · **Updated:** 2024-01-15

## Purpose
Reusable React components organized by feature and complexity.

## Key Files
| File | Description |
|------|-------------|
| `index.ts` | Barrel export for all components |
| `Button.tsx` | Primary button component |
| `Modal.tsx` | Modal dialog component |

## Subdirectories
| Directory | Purpose |
|-----------|---------|
| `forms/` | Form-related components (see `forms/AGENTS.md`) |
| `layout/` | Layout components (see `layout/AGENTS.md`) |

## For AI Agents

### Working In This Directory
- Each component has its own file
- Use CSS modules for styling
- Export via index.ts

### Testing Requirements
- Unit tests in `__tests__/` subdirectory
- Use React Testing Library

### Common Patterns
- Props interfaces defined above component
- Use forwardRef for DOM-exposing components

## Dependencies

### Internal
- `src/hooks/` - Custom hooks used by components
- `src/utils/` - Utility functions

### External
- `clsx` - Conditional class names
- `lucide-react` - Icons

## Manual Notes
```

## Triggering Update Mode

When running on an existing codebase with AGENTS.md files:

1. Detect existing files first
2. Read and parse existing content
3. Analyze current directory state
4. Generate diff between existing and current
5. Apply updates while preserving manual sections

## Performance Considerations

- **Cache directory listings** - Don't re-scan same directories
- **Batch small directories** - Process multiple at once
- **Skip unchanged** - If directory hasn't changed, skip regeneration
- **Parallel writes** - Multiple agents writing different files simultaneously

© Yeachan-Heo · MIT · Yeachan-Heo/oh-my-claudecode

See also

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor