Post

Claude 전역설정

Claude 전역설정

~/.claude/CLAUDE.MD

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# Global Development Guidelines

## Mandatory Pre-Edit Procedure

Before modifying any code, always present an execution plan in the format below
and wait for explicit user approval before proceeding.

### Plan Format
1. **Purpose**: What and why
2. **Files to change**: List of file paths
3. **Change summary**: What changes in each file
4. **Impact**: Potential side effects

Never run Edit, Write, or file creation without prior approval.

## Tech Stack
- Java / Spring Boot backend
- Build tools: Maven or Gradle

## Git / Deployment
- Do NOT run git commit, push, checkout, or add. User handles all git operations.
- Do NOT run Docker commands. User handles deployment.

## Response Style
- Be concise. Avoid redundant explanations.
- Do not list multiple alternatives unless explicitly asked.

Mandatory Pre-Edit Procedure : 코드 수정 전 → 실행 계획 제시 → 사용자 명시적 승인 → 편집 실행
Plan Format : 1. 목적+이유 / 2. 수정할 파일 경로 목록 / 3. 각 파일별 변경 내용 / 4. 부작용 가능성
승인 없이는 절대 파일 수정 금지
Git / Deployment : Git/배포 금지
Response Style : 응답은 간결하게, 대안 여러개 제시 금지 (명시적 요청시에만) > 토큰 아끼기



~/.claude/settings.json

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
{
  "env": {
    "JAVA_TOOL_OPTIONS": "-Dfile.encoding=UTF-8"
  },
  "permissions": {
    "allow": [
      "Bash(./mvnw *)",
      "Bash(mvn *)",
      "Bash(./gradlew *)",
      "Bash(gradle *)",
      "Bash(git status)",
      "Bash(git diff *)",
      "Bash(git log *)",
      "Bash(git branch *)",
      "Bash(java -version)",
      "Read",
      "Edit(*.java)",
      "Edit(*.js)",
      "Write(*.java|*.js)"
    ],
    "deny": [
      "Bash(rm -rf *)",
      "Bash(git add *)",
      "Bash(git commit *)",
      "Bash(git push *)",
      "Bash(git checkout *)",
      "Bash(git stash *)",
      "Edit(.env*)",
      "Edit(*.properties)",
      "Edit(*.yml)"
    ]
  },
  "hooks": {
    "PreToolUse": [
      {
        "matcher": "Bash",
        "hooks": [
          {
            "type": "command",
            "command": "cmd=$(echo \"$CLAUDE_TOOL_INPUT\" | jq -r '.command'); if echo \"$cmd\" | grep -qE '(rm -rf|DROP TABLE|DELETE FROM|password=)'; then exit 2; fi"
          }
        ]
      }
    ]
  }
}

JAVA_TOOL_OPTIONS : UTF-8 인코딩 강제 / 한글 깨짐 예방
허용 :
    빌드 테스트 (maven/gradle)
    Git 상태 확인
    Java 정보
    파일 작업 : 모든 파일 읽기, .java/.js 편집 및 새 파일 생성
차단 :
    삭제 금지 : rm -rf
    Git 변경 명령
    설정파일 보호 : .env/.perperties/.yml
hooks.PreToolUse (사전 검증) :
     명령어를 검사하여 작성된 규칙 포함 시 차단

This post is licensed under CC BY 4.0 by the author.