LazyCodex
LazyCodexv4.12.1

$init-deep

Generates hierarchical AGENTS.md project memory so later agents start with full context.

$init-deep builds LazyCodex project memory. It creates hierarchical AGENTS.md files across the repository so every later agent run starts with the context it needs, right next to the code it is about to edit.

Run it when the repository is too large to explain from memory.

What It Does

Scores Complex Directories

$init-deep walks the codebase, scores directories by complexity, and finds the places that actually need written guidance.

Writes Local Guidance Near Code

Important directories get nearby AGENTS.md files that explain that slice of code. The guidance is not buried in one huge root file; the agent finds it where it is working.

Leaves Landmarks for Future Agents

The resulting AGENTS.md hierarchy gives future agents landmarks before they edit: what exists here, how it fits together, and what to watch out for.

When To Run It

  • When you first work in a codebase. Run $init-deep before giving LazyCodex real work in an unfamiliar or large repository.
  • When the repository is too large to explain from memory. If you cannot summarize the project in one sentence, let $init-deep draw the map.

When To Run It Again

Run $init-deep again when the shape of the codebase changes: a new top-level area, a large refactor, or any restructuring that makes existing AGENTS.md landmarks stale. Keeping memory fresh makes every later run more grounded.

Options

The default run is update mode: it reads existing AGENTS.md files and refreshes the places that need changes.

$init-deep
$init-deep --create-new
$init-deep --max-depth=2
  • --create-new reads existing AGENTS.md context, preserves it, then regenerates the structure.
  • --max-depth=<number> limits directory traversal depth. The default is 3.

Where It Fits

$init-deep is the memory step. Once the map exists, the other Commands do the work.

  • $ulw-plan decides what to build before code changes.
  • $start-work executes a plan to the last checkbox.
  • $ulw-loop keeps open-ended work moving until the result is verified.

On this page