gaia-patterns

gaia-patterns is a skill for Claude Code from metraton/gaia. It costs 25 tokens per session (1,885 once invoked), scanned A, original, MIT.

A set of construction patterns for building Gaia components, including agents, skills, hooks, command-line tools, and routing configuration. It explains how prompts move through the system and recommends studying existing examples first.

In plain words
What is it for?
Use it when creating or changing Gaia agents, skills, hooks, CLI tools, or routing rules.
Why use it?
It gives new components a consistent structure and helps avoid incorrect assumptions about routing, hooks, contracts, and skill loading.

Skill for Claude Code

Written for Claude Code: PreToolUse hook event. Also seen: reads .claude/ paths; mentions subagents; mentions Claude Code.

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

Good fit Use it when creating or changing Gaia agents, skills, hooks, CLI tools, or routing rules.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/metraton/gaia/gaia-patterns
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 gaia-patterns
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 gaia-patterns

README.md
[![agentmods](https://agentmods.dev/badge/skills/metraton/gaia/gaia-patterns.svg)](https://agentmods.dev/skills/metraton/gaia/gaia-patterns)
Your own site
<a href="https://agentmods.dev/skills/metraton/gaia/gaia-patterns"><img src="https://agentmods.dev/badge/skills/metraton/gaia/gaia-patterns.svg" alt="Measured on agentmods" height="20"></a>
Per session 25 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,885 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.00025 $0.01885
Opus 5 $0.00013 $0.00942
Sonnet 5 $0.00005 $0.00377
Haiku 4.5 $0.00003 $0.00188

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

Security

Grade A, and why

gaia-patterns 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 7d 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/gaia-patterns/SKILL.md · 125 lines

How it starts

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

Gaia Code Patterns

Construction patterns for building Gaia components. Every component type follows a discoverable pattern -- read 2-3 existing examples before creating a new one. For the full component inventory, see reference.md.

Prompt -> Result Flow

1. User sends prompt
   |
2. Orchestrator routes to agent (DB-backed surface_routing table --
   the routing is the ORCHESTRATOR's reasoning; it is never injected
   into the subagent)
   |
3. Pre-Tool Hook (pre_tool_use.py)
   +-- Validate the Task/Agent dispatch (agent exists, T3 scan of the
       prompt via TaskValidator) -- no frontmatter read, no skill load
   +-- Birth the agent_contract_handoffs row (identity, kernel data,
       dispatch_project resolved from cwd)
   |
   (for a dispatched SUBAGENT only: the HOST -- Claude Code, not this
   hook or any other Gaia hook -- separately reads the target agent's
   `.md` frontmatter and preloads its `skills:` list before the first
   turn. `hooks/hooks.json` carries no `Skill` matcher, so a
   `Skill(...)` call never reaches PreToolUse either -- see
   `artifact_skill_reminder.py`. The primary agent has no equivalent:
   Claude Code's own docs list only "system prompt, tool restrictions,
   and model" as inherited on the main thread, which is why
   `gaia-orchestrator.md`'s frontmatter carries no `skills:` field.)
   |
4. SubagentStart hook claims the born row and injects the KERNEL:
   "# Your Contract" (incl. project + can_read/can_write menu),
   "# Your CLI", "# What I know about you". Project context is NOT
   preloaded -- the agent pulls sections on demand, with the verbs in
   agent-protocol/read-map.md, within its can_read menu.
   |
5. Agent checkpoints/finalizes its agent_contract_handoffs row via
   `gaia contract`; the final message carries no envelope
   |
6. Post-Tool Hook -> audit + metrics
   |
7. Orchestrator processes agent_state; only COMPLETE is terminal

Hook Patterns

Entry points (hooks/*.py) are stdin/stdout glue only. All logic lives in the adapter layer.

Read the full file on GitHub · 125 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 7d ago First seen · 125 lines · 25 tokens per session scan A bab3cec65957

Subscribe to this mod's changes

gaia-patterns is a skill published in the GitHub repository metraton/gaia (3 stars, last pushed today), licensed MIT. It adds 25 tokens to every session and 1,885 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