The command center for a complete Claude Code workflow — hooks, rules, methodology, and the connective tissue between every tool in the ecosystem.
Built through 500+ real-world AI collaboration sessions by a non-developer. Every hook, every rule, every framework earned its place by solving an actual problem.
Lineage: cc-empire is the merger of
cc-rules-cookbook+cc-hooks-gallery+agent-nexus— three earlier repos that have since been archived. Their best parts live on here, consolidated into a single command center.
┌─────────────────────┐
│ cc-empire │
│ hooks + rules + │
│ methodology + glue │
└──────────┬──────────┘
│
┌─────────────┬──────────────┬──────┴───────┬──────────────┐
│ │ │ │ │
┌────┴─────┐ ┌─────┴─────┐ ┌──────┴──────┐ ┌─────┴─────┐ ┌──────┴──────┐
│ Memory │ │ Content │ │ Remote │ │ Multi │ │ Clone │
│ │ │ │ │ Control │ │ Session │ │ │
│recallnest│ │ publishing│ │ TG + WX │ │ studio │ │ digital │
│ │ │ (private) │ │ │ │ │ │ clone │
└──────────┘ └───────────┘ └─────────────┘ └───────────┘ └─────────────┘
| Module | Description | Category |
|---|---|---|
| recallnest | Persistent memory via LanceDB with hybrid retrieval | Core |
| Publishing pipeline (private) | Image generation, layout, and WeChat publishing | Content |
| telegram-ai-bridge | Run N parallel CC sessions from your phone | Remote |
| tg-bridge-channel | Channel-engine TG bridge, CC background sessions | Remote |
| wechat-ai-bridge | Full CC in WeChat, not an API wrapper | Remote |
| claude-code-studio | Multi-session collaboration platform | Orchestration |
| docshell | Document-style interface for the CLI — input/replies are paragraphs, tools become margin comments | Interface |
| digital-clone-skill | Build digital clones from corpus data | Content |
All modules are optional. Install what you need.
git clone https://github.com/AliceLJY/cc-empire.git
cd cc-empire
bash install.shThe installer will:
- Check prerequisites (Claude Code, git, etc.)
- Show available modules — pick what you need
- Install hooks into
~/.claude/hooks/(mirroring the category layout, e.g.hooks/safety/bash-guard.sh) - Set up CLAUDE.md and workflow templates
- Clone selected module repos
Then activate the hooks: merge settings-template.json into your ~/.claude/settings.json — its paths match what the installer creates.
Hooks covering six Claude Code lifecycle events. 16 are general-purpose and registered in settings-template.json; 3 are personal-flavored (marked below) — read them before enabling.
Safety Guards
| Hook | Trigger | What it does |
|---|---|---|
bash-guard.sh |
PreToolUse:Bash | Blocks every rm invocation and selected unsafe launches; also adds workflow reminders (it is not a sandbox and does not universally validate shell code) |
edit-guard.sh |
PostToolUse:Edit | README bilingual check, API signature change alerts |
secret-guard.sh |
UserPromptSubmit | Detects API keys/secrets before they leak |
sensitive-file-guard.sh |
PreToolUse:Edit|Write | Blocks edits to .env / credentials / key files |
execution-guard.sh |
PostToolUse | Detects dangerous patterns — repeated loops, duplicate calls, read-only spirals |
Workflow Automation
| Hook | Trigger | What it does |
|---|---|---|
auto-commit.sh |
Stop | Reminds about uncommitted changes at session end |
nag-reminder.sh |
PostToolUse | ReAct drift detection — nudges observation notes |
track-edit.sh |
PreToolUse:Edit|Write | Tracks which repos were touched per session |
learning-sync-check.sh |
Stop | Cross-checks study-log entries against overview docs (personal-flavored: expects a specific notes layout) |
Lifecycle Management
| Hook | Trigger | What it does |
|---|---|---|
load-context.sh |
SessionStart | Injects identity and project status on startup |
pre-compact.sh |
PreCompact | Saves active state before context compression |
session-summary.sh |
Stop | Auto-generates session index for later lookup |
Quality Checks
| Hook | Trigger | What it does |
|---|---|---|
ts-check.sh |
PostToolUse:Edit | Auto TypeScript syntax check after edits |
first-principles-nudge.sh |
PostToolUse:Edit | Nudges on over-engineering smells — compat shims, gratuitous abstractions, new deps (borrowed from repo-harness) |
error-distill.sh |
Stop | Captures errors from the transcript and distills lessons into a reusable file |
trajectory-scout.sh |
Stop | Flags "failed then self-recovered" trajectory segments as skill candidates |
Feedback Capture
| Hook | Trigger | What it does |
|---|---|---|
rating-capture.sh |
UserPromptSubmit | Captures 1-10 ratings for quality tracking |
promote-preference.sh |
Stop | Queues "remember this" moments as preference candidates (personal-flavored: Chinese trigger regex, memory-MCP workflow — adapt before use) |
promote-review.sh |
manual CLI | Companion tool to review the queued candidates (not registered as a hook) |
All hooks support profile control (CC_HOOK_PROFILE=off to disable all) and individual disable (CC_DISABLED_HOOKS=hook1.sh,hook2.sh).
See docs/hook-lifecycle.md for the complete lifecycle diagram.
Distilled from 500+ sessions into reusable patterns. Located in rules/.
Methodology — How to work with AI
| Rule | What it solves |
|---|---|
| research-plan-implement | Three-stage discipline. No skipping. |
| react-loop | Act → Observe → Reflect → Record. Every step. |
| task-contracts | Define completion criteria before starting |
| scope-drift-detection | Catch when work drifts from the original goal |
| harness-engineering | Shape AI behavior through rules, not hope |
| skill-evolution | How skills improve through feedback loops |
Thinking Frameworks — How to think clearly with AI
| Framework | What it does |
|---|---|
| anti-sycophancy | Neutral prompts that get honest answers |
| bias-correction-matrix | Systematic bias detection and correction |
| xy-problem-detection | Catch when means and goals are misaligned |
| confidence-impact-filter | Prioritize by confidence level and impact |
| completion-taxonomy | DONE / DONE_WITH_CONCERNS / BLOCKED / NEEDS_CONTEXT |
Borrowed Patterns — Proven techniques adapted for AI workflows
| Pattern | Origin |
|---|---|
| boil-the-lake | Exhaustive enumeration before optimization |
| failure-modes-five-layers | Systematic failure analysis |
| measurable-outcome | Every skill needs a measurable success criterion |
| report-first-pattern | Report findings before acting on them |
| two-stage-classification | Rough sort, then fine-grade |
Architecture — System design patterns
| Doc | Covers |
|---|---|
| memory-architecture | How persistent memory is structured |
| confidence-tagging | Tagging claims with confidence levels |
| reply-discipline | Scan before replying, don't miss items |
- CLAUDE.md.example — Project contract template (execution rules, verification, reply discipline)
- workflow.md — Research → Plan → Implement methodology with ReAct loop
- memory/ — Memory index structure (MEMORY.md + identity + feedback templates)
| Variable | Default | Purpose |
|---|---|---|
CC_HOOK_PROFILE |
standard |
Set to off to disable all hooks |
CC_DISABLED_HOOKS |
— | Comma-separated list of hooks to skip |
CC_SECRET_GUARD_MODE |
block |
Set to warn only when intentionally submitting credential-like text; the warning remains visible |
CC_CONTEXT_TIMEOUT_SECONDS |
2 |
Deadline for the startup service-status check |
CC_MEMORY_DIR |
auto-detect | Override project memory directory |
CC_GITHUB_OWNERS |
— | Your GitHub owner/org names (comma-separated), for PR guard (CC_GITHUB_ORGS works as a legacy alias) |
CC_NAG_THRESHOLD |
5 |
Tool calls before ReAct reminder triggers |
Edit ~/.claude/hooks/repos.conf to add your project directories:
TRACKED_REPOS=(
"$HOME/Projects/my-app"
"$HOME/Projects/my-lib"
)This project was built by a non-developer through AI collaboration. The perspective is different from most CC workflow tools:
- Cross-domain, not just coding — Writing pipelines, bot operations, remote control, not just TDD
- Production-tested rules — Every rule exists because its absence caused a real problem
- Memory as infrastructure — Persistent memory isn't optional; it's how the AI gets better over time
- Honest methodology — Anti-sycophancy prompts, neutral verification, confidence tags
- First-principles thinking — Patterns are cross-domain; a writing review framework becomes a code review framework
See docs/architecture.md for how modules work together.
Issues and PRs welcome. If you've built hooks or workflow rules that made your CC life better, share them.
MIT