LazyCodex
LazyCodexv4.12.1

rules

Project instructions automatically injected from CONTEXT, rules, and instruction files.

The rules Skill anchors LazyCodex (LZX) to project-specific instructions. When the OmO (oh-my-openagent) plugin is enabled in Codex, project rules are injected automatically. You do not need to paste them into every session. Codex keeps supported rules and instruction files in context while it works.

One-Line Summary

Codex Rules is automatic. It injects static project instructions at session start and on each prompt, then injects file-specific matching rules after edits. There is no command to run. Turn on the plugin, and the repository conventions follow Codex everywhere.

Injection Targets

  • 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 duplicate plugin data is removed per session. Codex Rules does not rewrite tool output. It only adds instructions beside it.

Supported Project Sources

SourceNotes
CONTEXT.mdGeneral project context.
.omo/rules/**/*.mdOmO/LazyCodex rules tree.
.claude/rules/**/*.mdClaude rules directory.
.cursor/rules/**/*.mdCursor rules.
.github/instructions/**/*.mdGitHub instruction files.
.github/copilot-instructions.mdCopilot instructions.

Configuration

Environment variables adjust the behavior.

VariableEffect
CODEX_RULES_DISABLED=1Disable the entire Skill.
CODEX_RULES_MODE=both|static|dynamic|offChoose static, dynamic, both, or off.
CODEX_RULES_MAX_RULE_CHARS=<number>Limit the size of each injected rule.
CODEX_RULES_MAX_RESULT_CHARS=<number>Limit injected result context size.
CODEX_RULES_ENABLED_SOURCES=CONTEXT.md,.omo/rulesRestrict which sources are read.

Legacy PI_RULES_* variables remain accepted as a fallback for users migrating from pi-rules.

Pairing With $init-deep

$init-deep creates hierarchical project memory. The rules Skill then keeps supported rules and instruction files in front of Codex on every session and prompt. Once the memory exists, rules keeps injecting it.

On this page