codex-claude-code-config
AGENTS.md153 starsChanged 7 months agoMITView on GitHub
This is a configuration system repository for AI coding agents, not an application. It collects battle-tested architectural principles, security hardening, and decision frameworks that any coding agent can drop into any project. When the user asks you to "set up this project" or "apply these principles": Every clone/copy/move/sync command requires a .claude/transfers/<id>.json contract and a # transfer-contract: marker. The contract records source, destination, operation/settings, purpose, motivation, deadline, verification, source cleanup, and the next action. The transfer Stop hook blocks unfinished…
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.
Of the AGENTS.md files we read, the 11,773 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository59 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- agent-harness-designSkill
- agents-best-practicesSkill
- diffusion-engineeringSkill
- flux2-klein-promptingSkill
- flux2-lora-trainingSkill
- forensic-prompt-compilerSkill
- ml-research-labSkill
- notebooklm-grounded-researchSkill
- vlm-segmentationSkill
- feature-newSkill
- harness-designSkill
- layer-newSkill
- plan-swarm-reviewSkill
- pixel-art-storyboardSkill
- pixel-art-studioSkill
- architecture-firstSkill
- architecture-qualitySkill
- bug-reproducerSkill
- code-complexitySkill
- control-cliSkill
- control-uiSkill
- deep-reviewSkill
- deslopSkill
- distill-feedbackSkill
- harness-feedbackSkill
- proof-verifySkill
- refactoring-safelySkill
- repo-mapSkill
- system-and-data-designSkill
- testing-strategySkill
- thermo-nuclear-code-quality-reviewSkill
- verify-thisSkill
- workflow-orchestrationSkill
- frontend-designSkill
- motion-framerSkill
- ui-designSkill
- ui-ux-pro-maxSkill
- ios-developmentSkill
- lean-codeSkill
- cross-harness-continuationSkill
- deepseek-provider-contractSkill
- desktop-sessions-discoverySkill
- epistemic-challengeSkill
- gemini-delegateSkill
- harness-auditSkill
- observability-monitoringSkill
- remote-compute-opsSkill
- plan-to-ticketsSkill
- product-meaning-extractorSkill
- remotion-production-guideSkill
- script-evaluatorSkill
- video-narrative-arcSkill
- video-post-productionSkill
- article-structure-reviewSkill
- cavemanSkill
- humanize-englishSkill
- humanize-russianSkill
- owner-voiceSkill
The file
Show its rules and text
We split this AGENTS.md into the rules it gives an agent
15 rules. About 0 are common, 7 are distinctive, and 8 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈7
Distinctive · estimate
This author's own choices. Worth a look.
8
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 19
When the user asks you to "set up this project" or "apply these principles":
- Distinctive: line 21
Read README.md first - it maps principles to the problems they solve
- Very specific: line 22
Read principles/README.md for the maturity-level map (L1 -> L2 -> L3)
- Distinctive: line 23
Do NOT bulk-copy everything.
- Distinctive: line 29
Before copying a principle, verify the user's stack matches the examples
- Very specific: line 30
After setup, run scripts/validate_config.py --strict and the relevant hook self-tests to catch drift in the freshly assembled config
- Very specific: line 34
Every clone/copy/move/sync command requires a .claude/transfers/<id>.json contract and a # transfer-contract: marker.
- Distinctive: line 42
When the user's acceptance condition is a finished job, dataset, migration, rollout, or other terminal outcome, a schedule/watchdog is a …
- Distinctive: line 72
If an additional mechanism compensates for a weakness introduced by the base solution, first revise or simplify the base candidate.
- Very specific: line 98
Keep SKILL.md under 5000 words.
- Very specific: line 121
After installing into a local Codex/Claude environment, also run python scripts/test_task_completion_hooks.py and consult …
- Very specific: line 127
When the user explicitly authorizes automatic cooperation and the current work has two or more independent, bounded scopes (not merely two …
- Very specific: line 132
Before dispatching any Claude subagent, render the task-bound contract with python hooks/agent-skill-contract.py --task "<child task>".
- Distinctive: line 163
No timestamps or dynamic content
- Very specific: line 176
When a verified RTK executable is available, use it only for repetitive, diagnostic shell output such as rtk git status, rtk git diff, rtk …
≈ “Common” is an estimate: at least 1 in 5 of the 16,595 AGENTS.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
AGENTS.md
This is a configuration system repository for AI coding agents, not an application. It collects battle-tested architectural principles, security hardening, and decision frameworks that any coding agent can drop into any project.
Purpose
principles/- architectural principles, each preventing a specific failure modealternatives/- side-by-side comparisons of 2-5 approaches per problemhooks/- ready-to-use Python hook scripts (session management, safety guards); installer:scripts/install_hooks.pytemplates/- starter CLAUDE.md and REVIEW.md files for different project typesskills/- domain-specific knowledge bundles (loaded on demand)rules/- drop-in.claude/rules/files (agent-harness design rules live on-demand in theagent-harness-designskill, not always-on)workflows/- dynamic-workflow commands + cost lessonsscripts/- utilities (hook installer, config drift validator, KV-cache stats, public-repo sync)CLAUDE.md- Claude Code-specific overlay (extends this file)
How agents should use this repo
When the user asks you to "set up this project" or "apply these principles":
- Read
README.mdfirst - it maps principles to the problems they solve - Read
principles/README.mdfor the maturity-level map (L1 -> L2 -> L3) - Do NOT bulk-copy everything. Pick what matches the user's actual project:
- Any project: Principle 09 (Supply Chain Defense), Principle 10 (Agent Security), Principle 11 (Documentation Integrity)
- Long sessions expected: Principle 07 (Codified Context) +
alternatives/context-management.md - Long-running project:
templates/long-run-project/, a Git worktree with anoriginremote, and an agent-facing KB before creatingfeature_list.json(that marker enables the completion gates) - Multi-agent work: Principle 01 (Harness Design) + Principle 06 (Multi-Agent Decomposition)
- Iterative optimization: Principle 03 (Autoresearch)
- Before copying a principle, verify the user's stack matches the examples
- After setup, run
scripts/validate_config.py --strictand the relevant hook self-tests to catch drift in the freshly assembled config
File transfers
Every clone/copy/move/sync command requires a .claude/transfers/<id>.json
contract and a # transfer-contract: marker. The contract records source,
destination, operation/settings, purpose, motivation, deadline, verification,
source cleanup, and the next action. The transfer Stop hook blocks unfinished
or invalid records; never remove a source before the destination is verified.
Long-running completion supervisors
When the user's acceptance condition is a finished job, dataset, migration, rollout, or other
terminal outcome, a schedule/watchdog is a completion supervisor, not a passive status monitor.
An early process exit without a terminal receipt is INTERNAL_FIXABLE or RETRYABLE: reconcile
the possible side effect, then perform the next safe idempotent resume/repair within a durable
attempt budget. A .failed marker or failed receipt proves that an attempt failed; it does not
prove that the cause is external. A reproducible local input or software defect remains
INTERNAL_FIXABLE: preserve its evidence, make the minimal Git-backed causal repair and successor
contract, then resume from the last valid checkpoint. A generated prompt may use
report-only/never-restart behavior only when the user
explicitly requested observation-only operation or a measured external/irreversible boundary makes
recovery unauthorized. Persist process identity, checkpoint/output, idempotency key, attempt/limit,
recovery predicate, and terminal proof; a heartbeat or blocker paragraph is not progress by itself.
Reasoning Policy: Selection Before Expansion
Core rule: a sufficient solution is a reason to stop expanding, not an invitation to add optional improvements.
Within the discretion left to you, keep any material solution you create or choose as a candidate until its necessity, sufficiency, material consequences, and total ownership cost support it as the simplest known way to satisfy the requested outcome and required contracts.
Once a sufficient solution exists, do not propose or add improvements by inertia. Treat every additional mechanism, abstraction, safeguard, edge-case handling, future-proofing measure, or process as a separate candidate. Include it only when an accepted requirement, an applicable constraint, or an evidenced material risk justifies its total implementation, verification, and ownership cost. Possible usefulness, best practice, or a desire for greater completeness is not sufficient justification.
If an additional mechanism compensates for a weakness introduced by the base solution, first revise or simplify the base candidate. Stop when the outcome and required contracts are satisfied. Do not include optional improvements or rejected candidates unless the user explicitly asks for them.
This gate does not authorize reopening accepted requirements, explicit operator decisions, or governing sources.
Written in English deliberately: these instructions are read by models that reason in English first, so a Russian original risks being applied through a translation nobody reviewed.
Relation to the two advisories in hooks/. over-engineering-advisor asks whether a
change is the smallest solution; module-shape-advisor asks whether a file has outgrown
its shape. This policy is the reasoning-level rule they enforce mechanically at opposite
ends, and it is what keeps them from being read as contradicting each other: neither
argues for more or less code as such, both ask whether the next addition has earned its
cost.
Style conventions for this repo
- Principles are standalone files in
principles/NN-name.md - Each principle has: Overview, The Paradigm, The Mechanism, Case Study, Sources
- Alternatives follow the 5-approach comparison format with a decision table
- Skills are
skills/<category>/<name>/SKILL.mdwith an optionalreferences/folder - Descriptions must be model triggers, not human summaries
- Keep SKILL.md under 5000 words; detail goes in
references/
Do not touch
principles/existing files: edit only to fix drift, not to restructurescripts/validate_config.py: any change requires re-testing against the full repoLICENSE,UPDATES.mdcommit history: append only
Commands
This repository has no application build or deploy step. Its verification suite checks documentation, skills, hook behavior, and live runtime wiring:
python scripts/validate_config.py --strict
python scripts/generate_skills_lock.py --check
python scripts/generate_skills_catalog.py --check
python evals/hooks/run_hook_evals.py
python scripts/test_lifecycle_hook_contracts.py
python scripts/test_dependency_provenance_guard.py
python scripts/dependency-alternatives.py --self-test
python scripts/test_test_strategy.pyAfter installing into a local Codex/Claude environment, also run
python scripts/test_task_completion_hooks.py and consult
docs/runtime-wiring.md.
Delegating agents
When the user explicitly authorizes automatic cooperation and the current work has two or more
independent, bounded scopes (not merely two coupled files), dispatch them with the actually
available native collaboration.spawn_agent/Task tool and join their receipt-bound results as
required by rules/finish-the-task.md.
Before dispatching any Claude subagent, render the task-bound contract with
python hooks/agent-skill-contract.py --task "<child task>"; use --profile
codex only for a manually rendered Codex brief. Append it to
the exact child prompt. It selects the minimum curated skill set (or an explicit
no-route result), requires source-backed decisions, and records INCONCLUSIVE
when no current source is available. Claude Task and Codex
PreToolUse(Agent)/PostToolUse(Agent) plus SubagentStart/SubagentStop are
contract enforcement only where those events are actually emitted; current desktop
collaboration.spawn_agent bypasses them and has LIMITED transcript coverage
under the linked rule.
The rendered contract also keeps explicit task instructions above skill
methodology and requires the child to name the exact skill instruction whenever
that methodology causes a pause or divergence. A missing routed skill starts a
bounded search: inventory and audit candidates with the existing install
checklist; if none passes, build a research-backed local skill with real-task
evidence, primary sources, baseline and held-out evals, independent review, and
an owner/version/update/rollback contract, then resume the original task. The
gate measures behavior and maintainability, not size. It does not stop the task
or authorize an unreviewed third-party install.
Codex PreToolUse(Agent) adds a client-profile-bound contract before launch and
its post-hook binds the route to agent_id; unavailable capabilities stay in
missing-skills, never masquerade as loaded Claude-only skills. SubagentStop
rejects a routed NO_MATCH and accepts GAP_RESOLVED only when per-source
research maps to exact skill instructions, typed case evidence beats the
baseline, and a separate digest-bound receipt proves the resumed original task.
Context engineering notes
This file is designed for KV-cache efficiency and the 150-line AGENTS.md standard:
- Under 80 lines - fits in a single cached prompt prefix
- No timestamps or dynamic content
- Stable section order - do not shuffle
- Append-only edits preferred over restructuring
- For Claude Code-specific behaviors (hooks, skills automation), see
CLAUDE.mdas an overlay
Related standards
- AGENTS.md specification - Linux Foundation / Agentic AI Foundation
- How to write a great AGENTS.md - GitHub best practices from 2500+ repos
- See
CLAUDE.mdfor Claude Code-specific extensions to this file
Optional RTK Output Compression
When a verified RTK executable is available, use it only for repetitive,
diagnostic shell output such as rtk git status, rtk git diff, rtk git log,
rtk read, and supported test runners. Preserve raw output for exact evidence,
novel commands, destructive operations, and logs where ordering matters. RTK
does not replace safety hooks or test gates; its failure mode must be pass-through.
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.

