클로드 코드 PermissionRequest Hook으로 자동 허용 만들기
Claude Code의 반복적인 권한 요청을 소넷 모델에게 위임해 자동 허용하는 방법
Quick context
First, this page captures one concrete build-log step, research note, or project lesson from Jeffrey Kim.
Next, use the tags, related reading, and home archive to move from this note to deeper material in the same topic cluster.
Finally, follow the RSS feed if you want the next experiment, retrospective, or paper review as soon as it ships.
Archive note
First, this imported note is intentionally compact. It acts as a pointer into the wider SecondBrain archive rather than a long-form standalone article.
Next, use the tags, related reading, and project sections to move toward deeper context. Those paths usually lead to fuller write-ups, experiments, or project retrospectives.
Finally, revisit this page together with the home archive and RSS feed when you want the follow-up posts that expand the same topic.
클로드 코드가 너무 자주 물어봐서 짜증나는 분 있으신가요? 그게 바로 저입니다.
여러 세션을 병렬로 돌리면서 제일 불만인 점은, 사소한 것들에 계속 ‘Yes’를 눌러줘야 하는 불편함이더라고요. 이것 때문에 집중력이 분산되고, 분산된 집중력은 결국 생산성을 떨어뜨리는 주범입니다.
기존 해결책의 한계
settings.json에 꼼꼼하게 허용 명령어 목록을 작성해도 모든 명령어를 커버하기에는 한계가 있었습니다. 그렇다고 --dangerously-skip-permissions를 사용하기에는 너무 불안하죠.
PermissionRequest Hook
이것을 해결하기 위해 PermissionRequest hook을 사용했습니다.
클로드 코드가 유저에게 Bash, Read, Write 등에 대한 권한 요청을 보내면, 그 권한 요청 내용을 클로드 소넷 모델에게 허용할 것인지 거부할 것인지 API를 통해 물어봅니다. 소넷 모델의 응답에 따라 실제로 ‘자동 허용’이 되는 것까지 확인했습니다.
안전장치
유저에게 질문을 하는 AskUserQuestion에 대해서는 작동하지 않게 해두어서, 알아서 비즈니스 로직적인 결정을 마구잡이로 해버리는 일은 없도록 했습니다.
여담
비슷한 고민이신 분들은 이런 방법도 있구나 하고 알아 가시면 좋겠습니다. Codex도 열심히 써보고 있는데, Claude Code가 커스텀할 부분이 많아 더 재미있네요.
더불어 AutoRAG-Research를 만드는 팀원들도 사용할 수 있게끔 PR을 날려두었습니다. 해당 PR에 코드가 모두 있으니 관심있는 분들은 직접 적용해보셔도 좋겠습니다.