$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-deepbefore 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-deepdraw 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-newreads existingAGENTS.mdcontext, 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-plandecides what to build before code changes.$start-workexecutes a plan to the last checkbox.$ulw-loopkeeps open-ended work moving until the result is verified.