C.W.K.
Stream
Lesson 04 of 13 · published

권한 시스템 — allow / ask / deny

~18 min · permissions, settings, safety, tools

Level 0🌱 입문자
0 XP0/70 lessons0/11 achievements
0/120 XP to next level120 XP to go0% complete

한 파일, 세 리스트, deny-first 평가

Claude Code 의 권한 모델은 의도적으로 작아: 모든 도구 호출이 allow, ask, deny 패턴에 매칭되고, 우선순위 순으로 첫 매치가 이김. Read 도구는 항상 통과. Bash 와 Edit/Write 는 안 그래.

패턴은 도구 specifier 에 대한 glob 스타일: Bash(npm run *), Bash(git diff *), Read(./.env), WebFetch(domain:api.github.com). Bash 단독은 "any bash"; Bash(*) 와 동등. 와일드카드는 중간에도 — Bash(* --dry-run) 도 진짜 유용한 룰.

Settings 는 CLAUDE.md 처럼 레이어돼: enterprise managed → user global → project shared → project local (gitignored). 그 순서가 의도적 — 보안팀이 위에 룰 핀, 개인이 아래에서 커스터마이즈.

Code

A solid project default·json
// .claude/settings.json — committed, shared with the team
{
  "permissions": {
    "allow": [
      "Bash(npm run *)",
      "Bash(npm test *)",
      "Bash(npx prettier *)",
      "Bash(git diff *)",
      "Bash(git status)",
      "Bash(git log *)",
      "Bash(* --version)",
      "Bash(* --help *)",
      "Read"
    ],
    "ask": [
      "Bash(git push *)",
      "Bash(git commit *)"
    ],
    "deny": [
      "Bash(rm -rf *)",
      "Bash(git push --force *)",
      "Bash(npm publish *)",
      "Read(./.env)"
    ]
  }
}
Inspect and edit live·bash
# Inside an active Claude Code session
/permissions

# Browse all active rules, see which file each comes from,
# add or remove rules interactively. Faster than editing JSON
# when you're in the middle of work.

External links

Exercise

실제 repo 의 .claude/settings.json 편집해서 allow 룰 5개 (매 세션 다시 승인하는 작업) 와 deny 룰 3개 (절대 안 돌리고 싶은 명령어) 추가. 세션 돌려서 prompt 몇 개 절약했나 세봐. 파일 커밋.

Progress

Progress is local-only — sign in to sync across devices.
이 페이지에서 버그를 발견하셨거나 피드백이 있으세요?문제 신고

댓글 0

🔔 답글 알림 (로그인 필요)
로그인댓글을 남기려면 로그인해 주세요.

아직 댓글이 없어요. 첫 댓글을 남겨보세요.