gc

gc is a command for Claude Code from Redtropig/harness-anchor. It costs 72 tokens per session (780 once invoked), scanned A, original, MIT.

A read-only command that scans recently changed or active code for drift from project rules and conventions. Drift includes dead code, duplicated helpers, inconsistent error handling, outdated documentation, and other code that still works but no longer fits the project.

In plain words
What is it for?
Use /gc to review a recent change or feature, compare it with golden-rules.md and general code-quality checks, and receive an evidence-based report of recommended fixes.
Why use it?
It finds maintenance problems that ordinary compilation and tests may miss. A fresh analysis context reduces the chance that the same agent that wrote the code overlooks its inconsistencies, while the report leaves changes under human control.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: mentions subagents.

Part of the harness-anchor plugin — 14 skills, 9 commands, 5 agents, 5 hooks shipped together

Good fit Use /gc to review a recent change or feature, compare it with golden-rules.md and general code-quality checks, and receive an evidence-based report of recommended fixes.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/redtropig/harness-anchor/gc
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/Redtropig/harness-anchor

Made for: Claude Code.

Or install harness-anchor, the plugin that ships this one along with the rest of its 14 skills, 9 commands, 5 agents, 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 gc

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

Your own site · 80×15
<a href="https://agentmods.dev/commands/redtropig/harness-anchor/gc"><img src="https://agentmods.dev/badge/commands/redtropig/harness-anchor/gc.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 72 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 780 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.00072 $0.00780
Opus 5.5 $0.00029 $0.00312
Sonnet 5.5 $0.00014 $0.00156
Haiku 4.5 $0.00007 $0.00078

Measured 1mo ago against content hash 8de5a5baa65c, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

gc 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 1mo 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.

commands/gc.md · 63 lines

How it starts

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

/gc

Scan recent work for drift / entropy / AI slop — code that compiles and passes tests but has rotted away from the project's conventions: duplicated helpers, dead code, inconsistent error handling, stale docs, golden-rule violations. This is the garbage-collection sensor (Concept ⑥) — not git gc.

Like /verify and /test-plan, it uses a fresh-context subagent so the scan isn't biased by the agent that wrote the code. It is report-only — it never refactors in bulk.

Steps

  1. Dispatch drift-analyst via the Task tool:

    Task tool with:
      subagent_type: drift-analyst
      prompt: Scan the changed/active code for drift against golden-rules.md plus the generic drift
              heuristics. Bound the scope to changed files (git diff vs HEAD) or the active feature —
              plus the one deliberate doc-drift exception: an unchanged *.md file still enters scope
              when it mentions a symbol this change touched. Follow the fixed report format.
              Read-only — recommend, do not refactor.
    

    If the user passed a path or feature id as an argument, name it in the prompt.

  2. Surface the report verbatim — ### Golden-rule violations, ### Generic drift findings, ### Recommended actions, ### Verdict, ### Uncertainties. The point of fresh-context analysis is that the user sees the analyst's actual words.

  3. If verdict is DRIFT FOUND, offer (do not auto-apply):

    • Fix specific findings within the current feature's scope — transparently (show each change), highest-severity first. Do NOT bulk-refactor or wander outside the active feature (that's a scope-jump — confirm first).
    • Capture a recurring finding as a golden rule via the capturing-golden-rules skill, so /gc catches it automatically next time.
    • Leave as-is and note it in session-handoff.md (e.g. deliberate debt to pay later).
  4. If verdict is CLEAN, report it with the .harness-anchor/drift-<ts>.md evidence path. Note that a clean scan is a floor, not a guarantee (the heuristics are partial).

Read the full file on GitHub · 63 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. 1mo ago First seen · 63 lines · 72 tokens per session scan A 8de5a5baa65c

Subscribe to this mod's changes

gc is a command published in the GitHub repository Redtropig/harness-anchor (13 stars, last pushed 2mo ago), licensed MIT. It adds 72 tokens to every session and 780 once invoked, about $0.0003 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-08-30.

Related

Other commands, from other repositories

review-pr

PR review using parallel specialized agents for code quality, security, testing, architecture, and performance analysis. Synthesizes findings into a review report with conventional comments (praise/issue/suggestion/nitpick) and approve or request-changes verdict. Use when reviewing pull requests, conducting security…

yonatangross/orchestkit · 69 tokens

assess

Assesses and rates quality 0-10 across multiple dimensions (correctness, maintainability, security, performance, testability, simplicity) with pros/cons analysis. Compares against project conventions and prior decisions from memory. Produces structured evaluation reports with actionable improvement suggestions. Use…

yonatangross/orchestkit · 72 tokens

iterate-plan

Revises a plan written by create-plan from its review comments or new instructions: rewrites the plan body, leaves each comment intact and bumps the revision. Use when a plan file got feedback or its scope changed; never to start a new plan.

yonatangross/orchestkit · 54 tokens

review-artifact-comments

Works through the review comments written into a task artifact (plan or research under .ork/tasks/TASK/): lists the open ones, asks how to proceed, then replies, resolves or hands off to iterate-plan or iterate-research, and approves the artifact once nothing is open. Use when a reviewer has commented on an artifact…

yonatangross/orchestkit · 82 tokens

review

Run when user calls /review. Analyzes local changes and runs a comprehensive code review using the agent-reviewer prompt.

guanyang/open-agent-hub · 27 tokens

iterate-research

Re-checks the code behind a research file from create-research when a reviewer challenges a claim or the question widens, then revises its findings with fresh file:line citations, comments intact. Use after review comments on research; stays descriptive.

yonatangross/orchestkit · 54 tokens