~ / rigs / TechHU-GS / cc-discipline

TechHU-GS/cc-discipline

Guardrails for Claude Code. Shell hooks that actually block bad behavior — edit loops, skipped verification, destructive git — not just markdown that asks nicely.

↗ GitHub ★ 0 mit updated 12d ago project Claude Code
share on X
ARCHETYPE
Automator
Hooks on every lifecycle event: format, lint, notify, log.
CONTEXT TAX · EVERY TURN
~7.6k tokens
Heavy · median rig: 2.3k · breakdown
GUARDRAILS
3/5
Blocks destructive commands · Pre-tool screening hook · No YOLO mode · details

Copy this rig

# review before running: this installs third-party code
$ npx degit TechHU-GS/cc-discipline/.claude ./rig-cc-discipline  # inspect, then merge into .claude/

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.

$ npx degit TechHU-GS/cc-discipline/.claude/skills/ask-me .claude/skills/ask-me
$ npx degit TechHU-GS/cc-discipline/.claude/skills/commit .claude/skills/commit
$ npx degit TechHU-GS/cc-discipline/.claude/skills/coplan .claude/skills/coplan
$ npx degit TechHU-GS/cc-discipline/.claude/skills/evaluate .claude/skills/evaluate
$ npx degit TechHU-GS/cc-discipline/.claude/skills/investigate .claude/skills/investigate
$ npx degit TechHU-GS/cc-discipline/.claude/skills/self-check .claude/skills/self-check
$ npx degit TechHU-GS/cc-discipline/.claude/skills/summary .claude/skills/summary
$ npx degit TechHU-GS/cc-discipline/.claude/skills/think .claude/skills/think
$ curl -fsSL --create-dirs -o .claude/agents/investigator.md https://raw.githubusercontent.com/TechHU-GS/cc-discipline/main/.claude/agents/investigator.md
$ curl -fsSL --create-dirs -o .claude/agents/reviewer.md https://raw.githubusercontent.com/TechHU-GS/cc-discipline/main/.claude/agents/reviewer.md
$ curl -fsSL --create-dirs -o .claude/agents/investigator.md https://raw.githubusercontent.com/TechHU-GS/cc-discipline/main/templates/.claude/agents/investigator.md
$ curl -fsSL --create-dirs -o .claude/agents/reviewer.md https://raw.githubusercontent.com/TechHU-GS/cc-discipline/main/templates/.claude/agents/reviewer.md

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

{
  "hooks": {
    "PreToolUse": [
      {
        "matcher": "Edit|Write|MultiEdit",
        "hooks": [
          {
            "type": "command",
            "command": "bash \"$CLAUDE_PROJECT_DIR/.claude/hooks/pre-edit-guard.sh\""
          },
          {
            "type": "command",
            "command": "bash \"$CLAUDE_PROJECT_DIR/.claude/hooks/streak-breaker.sh\""
          },
          {
            "type": "command",
            "command": "bash \"$CLAUDE_PROJECT_DIR/.claude/hooks/pre-edit-guard.sh\""
          },
          {
            "type": "command",
            "command": "bash \"$CLAUDE_PROJECT_DIR/.claude/hooks/streak-breaker.sh\""
          }
        ]
      },
      {
        "matcher": "Edit|Write|MultiEdit|Bash|Agent",
        "hooks": [
          {
            "type": "command",
            "command": "bash \"$CLAUDE_PROJECT_DIR/.claude/hooks/action-counter.sh\""
          },
          {
            "type": "command",
            "command": "bash \"$CLAUDE_PROJECT_DIR/.claude/hooks/action-counter.sh\""
          }
        ]
      },
      {
        "matcher": "Bash",
        "hooks": [
          {
            "type": "command",
            "command": "bash \"$CLAUDE_PROJECT_DIR/.claude/hooks/git-guard.sh\""
          },
          {
            "type": "command",
            "command": "bash \"$CLAUDE_PROJECT_DIR/.claude/hooks/git-guard.sh\""
          }
        ]
      },
      {
        "matcher": "ExitPlanMode",
        "hooks": [
          {
            "type": "command",
            "command": "bash \"$CLAUDE_PROJECT_DIR/.claude/hooks/phase-gate.sh\""
          },
          {
            "type": "command",
            "command": "bash \"$CLAUDE_PROJECT_DIR/.claude/hooks/phase-gate.sh\""
          }
        ]
      }
    ]
  }
}

Skills (8)

Subagents (4)

investigator
model: sonnet
Code investigator. Invoke when deep codebase research is needed. Explores in an independent context, returns a structured summary without polluting the main conversation.
reviewer
model: sonnet
Code reviewer. Invoke after a modification plan is decided but before execution. Reviews plan soundness in an independent context.
investigator
model: sonnet
Code investigator. Invoke when deep codebase research is needed. Explores in an independent context, returns a structured summary without polluting the main conversation.
reviewer
model: sonnet
Code reviewer. Invoke after a modification plan is decided but before execution. Reviews plan soundness in an independent context.

Hooks (16)

eventmatcherruns
SessionStartstartup|resume|clear|compactbash "$CLAUDE_PROJECT_DIR/.claude/hooks/session-start.sh"
PreToolUseEdit|Write|MultiEditbash "$CLAUDE_PROJECT_DIR/.claude/hooks/pre-edit-guard.sh"
PreToolUseEdit|Write|MultiEditbash "$CLAUDE_PROJECT_DIR/.claude/hooks/streak-breaker.sh"
PreToolUseEdit|Write|MultiEdit|Bash|Agentbash "$CLAUDE_PROJECT_DIR/.claude/hooks/action-counter.sh"
PreToolUseBashbash "$CLAUDE_PROJECT_DIR/.claude/hooks/git-guard.sh"
PreToolUseExitPlanModebash "$CLAUDE_PROJECT_DIR/.claude/hooks/phase-gate.sh"
PostToolUseBashbash "$CLAUDE_PROJECT_DIR/.claude/hooks/post-error-remind.sh"
PostToolUseFailureBashbash "$CLAUDE_PROJECT_DIR/.claude/hooks/post-error-remind.sh"
SessionStartstartup|resume|clear|compactbash "$CLAUDE_PROJECT_DIR/.claude/hooks/session-start.sh"
PreToolUseEdit|Write|MultiEditbash "$CLAUDE_PROJECT_DIR/.claude/hooks/pre-edit-guard.sh"
PreToolUseEdit|Write|MultiEditbash "$CLAUDE_PROJECT_DIR/.claude/hooks/streak-breaker.sh"
PreToolUseEdit|Write|MultiEdit|Bash|Agentbash "$CLAUDE_PROJECT_DIR/.claude/hooks/action-counter.sh"
PreToolUseBashbash "$CLAUDE_PROJECT_DIR/.claude/hooks/git-guard.sh"
PreToolUseExitPlanModebash "$CLAUDE_PROJECT_DIR/.claude/hooks/phase-gate.sh"
PostToolUseBashbash "$CLAUDE_PROJECT_DIR/.claude/hooks/post-error-remind.sh"
PostToolUseFailureBashbash "$CLAUDE_PROJECT_DIR/.claude/hooks/post-error-remind.sh"

Similar rigs

copied ✓