anchor

A command that checks whether project documents match the repository's actual Git history. Git is the system that records code changes over time, and an anchor commit is a specific recorded version used for comparison.

In plain words
What is it for?
Use it to verify phase documents against repository commits. It requires a Git repository with at least one commit and project phase folders under docs/.
Why use it?
It helps detect documents that describe code from the wrong version or claim a state that was never committed. It can check the whole project or one project phase.

Command

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/jonase47/ccpr/anchor
Clone the repo
git clone --depth 1 https://github.com/jonase47/ccpr
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,674 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 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.00000 $0.02674
Opus 5 $0.00000 $0.01337
Sonnet 5 $0.00000 $0.00535
Haiku 4.5 $0.00000 $0.00267

Measured yesterday against content hash 539b0fa50b24, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

anchor 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 yesterday.

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/anchor.md · 204 lines

How it starts

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

/anchor – Anchored State Verification (Docs vs. Implementation)

Checks phase documents against the code they describe, not against other documents. Where /cross-check compares Markdown to Markdown, /anchor compares a document's declared anchor_commit to the repository's actual history — the two-stage check design of docs/adr/ADR-0009-anchored-state-verification.md (both addenda).

Argument: $ARGUMENTS = [optional: projectdir] [--scope ]

  • Without argument: operates on $(pwd).
  • --scope <folder> restricts the run to one phase folder (discovery, concept, validation, architecture, planning, quality, launch, operations).

Prerequisites

  • A git repository with at least one commit.
  • At least one phase folder under docs/ (discovery/, concept/, validation/, architecture/, planning/, quality/, launch/, operations/).
  • Not required, but the reason a run reports mostly "not verified": an anchor written on the phase index via anchor set (normally done by the freeze hook on a Gate-Go, ADR-0009 Addendum 2).

Lead Agent

Orchestrator runs Stage 1 directly (a mechanical script call, nothing to delegate). Stage 2's per-document judgment can be done by the orchestrator or delegated to code-reviewer / system-architekt for a scope with unfamiliar code — in either case, the agent doing Stage 2 is bound by The agent clause below (§3 is the escalation step, not the clause).

Execution

1. Stage 1 — mechanical delta (no verdict)

Run exactly:

bash ~/.claude/scripts/anchor.sh check [projectdir] [--scope <folder>]

This is the only source for Stage 1 data — do not re-derive the delta by hand (e.g. git diff against a guessed commit). The report already contains, per scope: the resolved anchor_commit/anchor_date, the last production-code commit, the changed production-code paths, which document(s) claim each path via covers:, and the full "Affected documents" list per scope with each document's own status.

Read the full file on GitHub · 204 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. yesterday First seen · 204 lines · 0 tokens per session scan A 539b0fa50b24

Subscribe to this mod's changes

anchor is a command published in the GitHub repository jonase47/ccpr (1 stars, last pushed 2d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 2,674 tokens. 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-31.