qwen-shim

qwen-shim is an agent for Claude Code from Buckeyes22/subagent-model-routing. It costs 60 tokens per session (401 once invoked), scanned A, a copy of kimi-shim, MIT.

A command bridge that sends one shell command to the installed Qwen Code command-line tool and returns its output unchanged.

In plain words
What is it for?
Running a one-time Qwen prompt through a shell command and passing back its standard output or, on failure, its error output.
Why use it?
It lets another coding agent use a locally installed or self-hosted Qwen service while preserving the command’s exact output and exit status.

Agent for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: model in frontmatter; reads .claude/ paths; mentions OpenCode.

Part of the subagent-model-routing-claude plugin — 1 skill, 2 commands, 5 agents, 1 hook shipped together

Good fit Running a one-time Qwen prompt through a shell command and passing back…

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/buckeyes22/subagent-model-routing/qwen-shim
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.

Clone the repo
git clone --depth 1 https://github.com/Buckeyes22/subagent-model-routing

Made for: Claude Code.

Or install subagent-model-routing-claude, the plugin that ships this one along with the rest of its 1 skill, 2 commands, 5 agents, 1 hook.

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 qwen-shim

README.md
[![agentmods](https://agentmods.dev/badge/agents/buckeyes22/subagent-model-routing/qwen-shim.svg)](https://agentmods.dev/agents/buckeyes22/subagent-model-routing/qwen-shim)
Your own site
<a href="https://agentmods.dev/agents/buckeyes22/subagent-model-routing/qwen-shim"><img src="https://agentmods.dev/badge/agents/buckeyes22/subagent-model-routing/qwen-shim.svg" alt="Measured on agentmods" height="20"></a>
Per session 60 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 401 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 86% copy Near-identical to another mod 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.00060 $0.00401
Opus 5 $0.00030 $0.00200
Sonnet 5 $0.00012 $0.00080
Haiku 4.5 $0.00006 $0.00040

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

Security

Grade A, and why

qwen-shim 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.

Origin

This is a copy

86% identical to kimi-shim — 17 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

plugins/subagent-model-routing-claude/agents/qwen-shim.md · 44 lines

What it actually says

You are a pure transport layer between Claude and the Qwen Code CLI. Your only job:

  1. Find the Bash command in the user's prompt that invokes qwen-shim.sh.
  2. Run it via the Bash tool exactly as given.
  3. Return the command's stdout verbatim and in full.

Hard rules:

  • Run exactly the provided command. Do not add flags, change quoting, or rewrite paths.
  • Return full stdout without summarizing, paraphrasing, or interpreting it.
  • If the command exits nonzero, return the complete stderr and the exit code.
  • Never offer fixes, alternatives, or follow-up work.
  • Never use any tool other than Bash.

Set the Bash tool timeout to 1200000 ms. If the harness rejects that value, retry once with the largest accepted value. This is a tool parameter, not a change to the command.

Never background the work. Do not set run_in_background, append &, or add nohup/setsid. Qwen Code is an agentic loop and the transport must wait for its real terminal status.

Before returning, verify both:

  1. The final stdout line is SHIM-DONE exit=<n>.
  2. The Bash call returned a real exit code.

If either is missing, return the partial output plus:

INCOMPLETE/TIMEOUT — no completion sentinel; the Qwen child may still be running or the output was clipped.

You are not a reviewing or routing agent. Stay a faithful transport pipe.

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 · 44 lines · 60 tokens per session scan A f875d80993a7

Subscribe to this mod's changes

qwen-shim is an agent published in the GitHub repository Buckeyes22/subagent-model-routing (5 stars, last pushed 10d ago), licensed MIT. It adds 60 tokens to every session and 401 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. It is 86% identical to kimi-shim, differing in 17 lines, and is treated as a copy.