justinstimatze

Weir — AI skill for Claude Code

AI community

Claude Code wrote grep 4,575 times and rg zero times across 25,216 Bash calls in one user’s transcripts.

How to install Weir

This entry records only its repository, not the path inside it, so there is no exact command to give. Open justinstimatze/weir and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

What Weir does

Claude Code wrote `grep` 4,575 times and `rg` zero times across 25,216 Bash calls in one user’s transcripts. weir is the hook that fixes that — tells the model what shell tools you actually have, suggests rewrites for the antipattern cluster, refuses to run the unambiguously-broken ones (`cat FILE | grep`, `which CMD`).

Alternatives in AI

  • Xerj — Local-first search engine and MCP server for AI agents 12.5k ★
  • Om Humanize — Voice-calibrated editing — makes Claude-drafted text sound like you wrote it, not like AI wrote it 4.6k ★
  • Agmsg — Cross-vendor messaging for CLI AI coding agents — let Claude Code, Codex, Gemini & Copilot talk to each other 1.5k ★

README

weir

A barrier across a stream that's also the standard instrument for measuring its flow rate.

weir is a Claude Code addon that closes a specific gap: the model writes shell pipelines fluently, but reaches for a 1995 toolbox.

The thesis

Mining one user's JSONL session transcripts across dozens of project directories (the sanitized aggregate is in [`internal/measure/baseline.json`](internal/measure/baseline.json)):

  • 25,216 Bash invocations
  • 49.7% contain a top-level pipe — the model writes pipelines constantly
  • 0 of those calls reached for rg, fd, bat, sd, mlr, eza, or any other modern alternative — not "underused", never reached for
  • A handful of antipatterns recur in volume — counts from the embedded baseline: grep | head (810), ls | grep (225), UUOC variants cat FILE | tool (~120 across head/grep/tail/jq/wc), grep | wc -l (99), awk | awk (38), find ... -exec ... \; (13). A separate pass-A discovery on the same corpus (data/mine_extra.py) added which CMD (~179), find | xargs without -print0 (~61), and ls | wc -l (~152).

The model's pipeline *shapes* are fine. What's broken is which binaries it reaches for inside each shape, and a small cluster of stereotyped antipatterns.

What weir does

Three layers, registered as Claude Code hooks. All fail-open; bypass with `WEIR_SUGGEST_SKIP=1` / `WEIR_SKIP=1`.

Layer 1 — Capability manifest (SessionStart)

At the start of every session, weir probes `$PATH` for ~30 modern shell tools, emits a JSON manifest, and injects it into the model's context as `additionalContext`. The model now knows what's reachable on *this* host instead of defaulting to coreutils.

`sd` is deliberately not in this catalog. It was recommended over `sed` through v0.1.11, but three field-reported sightings of the same replacement-string footgun — the third one a detection bug in the block rule meant to have already closed it — settled the question: the failure mode recurs faster tha