switch-ai

A command for viewing or changing the offline coding-AI command-line tool that Heimdall prefers for new delegated tasks and future sessions.

In plain words
What is it for?
Use it to see available AI command-line tools, select one by name or identifier, or check the saved preference.
Why use it?
It avoids repeatedly choosing between detected AI tools. It also clarifies that it does not switch the tool running the current session.

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/randomittin/heimdall/switch-ai
Clone the repo
git clone --depth 1 https://github.com/randomittin/heimdall
Per session 47 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 653 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.00047 $0.00653
Opus 5 $0.00023 $0.00327
Sonnet 5 $0.00009 $0.00131
Haiku 4.5 $0.00005 $0.00065

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

Security

Grade A, and why

switch-ai 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.

commands/switch-ai.md · 38 lines

How it starts

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

Switch AI Backend

hmd can be driven by more than one offline coding-AI CLI — Claude Code, Cursor CLI's agent/cursor-agent, and more as they're added. This command shows or changes which one hmd prefers.

What this actually controls — read before switching

hmd is a Claude Code plugin: code loaded into a live Claude Code process. It cannot hot-swap itself into a cursor-agent process mid-session, and it cannot restart itself as a different CLI. /switch-ai cannot change what is hosting this session, right now — nothing can, short of you exiting and relaunching under a different CLI's own launcher (e.g. cursor-agent instead of claude). That is a restart, not something this command performs.

What it genuinely does change:

  1. The recorded preference — persisted to .planning/settings.json under the ai_backend key. This governs which backend hmd's own sub-agent spawns prefer for delegated work when more than one is detected, effective immediately for new spawns.
  2. The default for your NEXT session — the next time hmd starts a run, heimdall-ai-select session-start reads this recorded choice first and will not re-prompt or re-guess.

Instructions

  1. Parse $ARGUMENTS:
    • If empty or missing: show the current backend and the detected options, then stop — do not change anything.
      heimdall-ai-select current .
      heimdall-ai-select list --auth
      
      Present the current selection first, then the lettered list exactly as printed (e.g. A) Claude Code [claude-code] (current host), B) Cursor CLI (cursor-agent) [cursor-cli] — not logged in).
    • Otherwise: treat $ARGUMENTS as a letter (A, B, ...), a backend id (claude-code, cursor-cli), or a loose name (cursor, claude) and pass it straight through — heimdall-ai-select resolves letter/id/loose-name itself and refuses anything not currently detected on PATH:
      heimdall-ai-select select "$ARGUMENTS" .
      
      Report its exit message verbatim, success or rejection — don't re-word it.

Read the full file on GitHub · 38 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. 2d ago First seen · 38 lines · 47 tokens per session scan A bbe6d136d924

Subscribe to this mod's changes

switch-ai is a command published in the GitHub repository randomittin/heimdall (5 stars, last pushed 11d ago), licensed MIT. It adds 47 tokens to every session and 653 once invoked, about $0.0002 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.