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.

From aditya on X · Oct 2026

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

What the source did

  • 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 from the original post. See the original for the full context. How we source recipes

Our notes

What it takes
One contract file both tools load, synced across machines, plus a ticket tool.
Where it breaks
Agents skipping the ticket and inventing scope, and the same agent reviewing its own work.
Human checkpoint
You merge PRs and flip feature flags.
Tools involved
Claude Code, Codex, Linear (or any ticket tool)

✓ Verified Source link checked and still live. Notes by Thomas, editor. How we verify

Copy the prompt

Ours Our version, based on what aditya described. Not their wording. Fill in the [BRACKETS].

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 rule

🛡
You 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

⚠
  • 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.

Get the 10 best agent setups. Free.

Plus new recipes every week. One email, no spam.

Unsubscribe anytime. Privacy

Related recipes

Same job: Dev & code

More Multi-agent recipes

In these guides: Claude Code vs Codex →

Read original ↗