~ / rigs / anneheartrecord / claude-code-config

anneheartrecord/claude-code-config

Claude Code 配置最佳实践 | Battle-tested Claude Code configuration

↗ GitHub ★ 12 MIT updated 2mo ago personal setup Claude Code
share on X
ARCHETYPE
YOLO Cowboy
Permissions? Never heard of 'em. Ships at the speed of `--dangerously-skip-permissions`.
CONTEXT TAX · EVERY TURN
~730 tokens
Featherweight · median rig: 2.3k · breakdown
GUARDRAILS
2/5
Blocks destructive commands · Pre-tool screening hook · details

Copy this rig

# review before running: this installs third-party code
$ npx degit anneheartrecord/claude-code-config/hooks ./rig-claude-code-config/hooks

MCP servers are added to Claude Code at local scope; env vars are shown as YOUR_… placeholders — we never store values. Files are fetched with degit into a separate folder so you can review before merging.

Merge into .claude/settings.json (project) or ~/.claude/settings.json (user). Hook commands reference scripts in the source repo — copy those too.

{
  "permissions": {
    "deny": [
      "Bash(rm -rf /)",
      "Bash(rm -rf /*)",
      "Bash(rm -rf ~)",
      "Bash(rm -rf ~/*)",
      "Bash(git push --force origin main)",
      "Bash(git push --force origin master)",
      "Bash(git reset --hard)",
      "Bash(git checkout .)",
      "Bash(git clean -fd*)",
      "Bash(chmod -R 777 /)",
      "Bash(dd if=/dev/zero*)",
      "Bash(mkfs*)"
    ]
  },
  "hooks": {
    "PreToolUse": [
      {
        "matcher": "Bash",
        "hooks": [
          {
            "type": "command",
            "command": "if echo \"$TOOL_INPUT\" | grep -qE 'rm\\s+-rf\\s+\\/' ; then echo 'DENY: dangerous rm command'; exit 1; fi"
          }
        ]
      },
      {
        "matcher": "Write|Edit",
        "hooks": [
          {
            "type": "command",
            "command": "~/.claude/hooks/check-secrets.sh"
          }
        ]
      }
    ]
  }
}

Hooks (4)

eventmatcherruns
PreToolUseBashif echo "$TOOL_INPUT" | grep -qE 'rm\s+-rf\s+\/' ; then echo 'DENY: dangerous rm command'; exit 1; fi
PreToolUseWrite|Edit~/.claude/hooks/check-secrets.sh
Stop*~/.claude/hooks/cmux-notify.sh
PostToolUseTask~/.claude/hooks/cmux-notify.sh

Permissions

deny (12)
Bash(rm -rf /)
Bash(rm -rf /*)
Bash(rm -rf ~)
Bash(rm -rf ~/*)
Bash(git push --force origin main)
Bash(git push --force origin master)
Bash(git reset --hard)
Bash(git checkout .)
Bash(git clean -fd*)
Bash(chmod -R 777 /)
Bash(dd if=/dev/zero*)
Bash(mkfs*)
ask (0)
—
allow (10)
Bash(*)
Read(*)
Edit(*)
Write(*)
WebFetch(*)
WebSearch(*)
Glob(*)
Grep(*)
NotebookEdit(*)
Agent(*)

Similar rigs

copied ✓