keystone: Command for Claude Code

.claude/commands/keystone-audit.md

keystone-audit is a command for Claude Code from tacoda/keystone. It costs 7 tokens per session (777 once invoked), scanned A, a copy of audit, MIT.

A periodic project audit command covering two activities: learning from past reviews and removing outdated Charter rules, guides, and setup entries.

In plain words
What is it for?
Use it to inspect learning candidates, review recent commits, record recurring lessons, and identify stale rules, dead idioms, placeholders, failing checks, and drifted project state.
Why use it?
It helps keep the project's documented practices current instead of allowing stale or unused guidance to accumulate.

Command for Claude Code

Written for Claude Code: installed under .claude/.

This is tacoda/keystone's own configuration. It tells Claude Code how to work on keystone itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything keystone configures →

Reuse

Borrowing it

Nothing to install: this file belongs to tacoda/keystone. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/tacoda/keystone/main/.claude/commands/keystone-audit.md
Clone the repo
git clone --depth 1 https://github.com/tacoda/keystone

Made for: Claude Code.

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 keystone-audit

README.md
[![agentmods](https://agentmods.dev/badge/commands/tacoda/keystone/keystone-audit.svg)](https://agentmods.dev/commands/tacoda/keystone/keystone-audit)
Your own site
<a href="https://agentmods.dev/commands/tacoda/keystone/keystone-audit"><img src="https://agentmods.dev/badge/commands/tacoda/keystone/keystone-audit.svg" alt="Measured on agentmods" height="20"></a>
Per session 7 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 777 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 98% copy Near-identical to another mod 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.00007 $0.00777
Opus 5 $0.00003 $0.00388
Sonnet 5 $0.00001 $0.00155
Haiku 4.5 $0.00001 $0.00078

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

Security

Grade A, and why

keystone-audit 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.

Origin

This is a copy

98% identical to audit — 4 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

.claude/commands/keystone-audit.md · 45 lines

How it starts

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

audit

Full dual-flywheel audit. Learning (capture from review) and Pruning (remove dead rules). Periodic. Read .charter/README.md (flywheels section) and .charter/learning/README.md.

Learning flywheel

  1. Walk .charter/learning/inbox/ and flag candidates that should be promoted.
  2. Run review sensors on recent commits — surface patterns that should become guides.
  3. Capture findings as new inbox entries (see learn.md).

Pruning flywheel

The Pruning flywheel reads the charter-debt sensor and proposes the diff to .charter/corpus/state/charter-debt.md. Categories the sensor surfaces:

  1. Stale rules — guides in .charter/guides/ that no diff has touched in N months.
  2. Dead idioms — idiom dirs whose stack is no longer in CODEBASE_STATE.md.
  3. Placeholders — bootstrap <...> markers left unfilled.
  4. Failing sensors — sensors recorded as available that error on invocation.
  5. Empty shells — scaffolded dirs with no real content.
  6. Uncited policies — installed policies whose guides were never referenced.
  7. Unresolved gaps.charter/adapters/<agent>/<topic>.md TODO placeholders.
  8. Drifted statestack-drift findings + CODEBASE_STATE.md stale-last_reconciled.
  9. Strict-cascade violations — run keystone policy verify; any strict-violation output is a hard debt entry. A project file at .charter/<kind>/<name>.md is overriding a strict item from a team or org policy. Remove the shadowing file or escalate to the policy owner.
  10. Required-item gaps — same keystone policy verify run. Required items with no definition anywhere in the cascade are advisory debt: the project is expected to define them at .charter/<kind>/<name>.md. Pruning surfaces them; the project decides which to fill in.

Then update the empirical state files:

  1. Risk fingerprint — read .charter/sensors/risk-fingerprint.md and update .charter/corpus/state/risk-fingerprints.md.
  2. Traffic topology — read .charter/sensors/traffic-topology.md and update .charter/corpus/state/traffic-topology.md.

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

Subscribe to this mod's changes

keystone-audit is a command published in the GitHub repository tacoda/keystone (44 stars, last pushed 2mo ago), licensed MIT. It adds 7 tokens to every session and 777 once invoked, about $0.0000 per session on Opus 5. A static security scan graded it A with 0 findings. It is 98% identical to audit, differing in 4 lines, and is treated as a copy.