setup-gaia

A repeatable setup command for a GAIA project, covering the tools, repository, continuous integration, and developer merge-check choices needed after initialization. It detects what is already done and runs only the remaining setup work.

In plain words
What is it for?
Use it after project initialization to install local tools, configure the GitHub repository and CI, choose audit mode, or reconfigure an existing setup.
Why use it?
It avoids repeated provisioning and makes it safe to resume or rerun project onboarding; a reconfigure option handles token rotation and tool selection changes.

Command for Claude Code

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.

agentmods
npx agentmods add commands/gaia-react/gaia/setup-gaia
Clone the repo
git clone --depth 1 https://github.com/gaia-react/gaia

Made for: Claude Code.

Per session 34 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 19,258 The whole file, excluding the scripts and references it only reads on demand.
Security scan E 3 findings. Scan, not verified.
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 $0.00034 $0.19258
Opus 5 $0.00017 $0.09629
Sonnet 5 $0.00007 $0.03852
Haiku 4.5 $0.00003 $0.01926

Measured 3d ago against content hash ceea49b0dd8c, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade E, and why

setup-gaia scanned grade E with 3 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 3d 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.

Downloads and executes remote codehighSupply chain

curl | sh runs whatever the server returns today, which is not necessarily what it returned when this was reviewed.

curl -LsSf https://astral.sh/uv/install.sh | sh

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

rm -rf .agents/skills/react-doctor

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

> The minimal seed itself only adds the registry host to `allowedDomains` and, when docker is present, a `docker *` exclusion. It still leaves `gh`/git-over-https, `uvx`, `curl`, and claude plugin installs BLOCKED until
.claude/commands/setup-gaia.md · 1,188 lines

How it starts

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

Run this once after /gaia-init, and re-run it any time. /setup-gaia is the single onboarding command for a GAIA project. It detects the situation and runs only the phases this clone actually owes:

  • Per-machine work every clone needs (tool installs, plugins, spec-kit runtime, statusline bit, .env).
  • GitHub repository provisioning (create / adopt / manual, private by default).
  • CI wiring when a repo exists and the runner is a repo admin.
  • Your per-developer audit-mode choice (CI vs local at merge time).

It is safe for any developer to run at any time. A plain (no-flag) re-run on a fully provisioned project prints the already-configured line and mutates nothing: it never re-provisions the repo, rotates the token, or changes branch protection. Pass --reconfigure to rotate the bot token and re-select which tools run on cron.

The slash command name intentionally does NOT start with gaia- so it does not pollute the /gaia autocomplete namespace (those are reserved for the four user-invoked GAIA workflows).

Pre-flight: Worktree check

This command does per-machine and per-clone provisioning, writes .gaia/local/setup-state.json, and provisions the GitHub repository. If invoked from a linked worktree, 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 "/setup-gaia" || exit 1

If the detection does not fire, fall through to ## Argument parse below.

Argument parse

Parse $ARGUMENTS for the --reconfigure flag. Cache the boolean as RECONFIGURE.

Phase 0: Prerequisites (every invocation, never skipped)

These run on every invocation and record no setup-state step. They sit outside the per-machine skip gate.

0a. Self-heal worktree symlinks

If this clone is being set up from a linked worktree (e.g. one created via git worktree add outside the Claude Code harness), the shared-state links that .gaia/scripts/link-worktree.sh creates may not exist yet: one symlink at .gaia/local pointing at the main checkout's, plus a link for each gitignored root .env file the main checkout holds. Run the self-heal:

Read the full file on GitHub · 1,188 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. 3d ago First seen · 1,188 lines · 34 tokens per session scan E ceea49b0dd8c

Subscribe to this mod's changes

setup-gaia is a command published in the GitHub repository gaia-react/gaia (22 stars, last pushed 3d ago), licensed MIT. It adds 34 tokens to every session and 19,258 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it E with 3 findings (downloads and executes remote code, recursive force delete, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.