thrift

thrift is a command for Claude Code from eddiebelaval/squire. It costs 0 tokens per session (1,742 once invoked), scanned A, original, MIT.

A decision step that asks whether a proposed implementation uses the least costly adequate approach.

In plain words
What is it for?
Use it before changing code to compare implementation approaches and choose a smaller or cheaper one when it still meets the need.
Why use it?
It helps avoid spending extra computing time, response time, tokens, or money on a solution that a simpler mechanism could handle.

Command for Claude Code

Written for Claude Code: $ARGUMENTS substitution. Also seen: reads .claude/ paths.

Good fit Use it before changing code to compare implementation approaches and choose a smaller or cheaper one when it still meets the need.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/eddiebelaval/squire/thrift
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/eddiebelaval/squire

Made for: Claude Code.

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 thrift

README.md
[![agentmods](https://agentmods.dev/badge/commands/eddiebelaval/squire/thrift/github.svg)](https://agentmods.dev/commands/eddiebelaval/squire/thrift)
Your own site
<a href="https://agentmods.dev/commands/eddiebelaval/squire/thrift"><img src="https://agentmods.dev/badge/commands/eddiebelaval/squire/thrift/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for thrift

Your own site · 80×15
<a href="https://agentmods.dev/commands/eddiebelaval/squire/thrift"><img src="https://agentmods.dev/badge/commands/eddiebelaval/squire/thrift.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,742 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 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.00000 $0.01742
Opus 5 $0.00000 $0.00871
Sonnet 5 $0.00000 $0.00348
Haiku 4.5 $0.00000 $0.00174

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

Security

Grade A, and why

thrift 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 5d 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/thrift.md · 157 lines

How it starts

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

/thrift - the approach gate

The one question: is this the cheapest mechanism that does the job?

Cheap meaning all four currencies: compute, latency, tokens, dollars. This is the Model Cascade (~/.claude/docs/model-cascade.md) applied to implementation choice — work funnels DOWN to the cheapest adequate tier, and a thing built one tier too high costs that difference forever.

Runs SELF-CONTAINED. No plugin agents (code-simplifier and feature-dev are false in settings.json).

Where it sits — and why it is FIRST among the change gates

/verify     does it work?           green baseline, or nothing below is falsifiable
/thrift     is this the RIGHT WAY?  <- YOU ARE HERE. change the approach
/simplify   what can go?            shrink what survives
/polish     is it finished?         add the edges
/assay      is it worth keeping?    worth
/3pv        is it what he asked?    intent

The chain runs largest blast radius first. Approach → structure → edges → worth → intent. Thrift can replace a whole mechanism; simplify only reshapes the one it finds; polish only fills its gaps. Running them in any other order means shrinking and finishing code you are about to throw away.

What separates this from /simplify

/simplify works INSIDE the chosen approach and asks whether it could be smaller. /thrift asks whether the approach is right at all. A simplify pass will happily shave three lines off a bubble sort and never notice it should be a hash lookup. That gap is what this gate covers, and it is the only thing it covers.

If a finding makes the code shorter but does not change the mechanism, it belongs to /simplify. Hand it over rather than doing it here.

Arguments

  • --files <glob> — restrict to a path. Default: the branch diff vs base.
  • --dry-run — report findings, change nothing.
  • Empty = the current branch's diff.

Step 0: baseline, and the refusal

npx tsc --noEmit; echo "tsc=$?"
npm test -- --run > /tmp/gate-tests.log 2>&1; echo "tests=$?"; tail -20 /tmp/gate-tests.log

Read the full file on GitHub · 157 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. 5d ago First seen · 157 lines · 0 tokens per session scan A c41fa051c69b

Subscribe to this mod's changes

thrift is a command published in the GitHub repository eddiebelaval/squire (21 stars, last pushed 24d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,742 tokens. 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-09-03.