heimdall

heimdall is a command for Claude Code from ANcpLua/ancplua-claude-plugins. It costs 49 tokens per session (689 once invoked), scanned A, original, MIT.

A command that reports which model served each turn in the current session and whether the serving model changed.

In plain words
What is it for?
Use it to inspect the served model, detect silent model swaps, and view provider, authentication, network, token, and cache details when needed.
Why use it?
It replaces guesses about model routing with evidence from the session transcript and provider information.

Command for Claude Code

Written for Claude Code: ${CLAUDE_PLUGIN_ROOT} variable.

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 heimdall plugin — 1 command shipped together

Good fit Use it to inspect the served model, detect silent model swaps, and view provider, authentication, network, token, and cache details when needed.

Compare 6 commands from other repositories ↓
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 ANcpLua/ancplua-claude-plugins
Claude Code
/plugin install heimdall

Made for: Claude Code.

Or install heimdall, the plugin that ships this one along with the rest of its 1 command.

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 heimdall

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

Your own site · 80×15
<a href="https://agentmods.dev/commands/ancplua/ancplua-claude-plugins/heimdall"><img src="https://agentmods.dev/badge/commands/ancplua/ancplua-claude-plugins/heimdall.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 49 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 689 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.00049 $0.00689
Opus 5.5 $0.00020 $0.00276
Sonnet 5.5 $0.00010 $0.00138
Haiku 4.5 $0.00005 $0.00069

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

Security

Grade A, and why

heimdall 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.

plugins/heimdall/commands/heimdall.md · 55 lines

What it actually says

Run a heimdall watch: tell the user, with evidence, which model has been serving this session and whether it silently swapped.

Do this:

  1. Ground truth — served model per turn. Run the ledger script:

    bash "${CLAUDE_PLUGIN_ROOT}/scripts/model-ledger.sh"
    

    It reads the session transcript's message.model (stamped by the inference server, not the client) and prints per-model turn counts, token usage, the current served model, and any mid-session swaps. If it reports no rows yet, say so plainly — the field populates once turns have completed.

  2. Routing context. Run the provider script:

    bash "${CLAUDE_PLUGIN_ROOT}/scripts/which-provider.sh"
    

    It shows provider (Anthropic-direct / Bedrock / Vertex), auth mode, network path, and the nearest CDN edge. Make clear this locates the user, not the model — the edge airport code says nothing about which model answered.

    If the user asks for more than "which model" — token/cache/cost detail, tier, advisor model, or why a cache miss happened — run the extended read:

    bash "${CLAUDE_PLUGIN_ROOT}/scripts/session-inspect.sh"
    

    It surfaces advisorModel, service_tier, speed, inference_geo, token totals, cache hit rate, and cache-miss reasons with re-charged token counts. Call out actionable findings — e.g. a large tools_changed / messages_changed miss means mid-session tool/MCP toggles or history edits busted the prompt cache; fewer of those → higher cache hit → lower cost.

  3. Report. Lead with the answer: the current served model, and whether it changed this session. If a swap happened, explain the mechanism honestly: each model has its own usage bucket; when the primary (per model in settings) is exhausted or under high demand, the configured fallbackModel serves instead so the session keeps working — the swap is why the served model changed. Then give the two levers: /model to pin/switch, and /usage (or /usage-credits) to see per-model budget and add credits.

Rules:

  • Never guess the model. Only report what message.model shows. If the transcript has no served-model rows yet, say that instead of inferring from latency, config, or a UI banner — those are not evidence.
  • No secrets: the scripts never print API keys or tokens.
  • Keep it tight: the headline is "you are on X (changed/unchanged this session)."

Optional: the plugin also ships a passive model-drift-net Stop hook that surfaces a one-line notice the moment a swap happens, so drift is caught automatically without running this command.

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 · 55 lines · 49 tokens per session scan A ce0bf375eb8d

Subscribe to this mod's changes

heimdall is a command published in the GitHub repository ANcpLua/ancplua-claude-plugins (6 stars, last pushed 3d ago), licensed MIT. It adds 49 tokens to every session and 689 once invoked, about $0.0002 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-10-01.

Related

heimdall compared with commands from other repositories

heimdall next to 6 commands from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
heimdallANcpLua/ancplua-claude-pluginsCommand63d agoMITA49Claude Code
wsdanielmiessler/LifeOSCommand20k7d agoMITA0Claude Code
cancel-ralphanthropics/claude-plugins-officialCommand47kyesterdayApache-2.0A4Claude Code
engage.actionshypnguyen1209/offensive-claudeCommand41921d agoMITA11Claude Code
focusData-Wise/claude-pluginsCommand77d agoMITA0Claude Code
stuckData-Wise/claude-pluginsCommand77d agoMITA0Claude Code
rao92265/claude-code-playbookCommand1323d agoMITA12Claude Code