claudecode.to
cc-guard

Claude Code 자율 운영을
안전하게 만드는 106편의 한국어 가이드.

cc-guard는 Claude Code를 자율 운영에 안전하게 쓰기 위한 오픈소스 Hook · 도구 · 사고 사례 모음입니다. 106편의 문서가 9개 카테고리로 정리되어, rm -rf · force push · 시크릿 유출 · 토큰 폭증 같은 사고를 사전에 막습니다.

문서
106
예시 Hooks
772
브라우저 도구
28
기업 내부 누적설치
13K+

시작하기

cc-guard를 처음 도입할 때 봐야 할 입문 · 데모 · FAQ 모음.

9개 문서

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/common-mistakes.html

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/demo.html

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.

/cc-guard/hub.html

Claude Code Hooks by Example — Real Incidents, Real Fixes

Every hook was born from a real incident. See the before/after for each one.

/cc-guard/by-example.html

Claude Code Hooks Cheat Sheet

/cc-guard/cheatsheet.html

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.

/cc-guard/hooks-cheatsheet.html

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?

/cc-guard/faq.html

Claude Code Safety Audit & Setup Generator

Audit your Claude Code settings and generate safety hooks — 100% in your browser. No npm required.

/cc-guard/index-legacy.html

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.

/cc-guard/getting-started.html

사고 예방 (Prevent)

rm -rf · force push · 시크릿 유출 등 자율 운영 사고를 막는 18종 패턴.

20개 문서

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.

/cc-guard/prevent-npm-publish.html

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.

/cc-guard/prevent-no-verify-bypass.html

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.

/cc-guard/prevent-bash-debug-leak.html

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.

/cc-guard/prevent-cost-explosion.html

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.

/cc-guard/prevent-force-push.html

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.

/cc-guard/prevent-env-file-commit.html

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.

/cc-guard/prevent-database-wipe.html

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.

/cc-guard/prevent-dependency-bloat.html

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.

/cc-guard/prevent-credential-leak.html

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.

/cc-guard/prevent-secret-leaks.html

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.

/cc-guard/prevent-compact-autonomous-push.html

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.

/cc-guard/prevent-git-reset-hard.html

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.

/cc-guard/prevent-rm-rf.html

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.

/cc-guard/prevent-session-drift.html

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.

/cc-guard/prevent-variable-expansion.html

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.

/cc-guard/prevent-syntax-errors.html

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.

/cc-guard/prevent-temp-file-accumulation.html

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.

/cc-guard/prevent-token-waste.html

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.

/cc-guard/prevent-coauthored-by.html

Stop Claude Code from Retrying Denied Commands — cc-guard

Claude Code ignores

/cc-guard/prevent-denied-action-retry.html

Hooks & 보안 설정

Hook 작성법 · 테스트 · 도메인 allowlist · 자율 모드 안전 가이드.

16개 문서

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.

/cc-guard/hook-patterns.html

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.

/cc-guard/token-saving-hooks.html

Auto-Approve Hooks for Claude Code — Skip Permission Prompts Safely

Stop clicking

/cc-guard/auto-approve-guide.html

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.

/cc-guard/bash-domain-allowlist.html

Claude Code Auto Mode Safety Guide — cc-guard

Auto Mode in Claude Code runs commands without asking. Here

/cc-guard/claude-code-auto-mode-safety.html

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.

/cc-guard/claude-code-autonomous-safety.html

Claude Code Hook if Field — Reduce Hook Overhead by 90% (v2.1.85)

Claude Code v2.1.85 adds the

/cc-guard/hook-if-field-performance.html

Claude Code Pipe Mode Safety — Hooks Don't Fire in -p Mode

PreToolUse hooks don

/cc-guard/claude-code-pipe-mode-safety.html

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

/cc-guard/claude-code-quality-hooks.html

Claude Code 멀티 에이전트 안전 운용 가이드

Claude Code에서 여러 AI 에이전트를 안전하게 동시에 가동하는 방법. 800시간의 자율 운용 경험에서 얻은 tmux 제어·파일 감시·3계층 아키텍처의 실전 패턴.

/cc-guard/multi-agent-safety.html

Enforce Command Allowlist in Claude Code — cc-guard

Claude Code

/cc-guard/enforce-command-allowlist.html

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.

/cc-guard/claude-code-auto-mode-hooks.html

Fix Claude Code WebFetch Domain Matching — cc-guard

WebFetch(domain:*) doesn

/cc-guard/webfetch-domain-allowlist.html

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.

/cc-guard/claude-code-hooks-testing-guide.html

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.

/cc-guard/owasp-mcp-hooks.html

Running Claude Code Overnight — The Complete Checklist

Everything you need before leaving Claude Code running unattended. Git setup, hooks, monitoring, recovery plan.

/cc-guard/autonomous-checklist.html

도구 & 진단

