agentleFS
eprouvezeeprouveze/claude-skills/skills/mode/SKILL.md

mode

Skill0 starsChanged 5 months agoMITView on GitHub

Toggle between single-LLM (Claude-only) and multi-LLM (delegate to Gemini, Codex, or other CLIs) modes. Shows current mode, available external CLIs, delegation stats, and logs. Use when the user says "switch to multi", "use Gemini", "delegation status", "how many delegations", or "token savings". Subcommands: `/mode` (status), `/mode multi`, `/mode single`, `/mode stats`, `/mode reset`.

  • Pipes a download into a shell
  • Reads credentials

11 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use setup.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • VercelSkill

    setup

    Set up Vercel CLI and project configuration. Use when the user says "set up Vercel", "configure Vercel", "link to Vercel", or "vercel init".

    Also in 3 projects that use this

The file

Show its rules and text

We split this skill into the rules it gives an agent

16 rules. 0 are common, 3 are distinctive, and 13 are very specific to this project.

  • 0

    Common

    Most of the 7 edited versions we read keep these.

  • 3

    Distinctive

    This author's own choices. Worth a look.

  • 13

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    When mode is single, every skill runs natively in Claude.

    line 30
  2. Distinctive:

    No args → show status

    line 36
  3. Very specific:

    Read .claude/llm-mode.json and display:

    line 44
  4. Very specific:

    Read .claude/llm-mode.json for mode and stats.

    line 65
  5. Very specific:

    Check agy --version for Antigravity CLI.

    line 66
  6. Very specific:

    Check codex --version for Codex CLI.

    line 67
  7. Very specific:

    Check $PERPLEXITY_API_KEY (or your provider's env var) for web search.

    line 68
  8. Very specific:

    If .claude/llm-mode.json doesn't exist, show Mode: SINGLE (default — no config file yet).

    line 71
  9. Very specific:

    Verify the Google delegate CLI is installed and authenticated.

    line 75
  10. Very specific:

    If the auth check fails, abort with installation/auth instructions.

    line 89
  11. Very specific:

    Update .claude/llm-mode.json: set mode to "multi", update updated_at to the current ISO timestamp.

    line 92
  12. Distinctive:

    Check Codex CLI and Perplexity availability non-blockingly.

    line 100
  13. Very specific:

    Update .claude/llm-mode.json: set mode to "single", refresh updated_at.

    line 105
  14. Very specific:

    Read .claude/delegation.log and show the last 20 entries plus summary stats: total, failure rate, average duration on success, …

    line 111
  15. Very specific:

    Write a fresh .claude/llm-mode.json with defaults (single mode, zeroed stats).

    line 116
  16. Distinctive:

    After a successful delegation:

    line 124

“Common” is measured: kept by at least 6 in 10 of the 7 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

/mode — LLM Routing Switch

Manage delegation across a multi-LLM setup. The pattern: Claude orchestrates, judges, reviews, and surgically fixes; cheaper or specialized CLIs handle the heavy lifting.

LayerTypical CLIStrength
Heavy readingAntigravity CLI (agy)Large context window, fast cold reads. Replaces the Gemini CLI on consumer plans as of 2026-06-18; enterprise plans may still ship gemini.
Heavy writingCodex CLIHigh-throughput code generation
Surgical web searchPerplexity API (or others)Live docs, breaking changes

Other skills in this collection read .claude/llm-mode.json to decide whether to delegate. When mode is single, every skill runs natively in Claude.

Route by argument

Parse the argument after /mode:

  • No args → show status
  • multi → switch to multi
  • single → switch to single
  • stats → show delegation log
  • reset → reset to defaults

Show status (default)

Read .claude/llm-mode.json and display:

## LLM Mode: <MULTI / SINGLE>

### Delegation targets (in multi mode)
  READING (Antigravity CLI / agy):  [available / not found]
  WRITING (Codex CLI):              [available / not found]
  WEB SEARCH (Perplexity):          [key set / key missing]

### Delegation stats
  Total:     N successful delegations
  Failed:    N (X% failure rate)
  Last:      YYYY-MM-DD HH:MM via <skill>

Switch with: /mode multi  or  /mode single
Full log:    /mode stats

To populate the display:

  1. Read .claude/llm-mode.json for mode and stats.
  2. Check agy --version for Antigravity CLI. Fall back to gemini --version for enterprise plans still on the legacy binary.
  3. Check codex --version for Codex CLI.
  4. Check $PERPLEXITY_API_KEY (or your provider's env var) for web search.
  5. Count entries in .claude/delegation.log for the totals.

If .claude/llm-mode.json doesn't exist, show Mode: SINGLE (default — no config file yet).

Switch to multi

  1. Verify the Google delegate CLI is installed and authenticated. Prefer Antigravity CLI (agy); fall back to the legacy gemini binary for enterprise plans.

    # Antigravity CLI (consumer + new enterprise).
    # The `</dev/null` redirect is mandatory: `agy -p "..."` deadlocks waiting for
    # TTY input even when a prompt arg is supplied.
    agy --version 2>/dev/null \
      || gemini --version 2>/dev/null
    
    agy -p "Reply with exactly: OK" </dev/null 2>/dev/null \
      || gemini -p "Reply with exactly: OK" -o text 2>/dev/null

    If the auth check fails, abort with installation/auth instructions. For agy, the install command is curl -fsSL https://antigravity.google/cli/install.sh | bash.

  2. Update .claude/llm-mode.json: set mode to "multi", update updated_at to the current ISO timestamp.
  3. Append to .claude/delegation.log:

    YYYY-MM-DDTHH:MM:SSZ | mode | ok | 0s | Switched to multi-LLM mode
  4. Check Codex CLI and Perplexity availability non-blockingly. Report each as "available" or "not found / key missing" in the confirmation.

Switch to single

  1. Update .claude/llm-mode.json: set mode to "single", refresh updated_at.
  2. Log: ... | mode | ok | 0s | Switched to single-LLM mode.
  3. Confirm: "Switched to single-LLM mode. All skills using Claude natively."

Show delegation log

Read .claude/delegation.log and show the last 20 entries plus summary stats: total, failure rate, average duration on success, most-delegated skill.

Reset

  1. Write a fresh .claude/llm-mode.json with defaults (single mode, zeroed stats).
  2. Clear .claude/delegation.log (keep any header comments).
  3. Confirm.

Delegation logging protocol

Other skills that delegate should follow this protocol:

After a successful delegation:

echo "$(date -u +%Y-%m-%dT%H:%M:%SZ) | <skill> | ok | <duration>s | <notes>" \
  >> .claude/delegation.log

Also increment stats.delegations_total and update stats.last_delegation in .claude/llm-mode.json.

On failure:

echo "$(date -u +%Y-%m-%dT%H:%M:%SZ) | <skill> | fail | <duration>s | <reason>" \
  >> .claude/delegation.log

Increment stats.delegations_failed.

Schema for .claude/llm-mode.json

{
  "mode": "single",
  "updated_at": "2026-06-04T00:00:00Z",
  "stats": {
    "delegations_total": 0,
    "delegations_failed": 0,
    "last_delegation": null
  }
}

Known gotchas

  • Multi mode without authenticated CLIs silently falls back to Claude. That can mask a real problem — the user thinks they're saving tokens but every delegation is failing. The status display surfaces both auth state and recent failure rate for this reason.
  • The log file grows unboundedly. Rotate or truncate it before it crosses ~10k lines or the stats view gets slow.
  • Mode is per-project. Each project has its own .claude/llm-mode.json. Setting it in one project does not affect siblings.
  • agy -p "<prompt>" requires </dev/null. Without the stdin redirect, Antigravity CLI waits on a TTY even when a prompt arg is given. The probe in "Switch to multi" uses the canonical agy -p "..." </dev/null form; mirror it in every other call site.

Anti-patterns

  • Flipping to multi mode for a quick win, then forgetting to switch back when the delegated CLIs go stale. Add the status check to a /brief-style routine.
  • Trusting delegations_total as a token-savings proxy. The skills that delegate know their own savings; the mode skill just tracks counts.

Validated patterns

  • Logging both success and failure (rather than just success) keeps the failure-rate metric honest. A 30% failure rate is a signal that the auth or model config needs attention.

Self-improvement

This skill ships with a lightweight feedback loop. Adopt or ignore — the skill works without it.

Trigger a review when:

  • The status display is wrong about CLI availability (the detection command needs updating).
  • A new external CLI joins the routing pattern.
  • learnings.md crosses ~100 bullets (consolidation time).
  • The skill mis-triggers or fails to trigger.

Consolidation pass (5–10 min, weekly or threshold-driven):

  • Each entry gets one fate: apply, capture, or dismiss.
  • Apply = merge into Known gotchas / Anti-patterns / Validated patterns.
  • Capture = leave in learnings.md for now.
  • Dismiss = delete.
  • Bump last-consolidated: in frontmatter.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.