{"id":32696520,"url":"https://github.com/pjt3591oo/claude-code-advanced-guide","last_synced_at":"2026-05-13T20:34:03.188Z","repository":{"id":321480033,"uuid":"1086009298","full_name":"pjt3591oo/claude-code-advanced-guide","owner":"pjt3591oo","description":null,"archived":false,"fork":false,"pushed_at":"2025-10-29T20:40:04.000Z","size":47,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-29T22:27:30.399Z","etag":null,"topics":["agent","claude","claude-code","llm"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pjt3591oo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-10-29T20:20:34.000Z","updated_at":"2025-10-29T21:49:47.000Z","dependencies_parsed_at":"2025-10-29T22:27:38.484Z","dependency_job_id":null,"html_url":"https://github.com/pjt3591oo/claude-code-advanced-guide","commit_stats":null,"previous_names":["pjt3591oo/claude-code-advanced-guide"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/pjt3591oo/claude-code-advanced-guide","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pjt3591oo%2Fclaude-code-advanced-guide","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pjt3591oo%2Fclaude-code-advanced-guide/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pjt3591oo%2Fclaude-code-advanced-guide/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pjt3591oo%2Fclaude-code-advanced-guide/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pjt3591oo","download_url":"https://codeload.github.com/pjt3591oo/claude-code-advanced-guide/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pjt3591oo%2Fclaude-code-advanced-guide/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32999461,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-13T13:14:54.681Z","status":"ssl_error","status_checked_at":"2026-05-13T13:14:51.610Z","response_time":115,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["agent","claude","claude-code","llm"],"created_at":"2025-11-01T19:01:05.821Z","updated_at":"2026-05-13T20:34:03.181Z","avatar_url":"https://github.com/pjt3591oo.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Claude Code 완전 정복: 커맨드, 훅, 에이전트, 스킬, 플러그인 가이드\n\nclaude code란 Anthropic에서 만든 개발자용 AI 어시스턴트 입니다.\n\n클로드 코드는 agent, skill, hook, command 등을 통해 보다 확장성 있는 LLM 워크플로우를 구축할 수 있도록 도와줍니다.\n\n## 시작하며\n\n이 글을 통해 클로드 코드를 활용하여 코드 생산 뿐 아니라, 나만의 개발 워크플로우를 자동화하고 싶은 개발자 또는 LLM을 터미널 환경에 깊숙이 통합하고 싶은 DevOps 엔지니어가 읽기 적합합니다. \n\n주로 다루는 내용은 다음과 같습니다.\n\n1. slash commands\n\n2. hooks\n\n3. sub agent\n\n4. skill\n\n5. plugin\n\n해당 내용을 실행하기 위해선 claude code 2.x 이상의 버전이 필요합니다. \n\n만약, 1.x라면 2.x로 업데이트 해야합니다.\n\n참고로 본문 내용에서는 2가지 형태의 코드 블록이 있습니다.\n\n```\n$ shell 명령어\n\n\u003e 클로드 코드 프롬프트\n```\n\n## slash commands\n\n클로드 코드는 이미 정의된 명령어 또는 사용자 정의 슬래시 명령어를 다음과 같이 사용이 가능 합니다.\n\n사용자 정의 슬래시는 `~/.claude/commands` 또는 `.claude/commands` 경로에 마크다운 파일로 관리됩니다.\n\n```claude\n\u003e /[command-name] [arguments]\n```\n\n또는 네임스페이스를 다음과 같이 지정할 수 있습니다.\n\n`~/.claude/[NAMESPACE]/commands` 또는 `.claude/[NAMESPACE]/commands`\n\n```claude\n\u003e /[NAMESPACE]:[command-name] [arguments]\n```\n\n### 사용자 정의 명령어 생성\n\n```sh\n$ echo \"Analyze this code for performance issues and suggest optimizations:\" \u003e .claude/commands/optimize.md\n```\n\n```sh\n$  echo \"Review this code for security vulnerabilities:\" \u003e .claude/commands/security-review.md \n```\n\n```sh\n$ echo 'Fix issue #$ARGUMENTS following our coding standards' \u003e .claude/commands/fix-issue.md\n```\n\n```sh\n$ echo 'Review PR #$1 with priority $2 and assign to $3' \u003e .claude/commands/review-pr.md\n```\n\n---\n\n```claude\n\u003e /fix-issue 123 high-priority \n\n/fix-issue is running… 123 high-priority \n\n⏺ I'll fix issue #123 with high priority following your coding standards.\n\n  Let me start by fetching the issue details from GitHub.\n\n⏺ Bash(gh issue view 123 --json title,body,labels,state,comments)\n  ⎿  Running…\n\n──────────────────────────────────────────────────────────────────────────────────────\n Bash command\n\n   gh issue view 123 --json title,body,labels,state,comments\n   Fetch issue #123 details from GitHub\n\n Do you want to proceed?\n ❯ 1. Yes\n   2. Yes, and don't ask again for gh issue view commands in\n   /Users/jeongtae/Desktop/claude-code-advanced-guide\n   3. No, and tell Claude what to do differently (esc)\n```\n\n```claude\n\u003e /review-pr 456 high alice \n\n/review-pr is running… 456 high alice \n\n⏺ I'll review PR #456 with high priority and prepare it for assignment to alice.\n\n  Let me start by fetching the PR information using the GitHub CLI.\n\n⏺ Bash(gh pr view 456 --json\n      title,body,author,state,headRefName,baseRefName,files,commits)\n  ⎿  Interrupted · What should Claude do instead?\n```\n\n### 파일 참조\n\n@를 이용하면 파일을 참조할 수 있습니다.\n\n```sh\n$ echo 'Compare @src/need_debugger.py with @src/need_review.py' \u003e .claude/commands/referrence-file.md \n```\n\n```claude\n\u003e /referrence-file\n\n/referrence-file is running…\n\n⏺ I'll compare these two Python files for you. Let me read both files first.\n\n⏺ Read(src/need_debugger.py)\n  ⎿  Error reading file\n\n⏺ Read(src/need_review.py)\n  ⎿  Error reading file\n\n⏺ The files don't exist at those paths. Let me search for them in the repository.\n\n⏺ Search(pattern: \"**/need_debugger.py\")\n  ⎿  Found 1 file (ctrl+o to expand)\n\n⏺ Search(pattern: \"**/need_review.py\")\n  ⎿  Found 1 file (ctrl+o to expand)\n\n⏺ Found them! They're in the root directory. Let me read both files now.\n\n⏺ Read(need_debugger.py)\n  ⎿  Read 12 lines\n\n⏺ Read(need_review.py)\n  ⎿  Read 7 lines\n\n⏺ Comparison of need_debugger.py vs need_review.py\n\n  need_debugger.py (need_debugger.py:1-12)\n\n  def main() -\u003e None:\n      student = {\n          \"name\": \"Alice\",\n          \"age\": 21,\n          \"courses\": [\"Math\", \"Science\", \"Art\"]\n      }\n\n      print(student[\"a\"])  # BUG: KeyError\n\n\n  if __name__ == \"__main__\":\n      main()\n\n  Issues:\n  - Bug at line 8: Attempts to access student[\"a\"] which doesn't exist, causing a\n  KeyError\n  - Should likely be student[\"age\"] or student[\"name\"]\n\n  need_review.py (need_review.py:1-7)\n\n  def main() -\u003e None:\n      print(\"Hello, World!\")\n\n\n  if __name__ == \"__main__\":\n      main()\n\n  Characteristics:\n  - Simple \"Hello, World!\" program\n  - No bugs, but basic implementation\n  - Could potentially benefit from code review for production standards\n\n  Key Differences:\n\n  1. Complexity: need_debugger.py has more complex logic with a dictionary\n  structure, while need_review.py is minimal\n  2. Purpose: need_debugger.py clearly has a bug that needs debugging, while\n  need_review.py is functional but basic\n  3. Error state: need_debugger.py will crash at runtime, need_review.py runs\n  successfully\n\n  The naming suggests these files are examples for testing specialized agents -\n  one needs the debugger agent (has a bug), while the other needs the\n  code-reviewer agent (works but could be reviewed for quality).\n```\n\n### Bash 명령어 실행\n\n커맨드 정의를 위한 마크다운 파일에 !`배시 명령어` 형태로 배시 명령어를 추가할 수 있습니다.\n\n* 구조\n\n```\n---\nallowed-tools: Bash(git add:*), Bash(git status:*), Bash(git commit:*)\nargument-hint: [message]\ndescription: Create a git commit\nmodel: claude-3-5-haiku-20241022\n---\n\nCreate a git commit with message: $ARGUMENTS\n```\n\nallowed-tools: 명령어가 사용할 수 있는 도구 목록\n\nargument-hint: 슬래시 명령어에 필요한 인수\n\ndescription: 명령어의 간단한 설명\n\nmodel: 특정 모델 문자열\n\ndisable-model-invocation: 슬래시 명령어가 호출하지 말아야 하는 명령어\n\n* 깃 변경 사항을 읽어 커밋 메시지 만들기\n\n.claude/commands/bash-command.md\n\n```markdown\n---\nallowed-tools: Bash(git add:*), Bash(git status:*), Bash(git commit:*)\ndescription: Create a git commit\n---\n\n## Context\n\n- Current git status: !`git status`\n- Current git diff (staged and unstaged changes): !`git diff HEAD`\n- Current branch: !`git branch --show-current`\n- Recent commits: !`git log --oneline -10`\n\n## Your task\n\nBased on the above changes, create a single git commit.\n```\n\n* 명령어 사용\n\n```\n\u003e /bash-command\n\n\u003e /bash-command is running… \n  ⎿  Allowed 3 tools for this command\n\n⏺ I can see there's a modification to README.md that adds documentation about bash\n   command execution in command definitions. Let me create a commit for this\n  change.\n\n⏺ Bash(git add README.md \u0026\u0026 git commit -m \"Add documentation for bash command\n      execution in custom commands…)\n  ⎿ [main 5fb2eb9] Add documentation for bash command execution in custom command\n    s\n     1 file changed, 22 insertions(+)\n\n\n⏺ Bash(git status)\n  ⎿  On branch main                                              \n     Changes not staged for commit:\n       (use \"git add \u003cfile\u003e...\" to update what will be committed)\n     … +4 lines (ctrl+o to expand)\n\n⏺ Commit created successfully! The changes to README.md have been committed with\n  the message documenting the new bash command execution feature.\n\n  I notice there's also a modification to .claude/bash-command-log.txt, which\n  appears to be a log file. Would you like me to commit that as well, or should we\n   ignore log files?\n```\n\n깃 로그를 살펴보면 다음과 같이 로그가 생성된 것을 확인할 수 있습니다.\n\n```bash\n$ git log\n\ncommit 5fb2eb93632702846b8d7f1bf344cba7f97fa2fc (HEAD -\u003e main)\nAuthor: pjt3591oo \u003cpjt3591oo@maskit.co.kr\u003e\nDate:   Thu Oct 30 04:48:28 2025 +0900\n\n    Add documentation for bash command execution in custom commands\n    \n    Added Korean documentation explaining how to use !`bash command` syntax in command definition markdown files, with a practical example showing git-related commands.\n    \n    🤖 Generated with [Claude Code](https://claude.com/claude-code)\n    \n    Co-Authored-By: Claude \u003cnoreply@anthropic.com\u003e\n\ncommit 72c2cda2ec614f5f3ef28e56262e9c6e44a1046a\nAuthor: pjt3591oo \u003cpjt3591oo@maskit.co.kr\u003e\nDate:   Thu Oct 30 04:47:24 2025 +0900\n\n    first commit\n```\n\n### 네이티브 명령어 지원\n\n클로드 코드는 네이티브 수준에서 기본 명령어를 제공합니다.\n\n/mcp, /plugin, /hook, /agents 등\n\n사용 가능한 명령어는 클로드 프롬프트에 /를 입력하면 사용 가능한 명령어 목록을 확인할 수 있습니다.\n\n```\n──────────────────────────────────────────────────────────────────────────────────────\n\u003e / \n──────────────────────────────────────────────────────────────────────────────────────\n  /doctor                          Diagnose and verify your Claude Code installation\n                                   and settings\n  /exit (quit)                     Exit the REPL\n  /export                          Export the current conversation to a file or\n                                   clipboard\n  /feedback (bug)                  Submit feedback about Claude Code\n  /help                            Show help and available commands\n  /hooks                           Manage hook configurations for tool events\n  /ide                             Manage IDE integrations and show status\n  /init                            Initialize a new CLAUDE.md file with codebase\n                                   documentation\n  /install-github-app              Set up Claude GitHub Actions for a repository\n  /login                           Sign in with your Anthropic account\n\n```\n\n## hooks\n\n`/hooks` 명령어를 통해 훅 관리 가능\n\n### 이벤트\n\n```\nPreToolUse: 도구 호출 전에 실행됩니다 (차단 가능)\nPostToolUse: 도구 호출 완료 후 실행됩니다\nUserPromptSubmit: 사용자가 프롬프트를 제출할 때, Claude가 처리하기 전에 실행됩니다\nNotification: Claude Code가 알림을 보낼 때 실행됩니다\nStop: Claude Code가 응답을 완료할 때 실행됩니다\nSubagentStop: 하위 에이전트 작업이 완료될 때 실행됩니다\nPreCompact: Claude Code가 압축 작업을 실행하려고 할 때 실행됩니다\nSessionStart: Claude Code가 새 세션을 시작하거나 기존 세션을 재개할 때 실행됩니다\nSessionEnd: Claude Code 세션이 종료될 때 실행됩니다\n```\n\n### 훅 추가\n\n```\n\u003e /hook\n\n╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮\n│ Hook Configuration                                                                                               │\n│                                                                                                                  │\n│ Hooks are shell commands you can register to run during Claude Code processing. Docs                             │\n│ • Each hook event has its own input and output behavior                                                          │\n│ • Multiple hooks can be registered per event, executed in parallel                                               │\n│ • Any changes to hooks outside of /hooks require a restart                                                       │\n│ • Timeout: 60 seconds                                                                                            │\n│                                                                                                                  │\n│ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────│\n│ │ ⚠ CRITICAL SECURITY WARNING - USE AT YOUR OWN RISK                                                             │\n│ │ Hooks execute arbitrary shell commands with YOUR full user permissions without confirmation.                   │\n│ │ • You are SOLELY RESPONSIBLE for ensuring your hooks are safe and secure                                       │\n│ │ • Hooks can modify, delete, or access ANY files your user account can access                                   │\n│ │ • Malicious or poorly written hooks can cause irreversible data loss or system damage                          │\n│ │ • Anthropic provides NO WARRANTY and assumes NO LIABILITY for any damages resulting from hook usage            │\n│ │ • Only use hooks from trusted sources to prevent data exfiltration                                             │\n│ │ • Review the hooks documentation before proceeding                                                             │\n│ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────│\n│                                                                                                                  │\n│ Select hook event:                                                                                               │\n│ ❯ 1.  PreToolUse - Before tool execution                                                                         │\n│   2.  PostToolUse - After tool execution                                                                         │\n│   3.  Notification - When notifications are sent                                                                 │\n│   4.  UserPromptSubmit - When the user submits a prompt                                                          │\n│ ↓ 5.  SessionStart - When a new session is started                                                               │\n╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯\n   Enter to acknowledge risks and continue · Esc to exit\n```\n\nselect hook event: 목록중 하나 적절히 선택 1번을 선택하면 다음과 같이 `1. + add new matcher` 를 선택 하라고 나옴.\n\n```\n╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮\n│ PreToolUse - Tool Matchers                                                                                       │\n│                                                                                                                  │\n│ Input to command is JSON of tool call arguments.                                                                 │\n│ Exit code 0 - stdout/stderr not shown                                                                            │\n│ Exit code 2 - show stderr to model and block tool call                                                           │\n│ Other exit codes - show stderr to user only but continue with tool call                                          │\n│                                                                                                                  │\n│ ❯ 1. + Add new matcher…  No matchers configured yet                                                              │\n│                                                                                                                  │\n╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯\n   Enter to select · Esc to go back\n\n```\n\n1번을 선택하면 다음과 같이 PreToolUser는 matcher로 지정된 툴(여기서의 툴은 권한을 의미합니다.)이 호출되면, 특정 동작을 수행합니다.\n\n여기서는 `Bash` 를 명시합니다. 만약 모든 도구를 사용허가를 한다면 `*` 입력하면 됩니다.\n\n다음과 같이 실제 어떤 동작을 할지 추가하라고 나옵니다.\n\n```\n╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮\n│ PreToolUse - Matcher: bash                                                                                       │\n│                                                                                                                  │\n│ Input to command is JSON of tool call arguments.                                                                 │\n│ Exit code 0 - stdout/stderr not shown                                                                            │\n│ Exit code 2 - show stderr to model and block tool call                                                           │\n│ Other exit codes - show stderr to user only but continue with tool call                                          │\n│                                                                                                                  │\n│ ❯ 1. + Add new hook…  No hooks configured yet                                                                    │\n│                                                                                                                  │\n╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯\n   Enter to select · Esc to go back\n```\n\n1번을 선택하면 훅의 실질적인 동작을 정의할 수 있습니다.\n\n```\n╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮\n│ Add new hook                                                                                                                                     │\n│                                                                                                                                                  │\n│ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────│\n│ │ ⚠ CRITICAL SECURITY WARNING                                                                                                                    │\n│ │ Hooks execute arbitrary shell commands with YOUR full user permissions. By proceeding, you acknowledge:                                        │\n│ │ • You are SOLELY responsible for any commands you configure                                                                                    │\n│ │ • Hooks can modify, delete, or access ANY files your user can access                                                                           │\n│ │ • Anthropic provides NO WARRANTY and assumes NO LIABILITY for damages                                                                          │\n│ │ • USE AT YOUR OWN RISK - Test thoroughly before production use                                                                                 │\n│ │ • Review the hooks documentation before proceeding                                                                                             │\n│ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────│\n│                                                                                                                                                  │\n│ Event: PreToolUse - Before tool execution                                                                                                        │\n│                                                                                                                                                  │\n│ Input to command is JSON of tool call arguments.                                                                                                 │\n│ Exit code 0 - stdout/stderr not shown                                                                                                            │\n│ Exit code 2 - show stderr to model and block tool call                                                                                           │\n│ Other exit codes - show stderr to user only but continue with tool call                                                                          │\n│                                                                                                                                                  │\n│ Matcher: bash                                                                                                                                    │\n│                                                                                                                                                  │\n│ Command:                                                                                                                                         │\n│                                                                                                                                                  │\n│ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────│\n│ │                                                                                                                                                │\n│ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────│\n│                                                                                                                                                  │\n│ Examples:                                                                                                                                        │\n│ • jq -r '.tool_input.file_path | select(endswith(\".go\"))' | xargs -r gofmt -w                                                                    │\n│ • jq -r '.tool_input | \\\"[\\\" + (.description // \\\"No description\\\") + \\\"] \\\" + .command' \u003e\u003e \\\"$CLAUDE_PROJECT_DIR/.claude/bash-command-log.txt\\\" │\n│ • /usr/local/bin/security_check.sh                                                                                                               │\n│ • python3 ~/hooks/validate_changes.py                                                                                                            │\n│                                                                                                                                                  │\n│                                                                                                                                                  │\n│ ⚠ Security Best Practices:                                                                                                                       │\n│ • Use absolute paths for custom scripts (~/scripts/check.sh not check.sh)                                                                        │\n│ • Avoid using sudo - hooks run with your user permissions                                                                                        │\n│ • Be cautious with patterns that match sensitive files (.env, .ssh/*, secrets.*)                                                                 │\n│ • Validate and sanitize input paths (reject ../ paths, check expected formats)                                                                   │\n│ • Avoid piping untrusted content to shells (curl ... | sh, | bash)                                                                               │\n│ • Use restrictive file permissions (chmod 644, not 777)                                                                                          │\n│ • Quote all variable expansions to prevent injection: \"$VAR\"                                                                                     │\n│ • Keep error checking enabled in scripts (avoid set +e)                                                                                          │\n│ By adding this hook, you accept all responsibility for its execution and any consequences.                                                       │\n╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯\n   Enter to confirm · Esc to cancel\n```\n\n여기서는 다음과 같이 정의하도록 했습니다. 해당 명령어는 실행된 명령어를 ./.claude/bash-command-log.txt에 저장합니다.\n\n```\njq -r '.tool_input | \\\"[\\\" + (.description // \\\"No description\\\") + \\\"] \\\" + .command' \u003e\u003e \\\"$CLAUDE_PROJECT_DIR/.claude/bash-command-log.txt\\\"\n```\n\n훅을 정의하면 어느 경로에서 관리할지 나옵니다. 여기서는 적절히 원하는 경로를 선택하면 됩니다. \n\n```\n╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮\n│ Save hook configuration                                                                                                                          │\n│                                                                                                                                                  │\n│   Event: PreToolUse - Before tool execution                                                                                                      │\n│   Matcher: bash                                                                                                                                  │\n│   Command: jq -r '\"\\(.tool_input.command) - \\(.tool_input.description // \"No description\")\"' \u003e\u003e ~/.claude/bash-command-log.txt                   │\n│                                                                                                                                                  │\n│ Where should this hook be saved?                                                                                                                 │\n│                                                                                                                                                  │\n│ ❯ 1. Project settings (local)   Saved in .claude/settings.local.json                                                                             │\n│   2. Project settings           Checked in at .claude/settings.json                                                                              │\n│   3. User settings              Saved in at ~/.claude/settings.json                                                                              │\n╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯\n```\n\n저장이 된다면 다음과 같이 결과를 확인 가능 \n\n`.claude/settings.local.json` 형태로 관리됨\n\nsettings.local.json은 로컬 전용이므로 깃에 의해 관리되지 않습니다. .gitignore에 추가하지 않더라도 깃에 올라가지 않습니다.\n\n```\n╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮\n│ PreToolUse - Matcher: bash                                                                                                                       │\n│                                                                                                                                                  │\n│ Input to command is JSON of tool call arguments.                                                                                                 │\n│ Exit code 0 - stdout/stderr not shown                                                                                                            │\n│ Exit code 2 - show stderr to model and block tool call                                                                                           │\n│ Other exit codes - show stderr to user only but continue with tool call                                                                          │\n│                                                                                                                                                  │\n│   1. + Add new hook…                                                                                                                             │\n│ ❯ 2. jq -r '\"\\(.tool_input.command) - \\(.tool_input.description // \"No description\")\"' \u003e\u003e ~/.claude/bash-command-log.txt   Local Settings        │\n│                                                                                                                                                  │\n╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯\n   Enter to select · Esc to go back\n\n```\n\n생성된 훅 파일은 다음과 같습니다. 앞의 일련의 과정을 거치지 않고 .claude 아래에 `settings.*.json` 형태로 저장하면 훅 정의가 완료 됩니다.\n\n```json\n  {\n    \"hooks\": {\n      \"PreToolUse\": [\n        {\n          \"matcher\": \"Bash\",\n          \"hooks\": [\n            {\n              \"type\": \"command\",\n              \"command\": \"jq -r '.tool_input | \\\"[\\\" + (.description // \\\"No description\\\") + \\\"] \\\" + .command' \u003e\u003e \\\"$CLAUDE_PROJECT_DIR/.claude/bash-command-log.txt\\\"\"\n            }\n          ]\n        }\n      ]\n    }\n  }\n```\n\n### 훅 호출 테스트\n\n클로드를 재시작 한 후 아무런 bash 명령어를 수행합니다.\n\n```bash\n$ claude\n\n ▐▛███▜▌   Claude Code v2.0.27\n▝▜█████▛▘  Sonnet 4.5 · Claude Max\n  ▘▘ ▝▝    /Users/jeongtae/Desktop/claude-sub-agent-playground\n\n\u003e pwd \n\n⏺ I'll show you the current working directory.\n\n⏺ Bash(pwd)\n  ⎿  /Users/jeongtae/Desktop/claude-sub-agent-playground\n\n⏺ The current working directory is /Users/jeongtae/Desktop/claude-sub-agent-playground.\n```\n\n```\n$ cat .claude/bash-command-log.txt\n\n[Print current working directory] pwd\n\n```\n\n## sub agents(별도의 컨텍스트를 가짐)\n\n클로드 코드의 서브 에이전트는 사용자에 의해 명시적 또는 간전접으로 호출 가능하다.\n\n### 에이전트 정의\n\n서브 에이전트를 위해 `.claude/agents` 또는 `~/.claude/agents` 아래에 마크다운 형식으로 에이전트를 정의할 수 있다.\n\n```markdown\n---\nname: agent-name\ndescription: Brief description when to use this agent\ntools: tool1,tool2,tool3\ncolor: blue\n---\n\n# Agent Name\n\n[Agent의 역할과 책임에 대한 상세 설명]\n\n## Instructions\n[구체적인 작업 지침]\n\n## Best Practices\n[따라야 할 모범 사례]\n\n## Examples\n[작업 예시]\n```\n\nname: 에이전트 이름 (필수)\n\ndescription: 에이전트 설명 (필수)\n\ntools: 에이전트 권한(선택)\n\ntools는 read, write, edit, grep, file_search, bash, MCP 도구\n\ncolor: 클로드 코드에서 해당 에이전트가 호출될 때 표시할 색상\n\n그리고 그 아래는 에이전트가 실제로 어떻게 수행해야 하는지에 대한 본문\n\n\n### 에이전트 호출\n\n에이전트는 직접적, 간접적호출 가능\n\n```claude\n\u003e 이 PR을 리뷰해줘\n# → code-reviewer 자동 활성화\n```\n\n```claude\n\u003e @code-reviewer 이 파일 검토해줘\n```\n\n## skill(별도의 컨텍스트를 가지지 않음)\n\nskill은 agent와 유사하지만 동작 메커니즘이 다름. \n\nskill은 MCP로 비유를 하면 실제 로직이 호출되는 tool(sub agent의 tool과 다른 개념, 실제 작업을 처리하는 함수) \n\n클로드 코드의 스킬 사용을 위해 `.claude/skills/[스킬 이름]/SKILL.md` 또는 `~/.claude/skills/[스킬이름]/SKILL.md` 아래에 마크다운 형식으로 스킬을 정의할 수 있다.\n\nskill을 관리하는 별도의 명령어 없음.(서브 에이전트, 플러그인, 훅은 /agent, /plugin, /hook 명령어를 가짐)\n\n### skill 구조\n\nSKILL.md는 다음과 같이 정의할 수 있다.\n\n```markdown\n---\nname: skill-name\ndescription: Brief description of what this skill does and when to use it\nallowed-tools: Read, Grep, Glob\n---\n\n# Skill Name\n\n[Skill의 목적과 사용 시나리오]\n\n## Overview\n[기능 개요]\n\n## Prerequisites\n[필요한 도구/라이브러리]\n\n## Instructions\n[단계별 지침]\n\n## Examples\n[사용 예시]\n\n## Best Practices\n[모범 사례]\n\n## Troubleshooting\n[문제 해결]\n```\n\n스킬은 실제 작업을 수행하는 요소로서 좀 더 복잡한 구조를 가짐\n\n```\n.claude/skills/greet_user/\n└── SKILL.md           # 메인 가이드 (필수)\n├── examples.md        # 옵션\n├── reference.md       # 옵션\n├── scripts            # 옵션\n│   └── hello.py\n└── templates          # 옵션\n    └── template.txt\n```\n\n### 사용 가능 스킬 목록 조회\n\n스킬 목록은 별도의 커맨드는 존재하지 않고 클로드에게 다음과 같이 요청시 알려줌\n\n```claude\n\u003e What Skills are available?\n\n\u003e List all available Skills\n```\n\n### 스킬 사용\n\n```claude\n\u003e 정태 사용자에게 인사 \n  ⎿  ⧉ Selected 4 lines from .claude/skills/greet_user/templates/template.txt in Visual Studio Code\n\n⏺ I'll use the greet_user skill to greet 정태:\n\n─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────\n Use skill “greet_user”?\n Claude may use instructions, code, or files from this Skill.\n\n   인사할 사용자의 이름 (project)\n\n Do you want to proceed?\n ❯ 1. Yes\n   2. Yes, and don't ask again for greet_user in /Users/jeongtae/Desktop/claude-sub-agent-playground\n   3. No, and tell Claude what to do differently (esc)\n```\n\n```claude\n\u003e 정태 사용자에게 인사 \n  ⎿  ⧉ Selected 4 lines from .claude/skills/greet_user/templates/template.txt in Visual Studio Code\n\n⏺ I'll use the greet_user skill to greet 정태:\n\n\u003e The \"greet_user\" skill is running \n\n\u003e The \"greet_user\" skill is running \n\n⏺ I'll run the greet_user skill for 정태. Let me execute the hello.py script with the name \"정태\":\n\n⏺ Bash(cd /Users/jeongtae/Desktop/claude-sub-agent-playground/.claude/skills/greet_user \u0026\u0026 python scripts/hello.py 정태)\n  ⎿  Running…\n\n─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────\n Bash command\n\n   cd /Users/jeongtae/Desktop/claude-sub-agent-playground/.claude/skills/greet_user \u0026\u0026 python scripts/hello.py 정태\n   Run greeting script for 정태\n\n Do you want to proceed?\n ❯ 1. Yes\n   2. Yes, and don't ask again for python scripts/hello.py commands in /Users/jeongtae/Desktop/claude-sub-agent-playground\n   3. No, and tell Claude what to do differently (esc)\n```\n\n### sub agent와 skill의 관계\n\n서브 에이전트는 호출하는 에이전트와 별도의 컨텍스트를 가진다.\n\n스킬은 호출하는 에이전트의 컨텍스트를 가진다.\n\n```\n┌─────────────────────────────────────────────┐\n│           Sub-agent                         │\n│  ┌─────────────────────────────────┐       │\n│  │ tools: read,bash  (권한)        │       │\n│  └─────────────────────────────────┘       │\n│             ↓ 참조                          │\n│  ┌─────────────────────────────────┐       │\n│  │ Skills (지식/가이드)             │       │\n│  │ - 배포 절차                      │       │\n│  │ - 코딩 표준                      │       │\n│  │ - 체크리스트                     │       │\n│  └─────────────────────────────────┘       │\n│             ↓                               │\n│      실제 작업 수행                          │\n│  (권한 범위 내에서 가이드대로)              │\n└─────────────────────────────────────────────┘\n```\n\n### 스킬을 사용하는 서브 에이전트 정의\n\n에이전트의 워크 플로우에서 참조할 스킬 명시.\n\n```markdown\n---\nname: greeting-manager\ndescription: Greeting message specialist. Creates personalized greetings in multiple languages. Use for greeting generation, welcome messages, or hello text.\ntools: bash,read\n---\n\n# Greeting Manager\n\nYou are a specialist in generating personalized greeting messages. You use the greet_user skill to create greetings efficiently.\n\n## Your Responsibilities\n\n1. Generate greetings for individuals or groups\n2. Support multiple languages (English, Korean)\n3. Create custom greeting messages\n4. Handle batch greeting generation\n\n## How to Work\n\n### Step 1: Always Use the Greeting Generator Skill\n\n**CRITICAL:** Before generating any greeting, read the greet_user skill:\n```bash\ncat ~/.claude/skills/greet_user/SKILL.md\n```\n\nThis skill contains all the procedures and scripts you need.\n\n### Step 2: Use the Script\n\nAfter reading the skill, use the `hello.py` script:\n```bash\npython ~/.claude/skills/greet_user/scripts/hello.py NAME\n```\n\n### Step 3: Provide Results\n\nReturn the generated greeting to the user in a friendly format.\n\n## Examples\n\n### Example 1: Single Greeting\n```bash\n# Read the skill first\ncat ~/.claude/skills/greet_user/SKILL.md\n\n# Generate greeting\npython ~/.claude/skills/greet_user/scripts/hello.py Alice\n```\n\n### Example 2: Multiple Greetings\n```bash\n# For multiple people\nfor name in Alice Bob Charlie; do\n  python ~/.claude/skills/greet_user/scripts/hello.py \"$name\"\ndone\n```\n\n### Example 3: Korean Greeting\n```bash\npython ~/.claude/skills/greet_user/scripts/hello.py 정태\n```\n\n## Important Rules\n\n### ✅ Always Do\n- Read the greeting-generator skill FIRST\n- Use the provided scripts (don't recreate them)\n- Validate language codes (en, ko only)\n- Format output nicely for the user\n\n### ❌ Never Do\n- Create greetings without using the skill\n- Modify the skill scripts\n- Support languages not in the skill\n\n## Workflow\n```\nUser Request\n    ↓\nRead greeting-generator skill\n    ↓\nUnderstand available languages \u0026 usage\n    ↓\nExecute hello.py script\n    ↓\nReturn formatted result\n```\n\n## Your Personality\n\n- Friendly and welcoming\n- Efficient and direct\n- Always follow the skill's procedures\n- Provide clear, formatted output\n```\n\n### skills과 slash commands의 구분\n\n동작 방식을 보면 skill과 slash commands의 구분이 모호할 수 있습니다. \n\n* 복잡도\n\nslash command \u003c skills\n\n* 구조\n\nslash command: 단일 .md 파일, 단일 파일로 정의됨\n\nskills: **SKILL.md** 리소스가 있는 디렉토리, 여러 파일을 가짐(스크립트, 템필릿 등)\n\n* 사용\n\nslash command: /(슬래시)를 이용한 명시적인 호출\n\nskills: 컨텍스트 기반 자동으로 호출\n\n\n* 공통점\n\n~/.claude 또는 .claude/ 아래에서 관리\n\n.claude/ 아래에 관리될 경우 깃을 통해 공유 가능\n\n| 측면 | 슬래시 명령어 | 에이전트 스킬 |\n| --- | --- | --- |\n| **복잡성** | 간단한 프롬프트 | 복잡한 기능 |\n| **구조** | 단일 .md 파일 | `SKILL.md` + 리소스가 있는 디렉토리 |\n| **발견** | 명시적 호출 ( `/command` ) | 자동 (컨텍스트 기반) |\n| **파일** | 한 파일만 | 여러 파일, 스크립트, 템플릿 |\n| **범위** | 프로젝트 또는 개인 | 프로젝트 또는 개인 |\n| **공유** | git을 통해 | git을 통해 |\n\n## plugin \n\n클로드 코드가 제공하는 커맨드, 에이전트, 스킬, 훅 등을 손쉽게 공유하여 사용 가능\n\n### 플러그인 구조\n\n```\nmy-first-plugin/\n├── .claude-plugin/\n│   └── plugin.json          # Plugin metadata\n├── commands/                 # Custom slash commands (optional)\n│   └── hello.md\n├── agents/                   # Custom agents (optional)\n│   └── helper.md\n├── skills/                   # Agent Skills (optional)\n│   └── my-skill/\n│       └── SKILL.md\n└── hooks/                    # Event handlers (optional)\n    └── hooks.json\n```\n\n* plugin.json\n\n```json\n{\n  \"name\": \"my-first-plugin\",\n  \"description\": \"A simple greeting plugin to learn the basics\",\n  \"version\": \"1.0.0\",\n  \"author\": {\n    \"name\": \"Your Name\"\n  }\n}\n```\n\n### 마켓 플레이스 추가\n\n플러그인을 이용하기 위해 플러그인의 위치가 어디있는지 정의가 필요함.\n\n```claude\n\u003e /plugin marketplace add ./\n```\n\n### 플러그인 설치\n\n마켓 플레이스에 정의된 plugins 설치 가능.\n\n```claude\n\u003e /plugin install my-first-plugin\n```\n\n\n\n### 사용\n\n다음과 같이 호출 가능 `/[플러그인 이름]:[커맨드|에이전트|스킬|훅]`\n\n```claude\n\u003e /my-first-plugin:hello\n```\n\n## 마지막\n\n본문을 통해 클로드 코드 워크플로우 구축을 위한 필요한 내용을 살펴보았습니다. 혹시 본인만의 워크플로우가 있다면 공유해주세요~","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpjt3591oo%2Fclaude-code-advanced-guide","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpjt3591oo%2Fclaude-code-advanced-guide","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpjt3591oo%2Fclaude-code-advanced-guide/lists"}