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.
ARCHETYPE
Automator
Hooks on every lifecycle event: format, lint, notify, log.
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)
| event | matcher | runs |
|---|---|---|
| SessionStart | startup|resume|clear|compact | bash "$CLAUDE_PROJECT_DIR/.claude/hooks/session-start.sh" |
| PreToolUse | Edit|Write|MultiEdit | bash "$CLAUDE_PROJECT_DIR/.claude/hooks/pre-edit-guard.sh" |
| PreToolUse | Edit|Write|MultiEdit | bash "$CLAUDE_PROJECT_DIR/.claude/hooks/streak-breaker.sh" |
| PreToolUse | Edit|Write|MultiEdit|Bash|Agent | bash "$CLAUDE_PROJECT_DIR/.claude/hooks/action-counter.sh" |
| PreToolUse | Bash | bash "$CLAUDE_PROJECT_DIR/.claude/hooks/git-guard.sh" |
| PreToolUse | ExitPlanMode | bash "$CLAUDE_PROJECT_DIR/.claude/hooks/phase-gate.sh" |
| PostToolUse | Bash | bash "$CLAUDE_PROJECT_DIR/.claude/hooks/post-error-remind.sh" |
| PostToolUseFailure | Bash | bash "$CLAUDE_PROJECT_DIR/.claude/hooks/post-error-remind.sh" |
| SessionStart | startup|resume|clear|compact | bash "$CLAUDE_PROJECT_DIR/.claude/hooks/session-start.sh" |
| PreToolUse | Edit|Write|MultiEdit | bash "$CLAUDE_PROJECT_DIR/.claude/hooks/pre-edit-guard.sh" |
| PreToolUse | Edit|Write|MultiEdit | bash "$CLAUDE_PROJECT_DIR/.claude/hooks/streak-breaker.sh" |
| PreToolUse | Edit|Write|MultiEdit|Bash|Agent | bash "$CLAUDE_PROJECT_DIR/.claude/hooks/action-counter.sh" |
| PreToolUse | Bash | bash "$CLAUDE_PROJECT_DIR/.claude/hooks/git-guard.sh" |
| PreToolUse | ExitPlanMode | bash "$CLAUDE_PROJECT_DIR/.claude/hooks/phase-gate.sh" |
| PostToolUse | Bash | bash "$CLAUDE_PROJECT_DIR/.claude/hooks/post-error-remind.sh" |
| PostToolUseFailure | Bash | bash "$CLAUDE_PROJECT_DIR/.claude/hooks/post-error-remind.sh" |
Similar rigs
Windy3f3f3f3f/claude-code-from-scratch
Build your own Claude Code from scratch. 🔍 Claude Code 开源了 50 万行代码,读不动?用 ~5000 行 TypeScript / Python 从零复现核心架构,11 章分步教程带你理解 coding agent 精髓
Pragmatist 2.6k tok ·
chrille0313/agentic-monorepo-template
Stack-agnostic monorepo template where agents are the workflow: PM → implementer → fresh-context reviewer loops via Claude Code subagents, skills, and GitHub Actions
Pragmatist 1.5k tok ·
junjiezhou1122/ideascientist-claude-code
A native Claude Code translation of IdeaScientist for automatic, evidence-grounded research ideation.
Orchestrator 406 tok ·
alex35mil/dotfiles
My dotfiles
Pragmatist 1.2k tok ·