agent-contract-handoff

agent-contract-handoff is a skill for Claude Code from metraton/gaia. It costs 20 tokens per session (3,137 once invoked), scanned A, original, MIT.

A reference for the JSON format and validation rules of an agent handoff. An agent handoff is the saved envelope that records one dispatched agent turn, separate from stored project knowledge.

In plain words
What is it for?
Use it to implement or validate handoff records, including their creation at dispatch, allowed project-context access, updates, and finalization.
Why use it?
It prevents different meanings of “contract” from being mixed up and ensures handoffs are created, updated, and closed in the expected way.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: mentions subagents.

Part of the gaia plugin — 38 skills, 9 agents, 11 hooks shipped together

Good fit Use it to implement or validate handoff records, including their creation at dispatch, allowed project-context access, updates, and finalization.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/metraton/gaia/agent-contract-handoff
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add metraton/gaia --skill agent-contract-handoff
Clone the repo
git clone --depth 1 https://github.com/metraton/gaia

Made for: Claude Code.

Or install gaia, the plugin that ships this one along with the rest of its 38 skills, 9 agents, 11 hooks.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for agent-contract-handoff

README.md
[![agentmods](https://agentmods.dev/badge/skills/metraton/gaia/agent-contract-handoff/github.svg)](https://agentmods.dev/skills/metraton/gaia/agent-contract-handoff)
Your own site
<a href="https://agentmods.dev/skills/metraton/gaia/agent-contract-handoff"><img src="https://agentmods.dev/badge/skills/metraton/gaia/agent-contract-handoff/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for agent-contract-handoff

Your own site · 80×15
<a href="https://agentmods.dev/skills/metraton/gaia/agent-contract-handoff"><img src="https://agentmods.dev/badge/skills/metraton/gaia/agent-contract-handoff.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 20 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,137 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00020 $0.03137
Opus 5 $0.00010 $0.01569
Sonnet 5 $0.00004 $0.00627
Haiku 4.5 $0.00002 $0.00314

Measured 9d ago against content hash 71eaa65a805d, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

agent-contract-handoff scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/agent-contract-handoff/SKILL.md · 230 lines

How it starts

The opening of the file, as written. The whole thing — 230 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Agent Contract Handoff Reference

This skill owns schema, not workflow. Use agent-protocol to produce a turn and agent-response to consume it. The envelope body is JSON, never YAML.

Two senses of "contract" -- do not collapse them. This skill's "contract" is the handoff envelope: one row per turn, born at dispatch under the injected # Your Contract block, mutated by gaia contract set/add/fill, closed by gaia contract finalize. A project context contract is a different thing -- a slice of project knowledge stored per workspace (project_context_contracts, seeded by seed_contract_permissions.py). It is NOT injected: the kernel's can_read / can_write lists (from agent_contract_permissions) name which of those slices the turn may pull on demand (the verb that reaches them, and the same-named sibling that reads a different table entirely, are in agent-protocol/read-map.md) and which it may propose updates to via update_contracts. When a message says "contract" without qualifying it, ask which one it means before assuming.

Draft creation is implicit

A turn born at dispatch already has a row in agent_contract_handoffs AND a pre-created on-disk draft (dispatch_binding._precreate_draft writes gaia.contract.drafts.initial_envelope at birth) before it runs anything -- no prior gaia contract init call is required. Should the draft file be missing anyway, the first gaia contract set/add/fill/view --draft-id <draft_id> against that same, already-born contract_id materializes it (bin/cli/contract.py::_maybe_adopt_draft). Two conditions gate it, and both must hold: the id's agent-id prefix matches AGENT_ID_PATTERN_TEXT, and a row already exists for that exact contract_id (gaia.store.writer.agent_contract_handoff_exists). Neither condition mints anything -- a well-formed id with no row behind it still fails with the same "No draft found... run init" error as before this existed. gaia contract init remains, unchanged, the explicit path for a turn that received no injected identity at all. gaia contract validate never triggers this: it is documented as never mutating the draft, so it never materializes one either. See agent-protocol for when in the turn's cycle this first write happens.

Read the full file on GitHub · 230 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 9d ago First seen · 230 lines · 20 tokens per session scan A 71eaa65a805d

Subscribe to this mod's changes

agent-contract-handoff is a skill published in the GitHub repository metraton/gaia (3 stars, last pushed today), licensed MIT. It adds 20 tokens to every session and 3,137 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories