Tabbit
ResourcesBlogModels
Tabbit LogoTabbit

Tabbit — The AI Browser that Works for You

Topics

  • AI Browser Resources
  • Agentic Browser Resources
  • Browser Downloads and Install Guides
  • Browser Comparisons
  • AI Browser Alternatives
  • Browser Productivity Resources

Popular Guides

  • AI Browser
  • Agentic Browser Download
  • Best AI Browser 2026: Top 9 Tested & Ranked
  • AI Browser Download
  • Free AI Browser
  • Best AI Browser 2026
  • AI Browser Comparison 2026
  • AI Browser for Windows
  • AI Browser for Mac
  • Chrome Alternative 2026

Events

  • Tabbit Skill Competition
  • KPOP SBTI Fandom Personality Test
  • Tabbit Campus Creator Program
  • fifi's Picks: AI Skills for Research Papers
  • User Survey

About

  • Tabbit Blog
  • Press & Media
Prompt guide
CommunityClaude Opus 4.7

Claude Opus 4.7: Complete cc-safe-setup Security Hooks Configuration

Original source

GitHub

Authoryurukusa

Source date2026-04-20

Tabbit curation2026-08-20

Read original

One-sentence takeaway

cc-safe-setup provides 910 security hooks that can block Claude Code's destructive operations (such as rm -rf, force-pushes, and git reset --hard) after one-command installation, while surfacing silent failures at tool boundaries, making it suitable for production environments and team collaboration.

Use cases

  • Suitable tasks:

    • Production code development (requiring strict security controls)

    • Team collaboration (preventing an Agent from accidentally modifying shared code)

    • Scenarios that require dangerous commands to be blocked (such as file deletion, force-pushes, and code resets)

    • Scenarios that require Token usage monitoring and budget management

    • Scenarios that require credential protection (preventing .env files from being modified)

  • Unsuitable tasks:

    • Rapid prototyping (security restrictions may reduce speed)

    • Personal experimental projects (strict security controls are unnecessary)

  • Applicable model version: Claude Opus 4.7

  • Applicable client, Agent, or API: Claude Code CLI

  • Recommended reasoning levels and parameters: high or xhigh (depending on task complexity)

Ready-to-use content

Installation methods

Method 1: One-command installation with npx (recommended)

npx github:yurukusa/cc-safe-setup

Method 2: Install as a Claude Code plugin

/plugin marketplace add yurukusa/cc-safe-setup
/plugin install safety-essentials@cc-safe-setup

Note: Do not use npx cc-safe-setup (the npm version), because the npm version remains at 29.8.0, while the current repository version is 30.0.4; 3 destructive commands are not blocked by the npm version.

Four core plugins

PluginWhat it blocks
safety-essentialsrm -rf, force-push, git reset --hard, writes to .env, package publish
git-protectionforce-push, direct pushes to main/master, hard reset, interactive rebase, git clean -fd
credential-guardwrites and edits to .env and service-account files, API keys in shell commands
token-guardreads over 100KB, a per-session read budget, subagent fan-out, a token budget that asks for /compact

Hook types

cc-safe-setup installs the following types of hooks:

  • PreToolUse: Blocks dangerous operations before tools execute

  • PostToolUse: Checks for and surfaces silent failures after tools execute

  • SessionStart: Initializes at the start of a session

  • Stop: Cleans up when a session stops

  • SubagentStop: Cleans up when a subagent stops

Installation process

The command is interactive:

  1. Displays what each hook does

  2. Lets you choose which hooks to install

  3. Installs them in ~/.claude/settings.json (globally) or the project's local .claude/settings.json

  4. Requires your confirmation for every installation

Custom hook example

You can write your own hooks:

{
  "hooks": {
    "PreToolUse": [
      {
        "matcher": "Bash",
        "hooks": [
          {
            "type": "command",
            "command": "jq -e 'select(.tool_input.command | test(\"rm -rf\")) | error(\"rm -rf blocked\")' > /dev/null 2>&1"
          }
        ]
      }
    ]
  }
}

