너무 많은 아찔한 순간 끝에 작은 Claude Code mod 5개를 만들었습니다
한 Reddit 사용자가 반복된 아찔한 순간 이후에 만든 다섯 개의 작은 Claude Code hook mod를 공유합니다. git reset --hard 또는 rm -rf에서 일시 중지하고 위험에 처한 커밋되지 않은 파일을 나열하는 파괴적 명령 가드, 프롬프트 위의 컨텍스트 사용량 일기예보 표시기, 붙여넣은 비밀을 위한 API 키 필터, main으로의 푸시 및 금요일 오후 차단, 그리고 Claude가 읽고 추가할 수 있는 작업 보드입니다. 작성자는 hook이 fail open이라고 지적합니다. 즉, 충돌한 hook은 건너뛰므로, 모든 충돌을 deny로 바꾸는 catch를 추가했으며, 이 가드들은 패턴 매칭일 뿐 완벽하지 않다고 인정합니다.
이 mod 소개
r/ClaudeCode의 Reddit 게시물로, 작성자가 만든 다섯 개의 작은 Claude Code mod를 설명하며, 각각 약 20-50줄입니다. 가장 눈에 띄는 것은 파괴적 명령 가드입니다. Claude가 git reset --hard 또는 rm -rf를 시도하면 일시 중지하고, 잃게 될 커밋되지 않은 파일을 보여주며, 확인을 요청하고, 보통 대신 stash할 것을 제안합니다. 작성자는 충돌한 hook이 조용히 건너뛰어지므로, 가드 없는 실패는 모든 것을 통과시키며, 충돌을 deny로 바꾸는 catch를 추가했다고 강조합니다. 나머지 네 가지 mod는 프롬프트 위의 컨텍스트 사용량 일기예보 표시기, 실수로 붙여넣은 비밀을 위한 API 키 필터, main으로의 푸시(그리고 금요일 오후 3시 이후의 모든 작업) 차단, 그리고 Claude가 읽고 추가할 수 있는 작업 보드입니다. 작성자는 키 필터가 입력된 텍스트만 검사하고 명령 가드는 패턴 매칭이므로, 스크립트 안에 숨겨진 코드는 빠져나갈 수 있다고 지적합니다. 저장소 링크나 설치 지침은 제공되지 않았습니다.
설치
설치 방법은 원본 출처를 확인하세요.
원문 / 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]
