LazyCodex
LazyCodexv0.2.2

rules

Automatic project instructions injected from AGENTS, rules, and instruction files.

The rules skill keeps LazyCodex (LZX) anchored to your project's own instructions. Once the OmO (oh-my-openagent) plugin is enabled in Codex, project rules are injected automatically — Codex always works with your AGENTS.md, CLAUDE.md, and rule files in context, without you pasting them every session.

TL;DR

Codex Rules is automatic. It injects static project instructions at the start of every session and on each prompt, plus file-specific rules after edits. No command to run — enable the plugin and your repo conventions follow Codex everywhere.

What it injects

  • Static project instructions on SessionStart and UserPromptSubmit.
  • Matching file-specific rules after Codex apply_patch by default.

Dynamic PostToolUse output is injected as additional context and is deduplicated per plugin data session. Codex Rules does not rewrite tool output — it only adds your instructions alongside it.

Supported project sources

SourceNotes
AGENTS.mdPrimary project memory (pairs with /init-deep).
CLAUDE.mdCompatible Claude-style instructions.
CONTEXT.mdGeneral project context.
.sisyphus/rules/**/*.mdDiscipline-agent rule tree.
.claude/rules/**/*.mdClaude rule directory.
.cursor/rules/**/*.mdCursor rules.
.github/instructions/**/*.mdGitHub instruction files.
.github/copilot-instructions.mdCopilot instructions.

Configuration

Tune behavior with environment variables:

VariableEffect
CODEX_RULES_DISABLED=1Turn the skill off entirely.
CODEX_RULES_MODE=both|static|dynamic|offChoose static, dynamic, both, or off.
CODEX_RULES_MAX_RULE_CHARS=<number>Cap the size of each injected rule.
CODEX_RULES_MAX_RESULT_CHARS=<number>Cap the size of injected result context.
CODEX_RULES_ENABLED_SOURCES=AGENTS.md,.sisyphus/rulesRestrict which sources are read.

The legacy PI_RULES_* variables are accepted as fallbacks for users migrating from pi-rules.

Pairs with /init-deep

/init-deep generates hierarchical AGENTS.md project memory, and the rules skill is what then keeps that memory in front of Codex on every session and prompt. Generate the memory once, and rules injects it from then on.

On this page