squirrel-rules

squirrel-rules is a command for Claude Code from kubalajiri/claude-squirrel. It costs 30 tokens per session (630 once invoked), scanned A, original, MIT.

A command for viewing or editing the rules that control a status bar's appearance. The rules can react to conditions such as high usage, an uncommitted Git change, or an idle session.

In plain words
What is it for?
Use it to list rules, inspect available metrics, or change the conditions that determine the status line.
Why use it?
It shows which rule currently controls the bar and reports invalid rules, making unexpected colours or states easier to understand.

Command for Claude Code

Written for Claude Code: argument-hint in frontmatter.

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 squirrel plugin — 1 skill, 37 commands, 6 hooks shipped together

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 kubalajiri/claude-squirrel
Claude Code
/plugin install squirrel

Made for: Claude Code.

Or install squirrel, the plugin that ships this one along with the rest of its 1 skill, 37 commands, 6 hooks.

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 squirrel-rules

README.md
[![agentmods](https://agentmods.dev/badge/commands/kubalajiri/claude-squirrel/squirrel-rules.svg)](https://agentmods.dev/commands/kubalajiri/claude-squirrel/squirrel-rules)
Your own site
<a href="https://agentmods.dev/commands/kubalajiri/claude-squirrel/squirrel-rules"><img src="https://agentmods.dev/badge/commands/kubalajiri/claude-squirrel/squirrel-rules.svg" alt="Measured on agentmods" height="20"></a>
Per session 30 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 630 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.1 $0.00030 $0.00630
Opus 5 $0.00015 $0.00315
Sonnet 5 $0.00006 $0.00126
Haiku 4.5 $0.00003 $0.00063

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

Security

Grade A, and why

squirrel-rules 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.

plugin/commands/squirrel-rules.md · 45 lines

What it actually says

Run this exact command with the Bash tool and show the user its output verbatim:

sh "${CLAUDE_PLUGIN_ROOT}/scripts/squirrel.sh" --rules "$ARGUMENTS"

With no arguments this lists every rule in evaluation order — the shipped idle ladder first, then the user's own — marking the one that is winning right now (<== WINNING NOW), along with the metrics available and any rule that does not parse. That listing is the answer to "why is my bar this colour?"; read it out rather than reasoning about precedence.

A condition is exactly <metric> <op> <value>, or a bare <metric> for true/false:

weekly.pct >= 80        git.dirty        cost.usd > 5        git.branch == main

Operators are >= <= == != > <. Run the command with no arguments to get the live list of metrics — they cover context and usage percentages, cost, duration, lines, tokens, git (dirty/ahead/branch), repo, model, effort, idle seconds, and activity state.

Nothing here is ever evaluated as code. A condition that does not parse — an unknown metric, a missing value, two comparisons — is reported and ignored, and the bar keeps rendering. /squirrel-rules and /squirrel-config both say how many rules are being ignored and why.

A metric with no value never matches, not even with !=. "Unknown" is not "different from": a rule must not paint the bar because data is missing.

  • add <condition> bg=.. text=.. [bold=on|off] [priority=<n>] — a rule must paint something, so bg, text, or both are required.
  • set <condition> <field>=<value> ... — overlays only the fields given onto an existing rule.
  • remove <condition> — drops one of the user's own rules (the idle ladder is edited with /squirrel-phases, not here).
  • reset — clears the user's rules; the idle ladder remains.

Which rule wins: the last matching rule, unless one carries a higher priority. The idle phase ladder ships as the first rules, so a user rule added later wins a tie with it by default — mention that if they ask why their rule beats the idle tint.

Every edit validates before writing; a refused edit changes nothing. Never write the barRules config key by hand — always go through this command.

Do not do anything else.

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 · 45 lines · 0 tokens per session scan A f821af72b7b1

Subscribe to this mod's changes

squirrel-rules is a command published in the GitHub repository kubalajiri/claude-squirrel (2 stars, last pushed 11d ago), licensed MIT. It adds 30 tokens to every session and 630 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.