Code Contracts: open format puts eval-like specifications next to your code for AI agents
aronchick · x · 2026-09-21
Code Contracts is a new open format for specifying structured assumptions and requirements colocated with code, aimed at faster, better agent-driven development. Commentator aronchick summed it up: "Contracts are evals for software/intent."
Key design points:
- A single @cc directive lives in code comments, with metadata (owner, labels like security, notify) and a stable ID
- One contract, one obligation: plain-language requirements concrete enough to detect violations, e.g. "if balance < amount, payment MUST fail with InsufficientFunds and leave balance unchanged"
- Rules colocate with code; directory-wide rules go in a CONTRACTS file
The rationale: human review attention is scarce, so explicit contracts let humans reason about behavior without reading implementations while giving agents explicit assumptions and verification signals to catch mistakes and improve.
More from coding & agent
- Delta and OpenTable block AI agents, hinting at a coming platform stand-off — Scobleizer · 2026-09-21
- ForgePoint Signal launches MCP-native daily US estate and tax law monitoring — modelcontextprotocol · 2026-09-21
- Memory MCP adds persistent semantic memory to AI assistants via Turso and OpenAI — modelcontextprotocol · 2026-09-21
- GPT-6-controlled robot arm breaks gripper during LEGO grasping; team seeks force-aware control — paigeinsf · 2026-09-21
- Agent failures don't throw: a 7-year engineer on clean double-runs and zero accountability — ilien-dev · 2026-09-21
- Agent runtime promises billions of agents and 10-20x sandbox density — astralmatrix · 2026-09-21