gaia: Command for Claude Code

.claude/commands/gaia-residue.md

gaia-residue is a command for Claude Code from gaia-react/gaia. It costs 53 tokens per session (393 once invoked), scanned A, original, MIT.

A repository audit workflow that reads merged pull-request bodies for recorded code issues and decides what to do with each one. It can list candidates, explain a cited code location, or review all candidates.

In plain words
What is it for?
Use it to review unresolved audit notes, trace each note to its file and line, and publish the resulting decisions as a branch and pull request.
Why use it?
It turns scattered notes from completed code changes into explicit decisions without silently changing code. Each item is promoted to a technical-debt issue, dismissed, or kept for later.

Command for Claude Code

Written for Claude Code: disable-model-invocation in frontmatter. Also seen: reads .claude/ paths.

This is gaia-react/gaia's own configuration. It tells Claude Code how to work on gaia itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything gaia configures →

Reuse

Borrowing it

Nothing to install: this file belongs to gaia-react/gaia. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/gaia-react/gaia/main/.claude/commands/gaia-residue.md
Clone the repo
git clone --depth 1 https://github.com/gaia-react/gaia

Made for: Claude Code.

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-residue

README.md
[![agentmods](https://agentmods.dev/badge/commands/gaia-react/gaia/gaia-residue/github.svg)](https://agentmods.dev/commands/gaia-react/gaia/gaia-residue)
Your own site
<a href="https://agentmods.dev/commands/gaia-react/gaia/gaia-residue"><img src="https://agentmods.dev/badge/commands/gaia-react/gaia/gaia-residue/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 gaia-residue

Your own site · 80×15
<a href="https://agentmods.dev/commands/gaia-react/gaia/gaia-residue"><img src="https://agentmods.dev/badge/commands/gaia-react/gaia/gaia-residue.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 53 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 393 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.00053 $0.00393
Opus 5.5 $0.00021 $0.00157
Sonnet 5.5 $0.00011 $0.00079
Haiku 4.5 $0.00005 $0.00039

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

Security

Grade A, and why

gaia-residue 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 10d 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.

.claude/commands/gaia-residue.md · 30 lines

What it actually says

Run the GAIA residue workflow.

Pre-flight: Worktree check

This command publishes a branch and a pull request from a repo-wide read of every merged pull request. It starts from the main checkout and isolates its own work right before its first write, through .claude/skills/gaia/references/isolation.md, so it never writes onto the branch the checkout holds. A linked worktree holds someone else's work, so if invoked from one, reject hard: gaia_refuse_if_worktree (.gaia/scripts/main-only-lib.sh) asks the shared resolver which tree this is and refuses out loud, naming the main checkout, when the answer is a worktree.

Detection (run this first, before anything else):

. .gaia/scripts/main-only-lib.sh
gaia_refuse_if_worktree "/gaia-residue" || exit 1

Anchor for the next pre-flight step: a check that must pass before this command starts goes here, after the worktree check and before the workflow dispatch line.

. .gaia/scripts/main-only-lib.sh
gaia_pull_gate "/gaia-residue"

On a non-zero exit, read .claude/skills/update-gaia/references/pull-gate.md and follow it with /gaia-residue, this run's original arguments and the exit code, before anything below creates a branch, worktree, claim or SPEC id.

Read .claude/skills/gaia/references/residue.md from the project root and follow it exactly.

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. 10d ago Changed · -2 lines 221ce1f7643b
  2. 11d ago Changed · +9 lines d49463c9c52f
  3. 14d ago Changed · -1 lines e95d54a477dc
  4. 21d ago Changed · +1 lines · -22 tokens per session 09996f6f543a
  5. 1mo ago First seen · 23 lines · 75 tokens per session scan A 6e865be9d358

Subscribe to this mod's changes

gaia-residue is a command published in the GitHub repository gaia-react/gaia (26 stars, last pushed 4d ago), licensed MIT. It adds 53 tokens to every session and 393 once invoked, about $0.0002 per session on Opus 5.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-09-14.