groundtruth-setup

groundtruth-setup is a command for coding agents from akahkhanna/groundtruth. It costs 20 tokens per session (3,690 once invoked), scanned D, original, MIT.

A one-time setup checker for the Groundtruth coding-agent plugin. It detects which settings are already configured and shows exact actions for anything missing.

In plain words
What is it for?
Checking the status line, environment variables, local settings, and Groundtruth rules before use.
Why use it?
It removes the guesswork from setup while leaving changes that require the user under their control.

Command

Part of the groundtruth plugin — 7 commands, 5 hooks shipped together

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/akahkhanna/groundtruth/groundtruth-setup
Clone the repo
git clone --depth 1 https://github.com/akahkhanna/groundtruth

Or install groundtruth, the plugin that ships this one along with the rest of its 7 commands, 5 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 groundtruth-setup

README.md
[![agentmods](https://agentmods.dev/badge/commands/akahkhanna/groundtruth/groundtruth-setup.svg)](https://agentmods.dev/commands/akahkhanna/groundtruth/groundtruth-setup)
Your own site
<a href="https://agentmods.dev/commands/akahkhanna/groundtruth/groundtruth-setup"><img src="https://agentmods.dev/badge/commands/akahkhanna/groundtruth/groundtruth-setup.svg" alt="Measured on agentmods" height="20"></a>
Per session 20 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 3,690 The whole file, excluding the scripts and references it only reads on demand.
Security scan D 2 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.00020 $0.03690
Opus 5 $0.00010 $0.01845
Sonnet 5 $0.00004 $0.00738
Haiku 4.5 $0.00002 $0.00369

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

Security

Grade D, and why

groundtruth-setup scanned grade D with 2 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.

Harvests environment variableshighData exfiltration

Enumerating or grepping the environment for keys collects credentials unrelated to what the mod says it does.

4. **Integrity key** (optional, security-critical only). Run `printenv GROUNDTRUTH_KEY` to detect.

Reads agent configuration directoriesmediumAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

- the **plugin hooks dir**: find the newest `*/hooks/groundtruth-statusline.mjs` under `~/.claude/plugins/cache/groundtruth/groundtruth/` (use the highest version). Call it `<HOOKS>`. If you can't find it, fall back to t
commands/groundtruth-setup.md · 73 lines

How it starts

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

You are running the Groundtruth setup check. Some things a Claude Code plugin cannot set itself — the main statusLine and any env var — so this command DETECTS the current state and gives the user the exact, copy-pasteable action for anything missing. Be concise: a 5-line checklist (✓ / ✗ + the one-line fix), then a one-line summary. This command is the single point for rules — the things it DOES execute, each only after the user says yes, are (a) arming clean literal rules in warn (item 1), (b) running the AI prose pass /groundtruth-rules-ai and arming its clean proposals (item 1, only when rule-docs exist), and (c) the settings.local.json badge/block wiring (the closing offer — it does NOT write an integrity key, item 4). Everything else you DETECT and hand back the fix; for settings.local.json edits SHOW the user the block to paste (it's their file). Never enable block mode or arm a review-status rule on your own.

First, resolve two paths you'll need:

  • the project root = the cwd.
  • the plugin hooks dir: find the newest */hooks/groundtruth-statusline.mjs under ~/.claude/plugins/cache/groundtruth/groundtruth/ (use the highest version). Call it <HOOKS>. If you can't find it, fall back to telling the user to point at their groundtruth checkout's hooks/.

Then check each item and report /:

  1. Rules — arm the clean ones inline (this command is the installer; don't punt to /groundtruth-rules). Read .claude/groundtruth/proposed-rules.json and compiled-rules.json. Count clean-proposed (status:"armable", not already armed) vs any that status:"review" (already match committed code — over-broad risk).
    • If clean rules are unarmed → show the count and ask before arming: "Found N clean rules extracted from your docs (they match zero existing code, so they can only fire on new code). Arm them in warn now? [yes / review each / skip]." This is safe because arming in warn only adds a line to the verdict card — it never blocks — and each firing prints its [id] so you can /groundtruth-rules unarm <id> in one step. Warn ≠ enforce; block stays a separate, deliberate step (item 3).
      • yes → arm exactly the clean candidates: write .claude/groundtruth/compiled-rules.json as the union of already-approved + newly-approved, keeping only runtime fields (id, source, kind, file_re, line_re, severity, message, unless_re if present), severity defaulting to "warn", preserving any existing rule's severity, deduped by id. (This write is legitimate — /groundtruth-setup is a ratified writer of compiled-rules.json, same as /groundtruth-rules.) Confirm: "Armed N rules at warn — active next turn."
      • review each → hand off to /groundtruth-rules (the ledger) for a rule-by-rule look; arm nothing here.
      • skip → arm nothing; note it stays available via /groundtruth-rules approve-all later.
    • Never arm a status:"review" candidate here — those match existing code and need a human eye in /groundtruth-rules. Surface their count as a heads-up.
    • If proposed-rules.json is missing, init hasn't run: say "start a fresh session, or run node \"<HOOKS>/compile-rules.mjs\" .".
    • Richer rules from prose (/groundtruth-rules-ai) — this command is the single point, so OFFER TO RUN it here; gate the offer ONLY on whether rule-docs exist. The deterministic extractor only catches rules written in the literal use `X` not `Y` / never `X` forms; rules written as prose sentences need the model pass. Decide by doc PRESENCE, not by candidate count (finding N literal rules does NOT mean every prose rule was caught — a doc-heavy repo with 26 literal hits can still have many prose rules the literal pass can't see):
      • Check for ANY rule-docs: CLAUDE.md, AGENTS.md, **/SCHEMA.md, **/ARCHITECTURE.md, docs/*.md, .claude/skills/**/SKILL.md, .claude/agents/*.md, .cursorrules, .windsurfrules (parity with the engine's RULE_SRC_RE).
      • If there are NONE → do NOT offer the AI pass (there is nothing for it to read; say so in one line and move on). This is the only skip condition.
      • If any exist → OFFER to run it, regardless of how many literal rules were found. Say plainly what it does before running: "Your repo has prose rule-docs (CLAUDE.md, …) — the literal pass can't see rules written as sentences. Run the AI pass? It fans out an agent ONCE, only to draft rule candidates from those docs — the one and only place Groundtruth uses an LLM. It just proposes: nothing arms until you approve, and after that no model is ever called again — every per-turn audit stays fully deterministic + offline. [yes / skip]." (This transparency is required — the user must know it's a one-time, propose-only agent pass, not ongoing LLM use.)
        • yes → invoke /groundtruth-rules-ai inline; when it returns proposals, arm the clean (status:"armable") ones the SAME way as the literal candidates above (warn, review-status excluded). One flow — literal-arm + AI-propose + approve, all here; do not send the user to separate commands.
        • skip → note it stays available as /groundtruth-rules-ai later.

Read the full file on GitHub · 73 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 · 73 lines · 20 tokens per session scan D ff61d34e1374

Subscribe to this mod's changes

groundtruth-setup is a command published in the GitHub repository akahkhanna/groundtruth (6 stars, last pushed 1mo ago), licensed MIT. It adds 20 tokens to every session and 3,690 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it D with 2 findings (harvests environment variables, reads agent configuration directories). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.