refresh-context-map

refresh-context-map is a skill for Claude Code from Filip-Podstavec/claude-leverage. It costs 75 tokens per session (1,126 once invoked), scanned A, original, MIT.

A command that rebuilds a repository manifest used by a hook to surface relevant project context, such as guidance and architecture records.

In plain words
What is it for?
Use it after significant refactors or changes to AGENTS.md files, AIDEV notes, or architecture decision records.
Why use it?
It prevents that manifest from becoming outdated after files, notes, directory instructions, or architecture records change.

Skill for Claude Code

Written for Claude Code: ${CLAUDE_PLUGIN_ROOT} variable. Also seen: mentions AGENTS.md.

Runs only inside its plugin — its command needs a path that Claude Code sets for a plugin’s own hooks and for nothing else. Install the plugin, not this.

Part of the claude-leverage plugin — 16 skills, 5 commands, 14 agents, 4 hooks shipped together

Install

Getting it into your agent

This one installs as part of its plugin. Adding the marketplace and installing the plugin brings it with everything else the plugin ships.

Claude Code
/plugin marketplace add Filip-Podstavec/claude-leverage
Claude Code
/plugin install claude-leverage

Made for: Claude Code.

Or install claude-leverage, the plugin that ships this one along with the rest of its 16 skills, 5 commands, 14 agents, 4 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 refresh-context-map

README.md
[![agentmods](https://agentmods.dev/badge/skills/filip-podstavec/claude-leverage/refresh-context-map.svg)](https://agentmods.dev/skills/filip-podstavec/claude-leverage/refresh-context-map)
Your own site
<a href="https://agentmods.dev/skills/filip-podstavec/claude-leverage/refresh-context-map"><img src="https://agentmods.dev/badge/skills/filip-podstavec/claude-leverage/refresh-context-map.svg" alt="Measured on agentmods" height="20"></a>
Per session 75 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,126 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.1 $0.00075 $0.01126
Opus 5 $0.00037 $0.00563
Sonnet 5 $0.00015 $0.00225
Haiku 4.5 $0.00007 $0.00113

Measured 6d ago against content hash 5f042d7ecde6, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

refresh-context-map 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 6d 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.

skills/refresh-context-map/SKILL.md · 105 lines

How it starts

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

refresh-context-map

Rebuild the smart-context-surface manifest used by the PreToolUse hook (scripts/hooks/context-surface.sh). See docs/adr/0008-smart-context-surfacing-via-pretooluse-hook.md for the design rationale.

When to invoke

  • After adding / moving / deleting AIDEV-NOTE / AIDEV-TODO / AIDEV-QUESTION anchors.
  • After adding / removing per-directory AGENTS.md files.
  • After adding new ADRs in docs/adr/ that reference specific source files.
  • After a git merge that touched anchor-bearing files (.gitattributes keeps the local manifest on conflict via merge=ours, but it'll be stale relative to the merged tree until rebuilt).
  • When /stack-check flags drift between the manifest and git ls-files.
  • Once per significant refactor that moved a lot of files.

When NOT to invoke

  • On every commit — opt-in pre-commit hook (.githooks/) does it automatically if enabled. If you've enabled it, manual /refresh-context-map is redundant.
  • When you have not adopted the smart-context-surfacing stack in this repo (no .claude-leverage-context-map.json present means the PreToolUse hook silently no-ops — nothing to refresh).

What it does

Runs:

python ${CLAUDE_PLUGIN_ROOT}/scripts/build-context-map.py

from the repo root. The script:

  1. Walks every git-tracked file (via git ls-files), skipping binaries (NUL-byte sniff).
  2. For each file with AIDEV-* anchors, indexes:
    • Anchors inside the file
    • Anchors in sibling files (same directory)
    • The chain of AGENTS.md from dirname(file) to repo root
    • ADR files (docs/adr/*.md) that mention this file path verbatim (word-boundary match)
  3. Writes .claude-leverage-context-map.json at the repo root, atomically (.tmp + rename).

The PreToolUse hook reads this manifest on every Read/Edit/Write/MultiEdit and injects a per-file context slice via hookSpecificOutput.additionalContext.

Read the full file on GitHub · 105 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. 6d ago First seen · 105 lines · 75 tokens per session scan A 5f042d7ecde6

Subscribe to this mod's changes

refresh-context-map is a skill published in the GitHub repository Filip-Podstavec/claude-leverage (68 stars, last pushed 1mo ago), licensed MIT. It adds 75 tokens to every session and 1,126 once invoked, about $0.0004 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-30.

Related

Other skills, from other repositories

cdb-scan

Map this codebase into project memory — a code graph of every symbol and how they connect, plus a written profile of stack, layout, conventions and workflows. Re-run any time to refresh both in place. Use when memory is newly installed on an existing project, or when the project has changed enough that the stored map…

Avijit07x/claude-db · 72 tokens

resume

Load a previous session from TokenMizer graph memory. Returns a compact context block (100-600 tokens) covering goals, completed work, decisions, open tasks, and files. Inject this as system context to continue exactly where you left off. Use when user says "resume", "continue from last time", "load my project", "what…

Shweta-Mishra-ai/tokenmizer · 86 tokens

checkpoint

Save the current session to TokenMizer graph memory. Creates a persistent checkpoint with all tasks, decisions, files, and errors — resumable in any future session. Use when user says "save", "checkpoint", "remember this", "I'm done for today", or session is getting long.

Shweta-Mishra-ai/tokenmizer · 61 tokens

pickup

Resume work on this project after an interruption or at the start of a new session: show recent wins, what was being done, the next action, and open decisions, in that order, then stop. Trigger only on an explicit /squirrel:pickup invocation, or an explicit request to resume or pick up this project's past work at the…

thgMatajs/squirrel-mode · 124 tokens

stash

Record one durable memory in the user's cross-project hoard: a correction, a decision with its reasoning, a bug and its fix, or a fact worth keeping. Only for an explicit /squirrel:stash invocation.

thgMatajs/squirrel-mode · 44 tokens

claude-bridge-role-memory-keeper

Playbook for a Claude Code agent in the dedicated memory keeper role — single-writer for shared agent memory across a team of 3+ peers. Use when you are designated as the keeper (= other peers send you write candidates, you write them and watch for drift). Memory hygiene + reconciliation against the canon + drift…

michalekz/claude-bridge · 102 tokens