Security audits and CI

cc-safe-setup provides auditing features:

  • --doctor: Checks the status of installed hooks

  • --audit: Generates a security audit report

Team deployment

Rolling deployment to a team:

  1. Commit .claude/settings.json to version control

  2. Team members automatically inherit the security configuration after cloning the repository

  3. Use --doctor to verify that all members' configurations are consistent

Important notes

Installed hooks do not update automatically:

  • You need to run the update command manually

  • Check the repository's CHANGELOG.md regularly

The npm version is behind:

  • The npm version (29.8.0) blocks fewer commands than the current repository version (30.0.4)

  • It is recommended to use npx github:yurukusa/cc-safe-setup instead of npx cc-safe-setup

Testing/workflow steps

  1. Install cc-safe-setup:

    npx github:yurukusa/cc-safe-setup
  2. Choose the hooks to install:

    • Select safety-essentials, git-protection, credential-guard, and token-guard according to the project's needs

  3. Verify the installation:

    # Check whether the hooks are active
    cat ~/.claude/settings.json
  4. Test the security protections:

    • Try to run rm -rf and confirm that it is blocked

    • Try to force-push and confirm that it is blocked

    • Try to modify .env and confirm that it is blocked

  5. Update regularly:

    • Check for repository updates

    • Run the update command

  6. Deploy to the team:

    • Commit .claude/settings.json to version control

    • Team members automatically inherit the configuration after cloning

Original evidence and data

  • The repository contains 910 hooks

  • The npm version 29.8.0 was released on 2026-04-20

  • The current repository version is 30.0.4

  • The npm version lets 3 destructive commands through, while the current version blocks them

  • Provides 4 core plugins: safety-essentials, git-protection, credential-guard, and token-guard

  • Supports multiple hook types: PreToolUse, PostToolUse, SessionStart, Stop, and SubagentStop

  • Provides auditing tools: --doctor and --audit

  • MIT license

Scope and limitations

  • Requires a Claude Code CLI environment

  • Hooks do not update automatically and require manual maintenance

  • The npm version lags behind the repository version; using the GitHub version is recommended

  • Some hooks may affect development speed (such as blocking rm -rf)

  • Team deployment requires version-control support

Source excerpt or observation (short compliant quotation only)

The README emphasizes: "One command to add safety hooks to Claude Code. It installs a set of PreToolUse, PostToolUse, SessionStart, Stop, and SubagentStop hooks that stop destructive or irreversible operations before they run, and that surface silent failures."

"Why not npx cc-safe-setup? The npm release is stuck at 29.8.0 (2026-04-20) while this repository is at 30.0.4, and the gap is not cosmetic — 29.8.0 lets three destructive commands through that the current code blocks."

Curated by Tabbit

Prompt material is summarized from public sources and Tabbit editorial notes. Check the original licensing and intended use before copying it.

Claude Opus 4.7

Use in Tabbit

Claude Opus 4.7

Related prompts

MediaAnthropic Claude Platform Docs / Anthropic Newsroom2026-04-16

Claude Opus 4.7: Effort Levels and Migration Prompt Template

MediaAnthropic official documentation

Claude Opus 4.7: Anthropic's Official Prompt Library and Best Patterns

MediaZooClaw AI Help2026-04-07

Claude Opus 4.7: Three Practical Patterns - Caveman Prompts, CLAUDE.md Safety Guardrails, and Git Worktrees

MediaTenten Learning

Claude Opus 4.7: The Complete Guide to 50+ Community Tips

Claude Opus 4.7

Related reviews

MediaAnthropic Newsroom2026-04-16

Claude Opus 4.7: Official Coding, Vision, and Agent Benchmarks

MediaVellum2026-04-16

Claude Opus 4.7: Vellum's Cross-model Benchmarks and Task Selection

CommunityReddit r/ClaudeCode

Claude Opus 4.7: Post-Release Long-Session Experience with Reddit Claude Code