refresh

A command for finding repositories whose written knowledge documents no longer match their code, then updating those documents.

In plain words
What is it for?
Use it to compare recorded Git commits with current repositories, review stale or undocumented projects, and refresh their knowledge files. A dry run reports the work without studying repositories.
Why use it?
It helps prevent an AI knowledge base from describing old code or missing repositories.

Command for Claude Code

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/end1989/repos-expert/refresh
Clone the repo
git clone --depth 1 https://github.com/end1989/repos-expert

Made for: Claude Code.

Per session 11 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 456 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.00011 $0.00456
Opus 5 $0.00005 $0.00228
Sonnet 5 $0.00002 $0.00091
Haiku 4.5 $0.00001 $0.00046

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

Security

Grade A, and why

refresh 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 2d 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.

agent-kit/.claude/commands/refresh.md · 43 lines

What it actually says

Bring the knowledge base back in line with the code.

1. Survey. For every directory in this folder containing a .git:

git -C <repo> rev-parse HEAD

Compare against _knowledge/<repo>/meta.json's sha. Sort every repo into:

  • fresh — SHAs match. Nothing to do.
  • stale — SHAs differ. The code moved since the docs were written.
  • undocumented — no _knowledge/<repo>/ at all.

2. Report before spending anything. Print the three lists with counts, and for stale repos show how far behind they are:

git -C <repo> log --oneline <meta.sha>..HEAD | wc -l

Studying a repo takes a few minutes of model time each. Say how many are involved. If the user passed --dry-run, stop here — that is the whole point of the flag.

3. Ask before a large batch. If more than 5 repos would be studied, ask first and wait. Below that, go ahead.

4. Restudy the stale ones using the same procedure as /study: gather git context, launch curator subagents concurrently, accept only the five allowed filenames, write meta.json with the SHA you read in step 1.

Pass the previous docs and the <meta.sha>..HEAD change log to each curator and tell it to update, not rewrite — the point of a refresh is to revise what moved, not to lose insight that is still true.

Do not automatically study undocumented repos. A folder can gain a repo without anyone intending a multi-minute study of it. List them and let the user ask for /study <name>.

5. Offer the map. If anything changed, cross-repo-map.md may now be wrong too — offer /map, don't run it unprompted.

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. 2d ago First seen · 43 lines · 11 tokens per session scan A ad6d0f8ae6f6

Subscribe to this mod's changes

refresh is a command published in the GitHub repository end1989/repos-expert (0 stars, last pushed 2d ago), licensed MIT. It adds 11 tokens to every session and 456 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-08-31.