Available in
Marketplaces, most starred first
Tags
Add to README
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
By kattakathv1.0.1MITIn 1 marketplace
A PreToolUse advisory for agent tool habits: when a Bash command edits an existing file in place (sed -i, perl -pi, inline Python read-then-write), it adds a note suggesting the Edit tool, which is diff-reviewed and permission-scoped. Advice only, never a block; new files and temp/scratch paths are left alone.
Run automatically on Claude Code events. Claude doesn't decide.
1 caution to review before installing
A hook runs when Claude uses the Bash tool
Static checks of hooks, mods, MCP servers and commands. Not a security audit.
1 marketplace, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
A PreToolUse (Bash) advisory for one agent habit: editing an existing file in place from
Bash with sed -i, perl -pi, or an inline Python body that reads a file and writes it back.
When it sees one, it adds a note to Claude's context suggesting the Edit tool, which shows a
reviewable diff and is permission-scoped. It never blocks and never rewrites the command.
Measured on 2026-11-28 over 55,639 Bash calls in 1,155 local transcripts (counts only, read-only):
| Count | |
|---|---|
| Bash calls flagged by this rule | 4,721 (8.5%) |
| real edits of existing files, in a hand-checked sample of an EARLIER draft of the detector | about 13 in 15 (an estimate; the shipped rule wasn't re-sampled) |
ci-watch's poll-guard.js. That one is written policy and rare (0.11%)./tmp, /var/folders, $TMPDIR,
$S/, a session scratchpad or job tmp dir).python3 -I "$S/x.py"). Only inline bodies are read.sed without -i, and text that only mentions sed -i (grep, commit messages).It follows nix-dev-toolkit's references/cli-contract.md § "Never wire a CLI straight in as a
hook". A finding prints one stdout JSON with hookSpecificOutput.additionalContext and no
permissionDecision, then exits 0. Anything else prints nothing and exits 0, garbage input
included. It never exits 2, so a bug can't block a call.
bash plugins/tool-habits/tests/run.sh runs 23 cases through the real hook entry: 11 advised,
11 quiet, plus garbage input. Two mutants fail the suite: scratch paths no longer exempt (4
cases fail), and the Python rule switched off (4 fail).
Node.js on PATH.
Built from public signals: copy clicks on this site, GitHub stars and activity, the README and the manifest. Not a security audit or an endorsement.
npx claudepluginhub kattakath/skills --plugin tool-habitsPlugins from other owners that cover similar ground