rules

Apply Codex Rules from AGENTS.md, CLAUDE.md, CONTEXT.md, and .rules directories to Claude Code sessions.

17|Updated May 29, 2026
One-click install
npx skills add https://github.com/code-yeongyu/lazyclaudecode --skill rules-code-yeongyu
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: rules
Source: https://github.com/code-yeongyu/lazyclaudecode/tree/main/plugins/omo/components/rules/skills/rules
Command: npx skills add https://github.com/code-yeongyu/lazyclaudecode --skill rules-code-yeongyu

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Codex Rules management and injection for Claude Code sessions, guiding behavior and ensuring consistent rule application across prompts and tooling.

Core Features & Use Cases

  • Injects project-specific rules from AGENTS.md, CLAUDE.md, CONTEXT.md, and various .rules directories into the active session.
  • Matches and enforces rules after code changes (apply_patch) and during tool usage, without rewriting tool outputs.
  • Supports dynamic PostToolUse injections with per-session deduplication and configurable environment knobs.

Quick Start

Ask the plugin to surface Codex Rules for the current project.

Frequently Asked Questions about rules

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I inject project-specific rules into Claude Code sessions?

Rule injection timing occurs at four specific lifecycle hooks: SessionStart, UserPromptSubmit, PostToolUse, and PostCompact. This ensures rules are applied at session initialization, prompt submission, after tool usage, and following context compaction without rewriting tool outputs.

Can I enforce Codex Rules automatically after code changes without rewriting tool output?

Yes, Codex Rules are enforced after code changes via PostToolUse injections. The Skill matches and applies rules dynamically during tool usage while strictly preserving and not rewriting the original tool output.

What is the best way to prevent duplicate rule injections within a single Claude Code session?

The best way to prevent duplicate rule injections is using the built-in per-session deduplication feature. It automatically tracks injected rules across the active session, ensuring dynamic PostToolUse injections and context applications remain unique and non-redundant.

Does Claude Code support configuring environment knobs for Codex Rules behavior?

Claude Code supports configurable environment knobs for Codex Rules behavior. These dynamic settings allow you to control rule enforcement and injection behavior across different sources like AGENTS.md, CLAUDE.md, CONTEXT.md, and .rules directories.

Why are my AGENTS.md and CLAUDE.md rules not applying consistently across tool usage?

Rules from AGENTS.md and CLAUDE.md may not apply consistently if injection timing is misconfigured or per-session deduplication is active. Ensure rules are properly targeted for SessionStart, UserPromptSubmit, PostToolUse, or PostCompact lifecycle hooks.