Claude Code 자율 운영을
안전하게 만드는 106편의 한국어 가이드.
cc-guard는 Claude Code를 자율 운영에 안전하게 쓰기 위한 오픈소스 Hook · 도구 · 사고 사례 모음입니다. 106편의 문서가 9개 카테고리로 정리되어, rm -rf · force push · 시크릿 유출 · 토큰 폭증 같은 사고를 사전에 막습니다.
- 문서
- 106편
- 예시 Hooks
- 772
- 브라우저 도구
- 28
- 기업 내부 누적설치
- 13K+
시작하기
cc-guard를 처음 도입할 때 봐야 할 입문 · 데모 · FAQ 모음.
7 Common Hook Mistakes (and How to Fix Them)
The most common Claude Code hook mistakes: syntax errors that block all tools, wrong matchers, missing jq, and more. Each with a fix.
cc-guard Live Demo — See Hooks in Action
Try cc-guard without installing. See how hooks block rm -rf, force-push, and credential leaks in real-time.
cc-guard: Claude Code Safety Hub
772 example hooks, 56 commands, 28 browser tools, 30K+ total installs. Make Claude Code safe for autonomous operation. Prevents rm -rf, database destruction, force-push, secret leaks, and more.
Claude Code Hooks by Example — Real Incidents, Real Fixes
Every hook was born from a real incident. See the before/after for each one.
Claude Code Hooks Cheat Sheet
Claude Code Hooks Cheat Sheet — Copy-Paste Patterns
30+ copy-paste hook patterns for Claude Code. Block dangerous commands, auto-approve safe ones, monitor costs. One page, zero fluff.
Claude Code Hooks FAQ — Every Question Answered
Answers to every common question about Claude Code hooks. Why hooks? How do they work? What about performance?
Claude Code Safety Audit & Setup Generator
Audit your Claude Code settings and generate safety hooks — 100% in your browser. No npm required.
Getting Started — Make Claude Code Safe in 5 Minutes
Install Claude Code safety hooks in 30 seconds. Prevents rm -rf disasters, production database destruction, force-push to main, secret leaks. Step-by-step for beginners. npx @gaebalai/cc-guard.
Opus 4.7 대응
Opus 4.7 출시 이후 비용 폭증 · 데이터 손실 사고 대응 자료.
Claude Code Opus 4.7 Survival Guide — Known Issues, Fixes, and Safety Hooks
Opus 4.7 has critical bugs: 4x token consumption, data loss (50GB+), classifier failures. Here are the hooks and fixes that protect your work right now.
How to Downgrade from Opus 4.7 to Opus 4.6 — Claude Code Guide
Opus 4.6 was removed from the Desktop model picker. Here
Opus 4.7 Cost Estimator — How Much Is the Upgrade Costing You?
Calculate how much extra Opus 4.7 costs compared to 4.6. Input your usage pattern, get estimated monthly cost and savings potential.
Opus 4.7 Cost Impact Calculator — How Much Extra Are You Paying?
Calculate how much extra Opus 4.7 bugs are costing you. Input your plan and usage to see the hidden token inflation, cache bugs, and system overhead — and how much you could save.
Opus 4.7 Data Loss Crisis — 47+ Bugs, 50GB Lost, and How to Protect Yourself
Opus 4.7 caused 20+ data loss incidents in 3 days. Auto mode classifier failure, 4x token burn, prompt cache destruction. Here are the hooks that stop it.
Opus 4.7 Safety Scanner — Is Your Claude Code Protected?
Paste your settings.json to check if you
사고 예방 (Prevent)
rm -rf · force push · 시크릿 유출 등 자율 운영 사고를 막는 18종 패턴.
Prevent Accidental npm publish from Claude Code — cc-guard
Claude Code can accidentally run npm publish and push unfinished code to the public registry. Block it with a PreToolUse hook. Works in Auto Mode.
Prevent Claude Code --no-verify Bypass — cc-guard
Claude Code used --no-verify on 6 consecutive commits, bypassing pre-commit hooks silently. Block it with a PreToolUse hook. One command: npx @gaebalai/cc-guard.
Prevent Claude Code bash -x Debug Tracing from Exposing Secrets — cc-guard
Claude Code running bash -x traces all commands including expanded secrets from .env files. One hook to prevent it.
Prevent Claude Code Cost Explosion — Rate Limit & Loop Protection
Claude Code can burn through your entire quota in minutes due to runaway loops. Real incidents from GitHub Issues. Prevent it with tool-call-rate-limiter and consecutive-error-breaker hooks.
Prevent Claude Code Force-Push to Main — cc-guard
Claude Code can force-push to main and rewrite shared branch history. Real incidents from autonomous sessions. One command to prevent it: npx @gaebalai/cc-guard.
Prevent Claude Code from Committing .env Files — cc-guard
Claude Code can git add .env and commit your API keys. A PreToolUse hook blocks .env from being staged, even with git add . or git add -A. Instant protection.
Prevent Claude Code from Dropping Your Database — cc-guard
Claude Code can run DROP DATABASE, prisma migrate reset, rails db:drop. A PreToolUse hook blocks destructive database commands. Protect your production data.
Prevent Claude Code from Installing Random Dependencies — cc-guard
Claude Code can run npm install, pip install, and add unwanted dependencies. Block unauthorized package installations with a PreToolUse hook.
Prevent Claude Code from Leaking Credentials — Hook Guide
Stop Claude Code from reading .netrc, .npmrc, .aws/credentials, and other credential files. Three hooks that prevent credential exposure in AI agent sessions.
Prevent Claude Code from Leaking Secrets — cc-guard
Claude Code can commit .env files, API keys, and credentials to public repos via git add. A PreToolUse hook catches it before the commit. npx @gaebalai/cc-guard.
Prevent Claude Code from Pushing Code After Context Compaction — cc-guard
After /compact, Claude autonomously pushes commits. A hook guards the vulnerable post-compaction period.
Prevent Claude Code git reset --hard Disasters — cc-guard
Claude Code can run git reset --hard and wipe all uncommitted work. Real incidents from GitHub Issues. One command to prevent it: npx @gaebalai/cc-guard.
Prevent Claude Code rm -rf Disasters — cc-guard
Claude Code can run rm -rf and delete your entire filesystem. Real incidents from GitHub Issues. One command to prevent it: npx @gaebalai/cc-guard.
Prevent Claude Code Session Drift After 6 Hours — cc-guard
Claude Code degrades after 6+ hours — ignoring rules, creating duplicates. A hook that progressively tightens safety.
Prevent Claude Code Shell Variable Expansion Disasters — cc-guard
Claude Code rm -rf with shell variables like ${LOCALAPPDATA} can delete system directories. One hook to prevent it.
Prevent Claude Code Syntax Errors Cascading — cc-guard
Claude Code can introduce syntax errors that cascade through dozens of files. A PostToolUse hook catches them immediately. npx @gaebalai/cc-guard.
Prevent Claude Code Temp File Accumulation — cc-guard
Claude Code creates hundreds of temp files in /tmp that are never cleaned up. Prevent disk exhaustion with a Stop hook that auto-deletes session artifacts.
Prevent Claude Code Token Waste from Excessive File Reading — cc-guard
Claude Code reads too many files, consuming 25% of token quota before working. A read budget hook.
Remove Co-Authored-By from Claude Code Commits — cc-guard
Claude auto-appends Co-Authored-By trailers to every commit. A hook to control or strip them.
Stop Claude Code from Retrying Denied Commands — cc-guard
Claude Code ignores
Hooks & 보안 설정
Hook 작성법 · 테스트 · 도메인 allowlist · 자율 모드 안전 가이드.
10 Hook Patterns Every Claude Code User Should Know
The 10 foundational patterns for writing Claude Code hooks. Block, approve, warn, log, validate, protect, limit, checkpoint, enforce, recover.
5 Claude Code Hooks That Save Tokens — Copy-Paste Ready
5 hooks that automatically reduce Claude Code token consumption. Copy-paste into settings.json. Blocks file spam, limits reads, caps subagents.
Auto-Approve Hooks for Claude Code — Skip Permission Prompts Safely
Stop clicking
Bash Domain Allowlist for Claude Code — Block Unauthorized HTTP Requests
Claude Code can run curl/wget to any domain. Block unauthorized HTTP requests with a PreToolUse hook that enforces a domain allowlist on Bash commands.
Claude Code Auto Mode Safety Guide — cc-guard
Auto Mode in Claude Code runs commands without asking. Here
Claude Code Autonomous Mode Safety — Complete Hook Setup — cc-guard
Running Claude Code unattended? 772 hooks to prevent rm -rf, force-push, secret leaks, and session drift.
Claude Code Hook if Field — Reduce Hook Overhead by 90% (v2.1.85)
Claude Code v2.1.85 adds the
Claude Code Pipe Mode Safety — Hooks Don't Fire in -p Mode
PreToolUse hooks don
Claude Code Quality Hooks — Detect Lazy Rewrites & Skipped Reads | cc-guard
Hooks to detect Claude Code quality degradation: lazy file rewrites, skipped code reads, untested commits. Based on AMD
Claude Code 멀티 에이전트 안전 운용 가이드
Claude Code에서 여러 AI 에이전트를 안전하게 동시에 가동하는 방법. 800시간의 자율 운용 경험에서 얻은 tmux 제어·파일 감시·3계층 아키텍처의 실전 패턴.
Enforce Command Allowlist in Claude Code — cc-guard
Claude Code
Essential Hooks for Claude Code Auto Mode — cc-guard
Claude Code Auto Mode skips confirmation prompts. Without hooks, rm -rf, force-push, and secret leaks happen silently. Install safety hooks before enabling Auto Mode.
Fix Claude Code WebFetch Domain Matching — cc-guard
WebFetch(domain:*) doesn
How to Test Claude Code Hooks — Validation Guide — cc-guard
9,228+ tests for 772 hooks. How to validate your hooks work correctly before trusting them in production.
OWASP MCP Top 10 — Claude Code Hook Defense Guide
Defend against all 10 OWASP MCP risks with Claude Code hooks. Token leaks, privilege escalation, tool poisoning, supply chain attacks — each with a working hook.
Running Claude Code Overnight — The Complete Checklist
Everything you need before leaving Claude Code running unattended. Git setup, hooks, monitoring, recovery plan.
Token & 비용
토큰 진단 · 비용 추적 · 컨텍스트 최적화 도구 모음.
Claude Code Token Consumption Diagnosis — Why Your Max Plan Runs Out Fast
Diagnose and fix excessive token consumption in Claude Code. Hooks to track prompts, detect auto-compact cycles, and reduce Max Plan usage.
Claude Code Token Optimization Guide — Cut Your Token Bill in Half (2026)
Reduce Claude Code token consumption by 50% with measured techniques. CLAUDE.md optimization, hook-based guards, context management. Based on 800 hours of real operation data. Updated for Opus 4.7.
Claude Code 토큰 절약 가이드 — 800시간 운용 데이터 기반의 실전 방법
Claude Code의 토큰 소비를 절반으로 줄이는 방법. Opus 4.7에서 최대 35% 증가한 토큰 비용에 대한 대책. CLAUDE.md 최적화, hook 활용, 모델 선택의 실측 데이터.
Token Audit — Deep Analysis of Your Claude Code Token Usage
Paste your /cost output and settings.json to get a detailed token optimization report with specific hook recommendations.
Token Checkup — Is Your Claude Code Burning Tokens?
Quick 5-question diagnostic to find where your Claude Code tokens are going. Get personalized optimization tips based on 800+ hours of operation data.
도구 & 진단
브라우저에서 바로 돌리는 계산기 · 진단기 · 검증기.
Cache Health Checker — Is Your Claude Code Cache Working?
Paste your /cost output to diagnose cache_creation inflation, TTL breakage, and token waste. Free tool from cc-guard.
Claude Code Attack Simulator — Can Your Setup Survive?
Paste your settings.json and watch 10 real attack scenarios play out. See which ones your hooks catch — and which ones slip through.
Claude Code Autonomous Pre-Flight Checklist
14-point safety checklist before running Claude Code autonomously. Print it. Share it. Never skip it.
Claude Code Cost Calculator — Opus 4.6 vs 4.7 Comparison
Calculate your Claude Code monthly cost. Compare Opus 4.6 vs 4.7 token consumption (+35%). See where tokens go and get optimization tips from 800+ hours of data.
Claude Code Effort Level Calculator — How Much Are You Overpaying?
Calculate how much you
Claude Code Failure-Mode Cluster Tracker
Public tracker for Claude Code structural failure clusters: sub-agent observability, multi-account, AGENTS.md interop, Pro Max quota anomaly, TUI UX, permission matching, Skills metadata, v2.1.150 server-side prompt injection, AUP false-positive on Opus. Issue counts, reactions, defense hooks shipped, upstream status.
Claude Code Risk Assessment — How Exposed Are You?
5-question risk assessment based on 90 real Claude Code incidents. Find out your risk level and get personalized safety recommendations.
Claude Code Safety Wizard — Find Your Setup in 30 Seconds
Answer 3 questions, get the exact commands to make Claude Code safe for your project.
Claude Code settings.json Validator
Paste your settings.json and get instant feedback: errors, missing hooks, security issues, and improvement suggestions.
Claude Code settings.json Validator — Check Your Hook Configuration
Paste your Claude Code settings.json to detect common hook mistakes. Free validator from cc-guard (700+ hooks).
Claude Code symptom search — find the fix from your error message
Search 109 pages of Claude Code incident write-ups, fix recipes, and prevention hooks by symptom keyword. Free, no signup.
Claude Code Version Health Check — Is Your Version Affected?
Check if your Claude Code version is affected by cache_creation inflation (#46917), TTL regression (#46829), or other known issues. Instant diagnosis with fix recommendations.
CLAUDE.md Analyzer — How Much Are Your Instructions Costing?
Paste your CLAUDE.md and see how many tokens it costs per turn. Find waste patterns and get optimization tips from 800+ hours of Claude Code operation.
Hook Builder — Claude Code
Generate Claude Code hooks from plain English. No coding required.
Hook Gap Analyzer — What Safety Hooks Are You Missing?
Paste your Claude Code settings.json and find out which safety hooks you
Hook Permission Checker — cc-guard
Paste your settings.json and check if all hook scripts exist and are executable. Diagnose Permission denied errors.
Hook Playground — Write, Test, and Debug Claude Code Hooks
Write Claude Code hooks in your browser. Test with sample inputs. See output instantly. No install needed.
Hook Selector — Find Your Perfect Claude Code Safety Setup
Answer 5 questions, get a personalized Claude Code safety hook configuration. Based on 800+ hours of autonomous operation experience.
Security Checkup — Is Your Claude Code Safe?
6-question diagnostic to find security vulnerabilities in your Claude Code setup. Based on real incidents: $1,446 unauthorized transfers, file deletions, PII leaks.
Which Hook Do I Need? — Interactive Decision Tree
Answer 3 questions to find the exact Claude Code hook you need. Interactive decision tree.
트러블슈팅 & 사고
이미 터진 사고를 복구하고 재발을 막는 사후 대응 가이드.
Claude Code Incident Tracker — Real Safety Issues from GitHub
80+ real Claude Code safety incidents tracked from GitHub Issues. File deletion, credential leaks, token drain, production outages. See why hooks matter.
Claude Code Outage Recovery — 3 Hooks That Saved My Work
Protect your Claude Code sessions from outages. 3 battle-tested hooks from 800+ hours of autonomous operation that prevent data loss during disconnections.
Claude Code Troubleshooting — Fix Any Problem in 2 Minutes
Hook not firing? Claude ignoring rules? Permission prompt spam? Fix every common Claude Code problem.
Claude Code v2.1.133 loads 2.9M tokens at Pro login (one-line fix)
On v2.1.133, Pro / Claude.ai-OAuth login can fill /context with 2.9 million tokens of System tools before you type anything. One environment variable disables the connector sync without losing OAuth.
Detect Claude Code Session Quality Degradation — cc-guard
Claude Code quality degrades after 6+ hours: more errors, ignored instructions, destructive actions. Monitor error rates with a PostToolUse hook and know when to restart.
Disable Claude Code Auto-Compaction — cc-guard
Stop Claude Code from auto-compacting your context. Use a PreCompact hook to block compaction entirely or conditionally. Preserve your full conversation history.
Fix `claude update` downloading 226 MB every time (Issue #51243)
Claude Code downloads the full release tarball (226 MB, ~30 s) on every `claude update` — even when already up-to-date. Open Issue, no upstream fix. Drop-in bash wrapper that checks the npm registry first.
Fix Claude Code Agent Bash Shell Hang — .bashrc Safety Check
Claude Code agents source .bashrc on every spawn, causing hangs from completion scripts (Angular, nvm, conda). Fix with a SessionStart hook that detects dangerous patterns.
Fix Claude Code Background Agent Write Permissions — cc-guard
Background agents in Claude Code can
Fix Claude Code git show --no-stat Error — cc-guard
Claude Code runs git show with invalid --no-stat flag, causing exit code 128 errors. Fix it automatically with a PreToolUse hook that strips the bad flag.
블로그 & 보고서
사례 분석 · 심층 보고서 · 깊이 있는 글.
3 Hooks That Make Claude Code Faster (Fewer Permission Prompts)
Reduce Claude Code permission prompts by 60%. Auto-approve safe git commands, skip redundant file reads, and batch approve test runs. Copy-paste ready hooks.
5 Hooks Every Claude Code User Should Install Today
Five copy-paste hooks that prevent rm -rf disasters, force-push to main, secret leaks, compaction death spirals, and token waste. Each one addresses a real GitHub Issue.
AI Coding Safety Report 2026 — Incidents Across All Major Tools
Cross-tool safety report covering real incidents from Claude Code, Cursor, GitHub Copilot, and Windsurf. Data loss, credential leaks, production failures, and token drain — documented with sources.
Anthropic's Security Review + cc-guard: Complete Defense for Claude Code
Anthropic
Claude Code Auto-Compact Death Spiral: How to Fix It
Auto-compact can loop infinitely and drain your entire token budget overnight. Here
Claude Code Extended Thinking Consumed 16 Million Tokens in 25 Minutes
Extended thinking can enter a runaway state and drain your entire Claude Code token quota in minutes. Here
Claude Code Token Cost Volatility: Why Your Bill Swings 2-3x (And How to Fix It)
42% of developers cite token cost volatility as their #1 pain point with AI coding tools. Here
How to Fix Subagent Permission Issues in Claude Code
Subagent permissions don
How to Stop Claude Code from Deleting Your Files
Claude Code has deleted 50 GB of user data, wiped SSH keys, and destroyed production databases. Here
레퍼런스 & 가이드
settings · matcher · events · ecosystem 등 단단한 참고 문서.
Claude Code Hook Events — When Does Each One Fire?
PreToolUse, PostToolUse, Stop, SubagentStop, UserPromptSubmit — when each fires, what data it receives, what it can do.
Claude Code Hook Exit Codes — The Complete Guide
Exit code 0 = allow. Exit code 2 = block. Exit code 1 = error (ignored). Bash syntax errors = exit 2 = accidental block. The full guide.
Claude Code Hook Recipes — Copy-Paste Solutions for Real Problems
30 hook recipes for Claude Code. Each solves a specific problem with copy-paste code. From permission prompt fatigue to silent file edits.
Claude Code Hooks — Migration Guide from Other AI Tools
Moving from Cursor, Windsurf, Aider, or Copilot to Claude Code? Here
Claude Code Hooks Ecosystem
Compare all Claude Code hook projects — features, language, stars, and installation methods.
Claude Code Hooks Matrix — 605 Hooks Collection
Interactive matrix of Claude Code hooks. Filter by trigger, category, and action type. 772 hooks available.
Claude Code Safety: Manual vs cc-guard vs Do Nothing
Compare three approaches to Claude Code safety: manual hooks, cc-guard, or no protection. Time, coverage, and maintenance compared.
Claude Code settings.json Complete Reference
Every settings.json field explained with examples. Hooks, permissions, env vars — the definitive reference.
CLAUDE.md Best Practices — Templates, Tips, and Common Mistakes
How to write an effective CLAUDE.md for Claude Code. 5 templates for different use cases, common mistakes to avoid, and how hooks enforce your rules.
CLAUDE.md Optimization Guide — Cut Token Costs by 40%
Optimize your CLAUDE.md to reduce Claude Code token consumption by 40%. Before/after examples, templates, and the 3-rule framework from 800+ hours of operation.
Hook Matchers — Which Tools Does Your Hook Apply To?
Complete matcher reference for Claude Code hooks. Bash, Edit, Write, Read, Agent — how to target specific tools.
자주 묻는 질문
cc-guard 도입 전 검토하는 분들이 가장 자주 묻는 질문 모음.
- cc-guard란 무엇인가요?
- cc-guard는 Anthropic Claude Code를 자율 운영(autonomous mode)에 안전하게 쓰기 위한 한국어 오픈소스 프로젝트입니다. 107편의 가이드, 772개의 예시 Hook, 브라우저 도구를 제공해 rm -rf · force push · 시크릿 유출 · 토큰 폭증 같은 사고를 사전에 차단합니다.
- cc-guard는 어떻게 설치하나요?
- GitHub 저장소(github.com/gaebalai/cc-guard)에서 원하는 Hook 스크립트를 복사해 ~/.claude/hooks/ 에 두고 settings.json의 PreToolUse · PostToolUse · SessionStart 매처에 등록합니다. /cc-guard/getting-started.html 가이드가 단계별 설치 절차를 안내합니다.
- Claude Code Hooks와 cc-guard의 차이는 무엇인가요?
- Claude Code Hooks는 Anthropic이 제공하는 PreToolUse · PostToolUse · SessionStart 등의 확장 포인트(매커니즘)이고, cc-guard는 그 매커니즘 위에 실제로 동작하는 안전 정책 모음(컨텐츠)입니다. cc-guard는 rm -rf 차단, force push 금지, .env 커밋 차단, 시크릿 유출 방지 등 구체적인 규칙을 즉시 적용 가능한 형태로 제공합니다.
- Opus 4.7로 업그레이드했을 때 가장 큰 위험은 무엇인가요?
- Opus 4.7은 컨텍스트 1M 토큰을 지원하지만 비용이 급증하고, 자율 실행 시 데이터 손실 사고(Opus 4.7 data loss crisis)가 보고되었습니다. cc-guard의 opus47-scanner · opus47-cost-estimator · opus-47-survival-guide 가이드가 위험 진단과 다운그레이드 절차를 제공합니다.
- Claude Code에서 rm -rf 같은 위험 명령을 어떻게 막나요?
- PreToolUse Hook에서 Bash 도구 호출의 command를 검사해 rm -rf · git reset --hard · DROP TABLE · 시크릿 파일 접근 같은 패턴을 차단합니다. /cc-guard/prevent-rm-rf.html · prevent-force-push.html · prevent-database-wipe.html 가이드가 즉시 사용 가능한 Hook 코드를 제공합니다.
- Claude Code 토큰 비용은 어떻게 진단·절감하나요?
- Token Checkup(/cc-guard/token-checkup.html)이 브라우저에서 .claude/projects의 JSONL 로그를 읽어 cache_read 비율, 컨텍스트 효율, 모델별 단가를 진단합니다. token-saving-hooks · token-optimization-guide 가이드로 SessionStart 압축, 캐시 히트율 개선 패턴을 적용할 수 있습니다.
