codex-cli-best-practice
CLAUDE.md1k starsChanged 9 months agoMITView on GitHub
A best practices reference repository for Codex CLI (v0.121.0+) and Claude Code, demonstrating the Agent → Skill orchestration pattern through a weather data system example. This is a documentation and configuration reference, not a traditional application codebase. Maintained by Shayan Raees (@shanraisshan). Companion repos: claude-code-best-practice, codex-cli-hooks, claude-code-hooks. The repo demonstrates four interconnected systems: Run it: codex then prompt "Fetch the current weather for Dubai in Celsius and create the SVG weather card output using the repo." Profiles (codex --profile <name>):…
Trending
Quiet since June.thin dataabout the whole repository
Who's talking about shanraisshan/codex-cli-best-practice
- mohamedmasoud3030-tech/malek“docs: separate Codex and Claude agent guidance”GitHub · Jun 18, 2026
- pbi-agent/pbi-agent“Enhance README.md”GitHub · Apr 4, 2026
The biggest 2 of 2 mentions linking to the repository that our crawl found. Each line is their own headline.
In this repository2 other files it gives its agents.
- AGENTS.mdAGENTS.md
- weather-svg-creatorSkill
The file
We split this CLAUDE.md into the rules it gives an agent
7 rules. About 0 are common, 3 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 32
Run it: codex then prompt "Fetch the current weather for Dubai in Celsius and create the SVG weather card output using the repo."
- Distinctive: line 58
Commit 1: git add README.md → commit with README-specific message
- Very specific: line 59
Commit 2: git add best-practice/codex-agents-md.md → commit with agents-doc-specific message
- Very specific: line 60
Commit 3: git add .agents/skills/weather-svg-creator/SKILL.md → commit with skill-specific message
- Distinctive: line 66
When editing best-practice guides or documentation in this repo:
- Distinctive: line 67
Keep AGENTS.md under 150 lines (32 KiB byte cap)
- Very specific: line 69
Use profiles for safety switching.
≈ “Common” is an estimate: at least 1 in 5 of the 12,729 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
What This Is
A best practices reference repository for Codex CLI (v0.121.0+) and Claude Code, demonstrating the Agent → Skill orchestration pattern through a weather data system example. This is a documentation and configuration reference, not a traditional application codebase.
Maintained by Shayan Raees (@shanraisshan). Companion repos: claude-code-best-practice, codex-cli-hooks, claude-code-hooks.
Architecture
The repo demonstrates four interconnected systems:
- Config (
.codex/config.toml) — TOML-based layered config with 5 profiles (conservative, development, trusted, ci, review), MCP server registration, and agent definitions. Project-level overrides user-level (~/.codex/config.toml); CLI flags override both. - Agents (
.codex/agents/*.toml) — Registered under[agents.<name>]in config.toml with dedicated role files. The weather-agent fetches temperature from Open-Meteo API and delegates rendering to a skill. - Skills (
.agents/skills/<name>/SKILL.md) — Reusable instruction packages with YAML frontmatter (name,description). Discovered progressively from cwd up to/etc/codex/skills. Invoked via/skills,$skill-name, or auto-triggered by description match. - Hooks — Event-driven Python scripts. Claude Code has 27 hooks (
.claude/settings.json→.claude/hooks/scripts/hooks.py); Codex CLI has 5 (.codex/hooks.json). Hooks play audio feedback per event with cross-platform support (macOS/Linux/Windows).
Orchestration Flow
User Prompt → weather-agent (fetches temp from Open-Meteo)
→ /weather-svg-creator skill (renders SVG card)
→ orchestration-workflow/weather.svg
→ orchestration-workflow/output.mdRun it: codex then prompt "Fetch the current weather for Dubai in Celsius and create the SVG weather card output using the repo."
Key Directories
best-practice/— 8 comprehensive guides: config, agents-md, skills, subagents, hooks, mcp, marketplace, memoryorchestration-workflow/— Weather system example with flow diagram and generated outputsdocs/SKILLS.md— Skills system referenceexamples/— Profile configs and CI/CD integration examplesAGENTS.md— Project guidance loaded hierarchically by Codex (cwd to git root, capped at 32 KiB)
Configuration Quick Reference
Profiles (codex --profile <name>):
| Profile | Model | Sandbox | Approval |
| conservative | o4-mini | read-only | untrusted |
| development | o4-mini | workspace-write | on-request |
| trusted | o3 | workspace-write | never |
| ci | o4-mini | read-only | never |
| review | o3 | read-only | on-request |
Git Commit Convention
One file, one commit — do NOT bundle multiple file changes into a single commit. Each file gets its own commit with a descriptive message specific to that file's changes.
For example, if README.md, best-practice/codex-agents-md.md, and a skill file all changed:
- Commit 1:
git add README.md→ commit with README-specific message - Commit 2:
git add best-practice/codex-agents-md.md→ commit with agents-doc-specific message - Commit 3:
git add .agents/skills/weather-svg-creator/SKILL.md→ commit with skill-specific message
This keeps git history clean and makes it easy to review, revert, or cherry-pick individual changes.
Content Guidelines
When editing best-practice guides or documentation in this repo:
- Keep AGENTS.md under 150 lines (32 KiB byte cap)
- Skill descriptions should be triggers ("when should I fire?"), not summaries
- Use profiles for safety switching; keep behavioral rules out of AGENTS.md when config.toml is deterministic
- Skills should stay under 150 lines with progressive disclosure (core in SKILL.md, details in
references/)
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

