ClaudeMods
☰
EN
● — online · Views — times
SponsorsSubmit a project
Reddit posts · by ITower__Education

I built 5 small Claude Code mods after one too many close calls

A Reddit user shares five small Claude Code hook mods they built after repeated close calls: a destructive-command guard that pauses on git reset --hard or rm -rf and lists uncommitted files at risk, a context-usage weather-forecast indicator above the prompt, an API-key filter for pasted secrets, a push-to-main and Friday-afternoon block, and a task board Claude can read and append to. The author notes hooks fail open — a crashing hook is skipped, so they added a catch that converts any crash into a deny — and admits the guards are pattern-matching only and not bulletproof.

Translated

About this mod

Reddit post on r/ClaudeCode describing five small Claude Code mods built by the author, each around 20-50 lines. The most prominent is a destructive-command guard: when Claude attempts git reset --hard or rm -rf, it pauses, shows which uncommitted files would be lost, and asks for confirmation, usually offering to stash instead. The author highlights that a crashing hook is silently skipped, so an unguarded failure lets everything through, and they added a catch turning crashes into denies. The other four mods: a context-usage weather-forecast indicator above the prompt, an API-key filter for accidentally pasted secrets, a block on pushing to main (and on anything after 3pm Friday), and a task board Claude can read and add to. The author notes the key filter only inspects typed input and the command guard is pattern matching, so code hidden inside scripts can slip past. No repository link or installation instructions are provided.

Installation

See the original source for installation instructions.

Original text / README

Claude Code opened up to mods recently so I built a few for stuff that kept biting me. Each one is 20-50 lines. I built them with Claude Code itself. I described what each mod should do, Claude wrote the first version, then I tested it in a live session and asked it to fix whatever broke. The regex lists for risky commands and API key formats were mostly Claude’s, I just trimmed them down. The most useful one by far stops destructive commands. If Claude tries git reset --hard or rm -rf , it pauses, shows which uncommitted files would be lost and asks me. If I say no, Claude usually just offers to stash first. Funny thing I didn’t expect: if a hook crashes, Claude Code just skips it. So a broken guard lets everything through. Had to add a catch that turns any crash into a deny. Lesson for me: always decide what your mod should do when it fails, because the default is “do nothing”. The other four: context usage shown as a little weather forecast above the prompt, a filter that hides API keys if you paste them by accident, a block on pushing to main (and on anything after 3pm Friday), and a task board Claude can read and add to. None of them are bulletproof btw. The key filter only sees what you type, and the command guard is just pattern matching, so something hidden inside a script gets past it. Is anyone else making mods? I’d like to see what people come up with. submitted by /u/ITower__Education to r/ClaudeCode [link] [comments]

Similar projects