bash-usage

A guide for choosing between PowerShell and Git Bash on a Windows computer when a QBAgent tool needs to run shell commands. QBAgent is the tool system described by the add-on, and a shell is a program used to run commands.

In plain words
What is it for?
Use it when deciding how to run build or shell commands on the Windows host, especially after Git Bash is unavailable.
Why use it?
It prevents agents from assuming that Git Bash is installed or using the wrong command runner. It also states which project operations should use dedicated tools instead of shell commands.

Skill for Claude CodeCodex

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 skills/sharpninja/mcpserver/bash-usage
Any agent
npx skills add sharpninja/McpServer --skill bash-usage
Clone the repo
git clone --depth 1 https://github.com/sharpninja/McpServer

Made for: Claude Code, Codex.

Per session 72 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,515 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.00072 $0.01515
Opus 5 $0.00036 $0.00758
Sonnet 5 $0.00014 $0.00303
Haiku 4.5 $0.00007 $0.00152

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

Security

Grade A, and why

bash-usage 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 yesterday.

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/bash-usage/SKILL.md · 104 lines

How it starts

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

Bash Usage on the McpServer Windows Host

This skill governs shell selection for the optional QBAgent (McpServer.QBAgent, Quad-Brain) run_bash and run_powershell tools. The host OS is Windows 11. PowerShell 7+ (pwsh.exe) is the primary and always-present shell. Git Bash is optional and only usable when it is resolvable on PATH.

When to Use

  • A QBAgent tool loop needs to run a shell command and you must choose between run_powershell and run_bash.
  • A run_bash call returned available: false and you need the correct fallback.
  • You are porting a POSIX shell snippet (the build doc examples use ./build.ps1 ... but show bash fences) and need to decide which tool actually executes it.

When Not to Use

  • Pure file read/write/search work. Use the dedicated file tools, not a shell.
  • Session log, TODO, requirements, import/export, or traceability operations. Those must go through the mcpserver-claude-code-plugin wrapper (workflow.* / client.* methods), not through run_bash or run_powershell. Never cat, grep, or sed the docs/Project/TODO.yaml or session-log files from a shell.
  • Long-lived servers or builds you intend to background. Prefer the project's documented entry points (./build.ps1 Compile, ./build.ps1 Test, ./build.ps1 StartServer).

Inputs

  • The shell command string you intend to run.
  • The QBAgent tool result fields, specifically the available boolean returned by run_bash. When available is false, Git Bash was not found on PATH and no command was executed.
  • Whether the command is POSIX-specific (uses /dev/null, && chains over POSIX builtins, grep/sed/awk, single-quoted here-docs) or is already PowerShell-native.

Critical Rules

  1. run_powershell (pwsh) is the primary shell on this host and is always available. Default to it. The repo standard is pwsh.exe (PowerShell 7+); never target powershell.exe (Windows PowerShell 5.1).
  2. run_bash is OPTIONAL. It only works when Git Bash is on PATH. If the tool returns available: false, treat bash as unavailable for this run and do not retry the same call expecting a different result.
  3. Do not invent shell tool names, flags, or fields. Only run_powershell and run_bash exist for QBAgent shell execution, and the only availability signal is the available field on the run_bash result.
  4. When run_bash is unavailable, translate the command to PowerShell and run it through run_powershell. Do not assume a bash path or call bash.exe directly.
  5. Use absolute paths in commands. The agent working directory is not guaranteed to persist between tool calls.
  6. PowerShell syntax differs from POSIX: use $null not /dev/null, $env:VAR not $VAR, backtick for line continuation, and pwsh-native cmdlets instead of grep/sed/cat.

Read the full file on GitHub · 104 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. yesterday First seen · 104 lines · 0 tokens per session scan A df311599a30f

Subscribe to this mod's changes

bash-usage is a skill published in the GitHub repository sharpninja/McpServer (2 stars, last pushed 11d ago), licensed Apache-2.0. It adds 72 tokens to every session and 1,515 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-31.