Recipes / Dev & code
Multi-agentFull setupDev & code

A personal operating contract for Claude Code and Codex

One standing contract both agents load automatically: Linear ticket first, Claude plans, Codex reviews, isolated worktrees, test-first, and independent review before any PR.

Setup time20 min
CostYour Claude + Codex plans
RunsEvery session
NeedsClaude Code, Codex, Linear (or any ticket tool)
Last updated2026-10-16
XSource

i built a personal operating contract for Claude Code and Codex

by aditya (@adxtyahq) · 2026-10-16

✓ Opened via the X API on 2026-10-16

Read the original ↗
Part 1 · What the source did

One standing contract both agents load automatically: Linear ticket first, Claude plans, Codex reviews, isolated worktrees, test-first, and independent review before any PR.

  • Wrote a personal operating contract that syncs across machines and loads into Claude Code and Codex automatically.
  • Rules: Linear ticket before every task; Claude plans, Codex reviews; isolated git worktrees; test-first; independent reviews before PRs; feature flags for production; model choice by task complexity.
  • Goal: stop re-explaining how you work at the start of every session.
“stop repeating instructions and build a system that gets better with every task”— aditya (@adxtyahq), X

Summary written by Agent Cookbook. See the original for the full context.

Part 2 · Our copy-paste version

Adapted by us from what the source described. Fill in the [BRACKETS].

The prompt

You are bound by my personal operating contract. Load it at the start of every session and follow it without me restating it. 1. Ticket first: refuse to start implementation until there is a [Linear/Jira/GitHub Issues] ticket ID and a one-line goal in the ticket. 2. Roles: Claude Code owns planning and architecture write-ups. Codex owns validation, gap-finding, test suites, and pre-PR review. Neither merges. 3. Isolation: every agent task gets its own git worktree/branch. No shared dirty tree. 4. Test-first: write or update failing tests before production code for the ticket's exit gate. 5. Review gate: before opening a PR, run an independent review (prefer the other agent) covering bugs, missing tests, and scope creep. Attach the review notes to the PR description. 6. Production: ship behind a feature flag when the change is user-facing. I flip the flag. 7. Model choice: use the stronger model for planning and hard bugs; cheaper models for bounded implementation. Document why if you promote a task to the stronger model. 8. Never send, buy, post, delete, or force-push without my explicit yes for that action. At session start, restating: ticket ID, role you are playing today, worktree path, and the exit gate.
🛡
Approval ruleYou merge PRs and flip feature flags. Sending, buying, posting, and deleting always need a human.

Set it up

  1. Save the contract in a file both tools read (for example `OPERATING_CONTRACT.md` plus a one-line include from `CLAUDE.md` / `AGENTS.md`).
  2. Sync that file to every machine you code on.
  3. Start one small ticket and force the full path: plan → worktree → tests → other-agent review → PR.

Common failures

⚠
What usually goes wrong
  • Agents skip the ticket and invent scope; keep the refuse-to-start rule.
  • Reviews rubber-stamp the same agent's work; swap agents for the review gate.

Variations

  • Drop Linear and use GitHub Issues only.
  • Add Grok Bot as the ticket intake / status reporter, still no merge rights.

Related recipes