apply

apply is a command for Claude Code from alphabravo-oss/guild. It costs 10 tokens per session (685 once invoked), scanned A, original, MIT.

A command that applies high-confidence cleanup changes found by an earlier Tidy dry run.

In plain words
What is it for?
Use it to apply approved cleanup findings from a saved Tidy run after checking the run state and Git working tree.
Why use it?
It prevents uncertain or unreviewed changes from being applied and checks that the code has not changed since the inspection.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: names the AskUserQuestion tool.

Part of the tidy plugin — 2 commands, 8 agents shipped together

Good fit Use it to apply approved cleanup findings from a saved Tidy run after checking the run state and Git working tree.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/alphabravo-oss/guild/apply
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.

Clone the repo
git clone --depth 1 https://github.com/alphabravo-oss/guild

Made for: Claude Code.

Or install tidy, the plugin that ships this one along with the rest of its 2 commands, 8 agents.

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 apply

README.md
[![agentmods](https://agentmods.dev/badge/commands/alphabravo-oss/guild/apply.svg)](https://agentmods.dev/commands/alphabravo-oss/guild/apply)
Your own site
<a href="https://agentmods.dev/commands/alphabravo-oss/guild/apply"><img src="https://agentmods.dev/badge/commands/alphabravo-oss/guild/apply.svg" alt="Measured on agentmods" height="20"></a>
Per session 10 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 685 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.00010 $0.00685
Opus 5 $0.00005 $0.00342
Sonnet 5 $0.00002 $0.00137
Haiku 4.5 $0.00001 $0.00068

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

Security

Grade A, and why

apply 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 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.

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.

plugins/tidy/commands/apply.md · 68 lines

How it starts

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

Tidy Apply

Apply the HIGH-confidence changes from a previous --dry-run invocation.

RUN_ID="$ARGUMENTS"

If $ARGUMENTS is empty, list recent runs with status inspection_complete and ask which to apply.

Steps

  1. Verify .tidy/runs/$RUN_ID/state.json exists. If not, fail with helpful message.

  2. Read state.json. Check status — must be inspection_complete or cancelled_at_review. If anything else, tell user the run is in an unexpected state (point them at the run dir).

  3. Verify the working tree is still clean:

git status --porcelain

If dirty: refuse, instruct user to stash/commit/branch first.

  1. Verify the pre_tidy_sha is still reachable (in case they merged or rebased):
git rev-parse "$PRE_TIDY_SHA" >/dev/null 2>&1

If not, the historical baseline is gone — tell the user the run cannot be applied because the baseline was rewritten. Suggest re-running /tidy:run --apply fresh.

  1. Read each track's assessment.md. Present a brief summary to the user:
Tidy run <RUN_ID> inspection found:
- HIGH-confidence (will apply): <X> total across N tracks
- MEDIUM-confidence (will skip — needs review): <Y>
- LOW (will skip — flagged): <Z>

Last inspected: <created_at>
Tracks: <list>

Proceed with apply?
  1. Call AskUserQuestion:

    • Apply — proceed
    • Review HIGH list first — render the HIGH-confidence items from each assessment, then re-ask
    • Cancel — stop, no changes made
  2. On Apply: invoke the apply phase from commands/run.md PHASE 4 onward — same logic, same track-application order, same reviewer pass. The orchestrator code in run.md is the canonical implementation; this command is a re-entry point.

  3. Update state.json: mode: "apply", applied_at: "<ISO>".

Rules

  • Same refuse-on-dirty-tree rule as run.md PHASE 0.2.
  • Same track-application order (deprecated-slop → dead-code → dedup → type-consolidate → type-strengthen → error-cleanup → circular-deps).
  • Reviewer pass is mandatory.
  • If the user runs apply on a completed run, refuse. They should run /tidy:run again for a fresh pass.

Read the full file on GitHub · 68 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 · 68 lines · 10 tokens per session scan A dde159c195bd

Subscribe to this mod's changes

apply is a command published in the GitHub repository alphabravo-oss/guild (2 stars, last pushed 5d ago), licensed MIT. It adds 10 tokens to every session and 685 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-09-04.