브라우저에서 바로 돌리는 계산기 · 진단기 · 검증기.

20개 문서

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.

/cc-guard/cache-health.html

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.

/cc-guard/attack-simulator.html

Claude Code Autonomous Pre-Flight Checklist

14-point safety checklist before running Claude Code autonomously. Print it. Share it. Never skip it.

/cc-guard/preflight.html

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.

/cc-guard/cost-calculator.html

Claude Code Effort Level Calculator — How Much Are You Overpaying?

Calculate how much you

/cc-guard/effort-calculator.html

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.

/cc-guard/cluster-tracker.html

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.

/cc-guard/risk-assessment.html

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.

/cc-guard/wizard.html

Claude Code settings.json Validator

Paste your settings.json and get instant feedback: errors, missing hooks, security issues, and improvement suggestions.

/cc-guard/validator.html

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).

/cc-guard/settings-validator.html

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.

/cc-guard/search.html

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.

/cc-guard/version-check.html

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.

/cc-guard/claudemd-analyzer.html

Hook Builder — Claude Code

Generate Claude Code hooks from plain English. No coding required.

/cc-guard/builder.html

Hook Gap Analyzer — What Safety Hooks Are You Missing?

Paste your Claude Code settings.json and find out which safety hooks you

/cc-guard/hook-gap-analyzer.html

Hook Permission Checker — cc-guard

Paste your settings.json and check if all hook scripts exist and are executable. Diagnose Permission denied errors.

/cc-guard/permission-checker.html

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.

/cc-guard/playground.html

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.

/cc-guard/hook-selector.html

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.

/cc-guard/security-checkup.html

Which Hook Do I Need? — Interactive Decision Tree

Answer 3 questions to find the exact Claude Code hook you need. Interactive decision tree.

/cc-guard/which-hook.html

트러블슈팅 & 사고

이미 터진 사고를 복구하고 재발을 막는 사후 대응 가이드.

10개 문서

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.

/cc-guard/incidents.html

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.

/cc-guard/outage-recovery.html

Claude Code Troubleshooting — Fix Any Problem in 2 Minutes

Hook not firing? Claude ignoring rules? Permission prompt spam? Fix every common Claude Code problem.

/cc-guard/troubleshooting.html

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.

/cc-guard/claude-code-2-1-133-context-bloat-fix.html

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.

/cc-guard/session-quality-degradation.html

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.

/cc-guard/disable-auto-compaction.html

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.

/cc-guard/claude-update-fix.html

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.

/cc-guard/fix-bashrc-agent-hang.html

Fix Claude Code Background Agent Write Permissions — cc-guard

Background agents in Claude Code can

/cc-guard/background-agent-write-fix.html

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.

/cc-guard/fix-git-show-no-stat.html

블로그 & 보고서

사례 분석 · 심층 보고서 · 깊이 있는 글.

9개 문서

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.

/cc-guard/blog-speed-hooks.html

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.

/cc-guard/blog-5-essential-hooks.html

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.

/cc-guard/ai-coding-safety-report-2026.html

Anthropic's Security Review + cc-guard: Complete Defense for Claude Code

Anthropic

/cc-guard/blog-official-security-review-plus-hooks.html

Claude Code Auto-Compact Death Spiral: How to Fix It

Auto-compact can loop infinitely and drain your entire token budget overnight. Here

/cc-guard/blog-compaction-death-spiral.html

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

/cc-guard/blog-thinking-token-drain.html

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

/cc-guard/blog-token-cost-volatility.html

How to Fix Subagent Permission Issues in Claude Code

Subagent permissions don

/cc-guard/blog-subagent-permissions.html

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

/cc-guard/blog-prevent-file-deletion.html

레퍼런스 & 가이드

settings · matcher · events · ecosystem 등 단단한 참고 문서.

11개 문서

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.

/cc-guard/events.html

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.

/cc-guard/exit-codes.html

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.

/cc-guard/recipes.html

Claude Code Hooks — Migration Guide from Other AI Tools

Moving from Cursor, Windsurf, Aider, or Copilot to Claude Code? Here

/cc-guard/migration-guide.html

Claude Code Hooks Ecosystem

Compare all Claude Code hook projects — features, language, stars, and installation methods.

/cc-guard/ecosystem.html

Claude Code Hooks Matrix — 605 Hooks Collection

Interactive matrix of Claude Code hooks. Filter by trigger, category, and action type. 772 hooks available.

/cc-guard/matrix.html

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.

/cc-guard/compare.html

Claude Code settings.json Complete Reference

Every settings.json field explained with examples. Hooks, permissions, env vars — the definitive reference.

/cc-guard/settings-reference.html

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.

/cc-guard/claudemd-best-practices.html

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.

/cc-guard/claudemd-guide.html

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/matchers.html

자주 묻는 질문

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 압축, 캐시 히트율 개선 패턴을 적용할 수 있습니다.