Your Claude Code AI assistant, elevated to professional standards
|
100% Factual Accuracy |
82% Token Savings |
50% Faster Response |
100% Constitutional |
- ⚡ Quick Start
- ✨ Features
- 📁 Rule Files
- 📦 Installation
- 📂 Design Documentation Structure
- 🔗 Integration Guide
- 🎓 Framework Highlights
- 🖼️ Visual Guide
- 📊 Before & After
- 📊 Performance Metrics
- 🔒 Safety Guarantees
- 🤝 Contributing
- 📜 License
- 🙏 Acknowledgments
# Step 1: Clone once
git clone https://github.com/DarKWinGTM/claude-code-rules.git
cd claude-code-rules
# Step 2: Reusable active runtime file set (run from repo root)
RULE_FILES="accurate-communication.md answer-presentation.md anti-mockup.md anti-sycophancy.md authority-and-scope.md dan-safe-normalization.md document-consistency.md document-changelog-control.md document-design-control.md document-patch-control.md emergency-protocol.md explanation-quality.md flow-diagram-no-frame.md functional-intent-verification.md no-variable-guessing.md phase-implementation.md project-documentation-standards.md recovery-contract.md refusal-classification.md refusal-minimization.md safe-file-reading.md safe-terminal-output.md strict-file-hygiene.md todo-standards.md unified-version-control-system.md zero-hallucination.md"
# Step 3: Install globally
mkdir -p ~/.claude/rules
for f in $RULE_FILES; do cp "$f" ~/.claude/rules/; done✨ That's it! This installs the 26 active runtime rules only.
Already cloned the repo? Skip Step 1 and run only Step 2 + Step 3 from the repository root.
Need project-specific install instead? Reuse the same
RULE_FILESline, but change the destination from~/.claude/rules/to./.claude/rules/.Note: this runtime-only install copies the active rule files. Governed design/changelog/TODO artifacts plus the root
phase-implementation-template.mdhelper remain in the repository for maintenance, documentation, and synchronized updates.
|
|
|
|
Fundamental principles that govern all AI behavior
| Rule | Purpose | Key Benefit |
|---|---|---|
anti-mockup.md |
Real systems over simulations | No fake implementations |
anti-sycophancy.md |
Truth over agreement | Honest feedback always |
zero-hallucination.md |
Verified information only | 100% accuracy |
Ensure consistent, safe, and well-documented outputs
| Rule | Purpose | Key Benefit |
|---|---|---|
accurate-communication.md |
Clear, honest communication | No vague claims and next-step guidance only when genuinely useful |
authority-and-scope.md |
Decision hierarchy | User authority respected |
dan-safe-normalization.md |
Prompt-wrapper normalization | Safer intent evaluation before decisioning |
document-consistency.md |
Cross-reference validation | No contradictions |
document-changelog-control.md |
Version tracking system | Single Source of Truth |
document-design-control.md |
Design document standards | Standardized structure |
document-patch-control.md |
Patch Control | Governed patch/review artifacts kept separate from the live /phase execution workspace |
emergency-protocol.md |
Crisis response | Fast, safe reactions |
functional-intent-verification.md |
Intent validation | Commands verified before run |
phase-implementation.md |
Phase planning semantics | First-class /phase + SUMMARY.md model with design rollups, review rollups, standardized review outcomes, and an explicit completion boundary/stop rule |
recovery-contract.md |
Blocked-response contract | Every constrained/refused path has actionable next steps |
refusal-classification.md |
Deterministic refusal taxonomy | Consistent block decisions and traceable output modes |
refusal-minimization.md |
False-refusal reduction | Prefer recoverable constrained/context paths when authorized |
strict-file-hygiene.md |
File hygiene | No unrequested docs |
todo-standards.md |
Task management | Focused work |
project-documentation-standards.md |
Project documentation standards | Standardized docs for all projects |
unified-version-control-system.md |
Unified version governance | Single deterministic UDVC-1 controller |
Improve answer structure, clarity, and visual scanability
| Rule | Purpose | Key Benefit |
|---|---|---|
answer-presentation.md |
Answer presentation standards | Readable and orderly responses |
explanation-quality.md |
Explanation structure quality | Better reasoning flow and usefulness-based endings without forced extra options |
flow-diagram-no-frame.md |
Clean ASCII diagrams | Better readability |
Optimize your daily workflow efficiency
| Rule | Purpose | Key Benefit |
|---|---|---|
no-variable-guessing.md |
Read before reference | No wrong assumptions |
safe-file-reading.md |
Plan-before-read | Efficient file handling |
safe-terminal-output.md |
Output management | No terminal flooding |
📊 Active Runtime Rules: 26
The Quick Start block above is still the canonical runtime-only install block. The methods below use the same active 26-rule set, but describe when to use each path without repeating the long file list.
Use this when: you want the full active runtime set installed globally.
Fastest path:
- Clone the repository.
- Run the Quick Start block exactly as shown above.
- Run the verification commands below.
If you already cloned the repo earlier, you do not need to repeat the clone step. Just return to the repo root, keep the same RULE_FILES="..." definition from Quick Start, and rerun only the install portion against ~/.claude/rules/.
Use this when: you only want a small subset of the runtime rules.
# Example: Install just the anti-sycophancy rule
curl -o ~/.claude/rules/anti-sycophancy.md \
https://raw.githubusercontent.com/DarKWinGTM/claude-code-rules/master/anti-sycophancy.mdUse this when: you want the same active runtime set, but only inside the current project.
- Create
./.claude/rules/in the project root. - Reuse the same Quick Start command pattern.
- Change only the destination path from
~/.claude/rules/to./.claude/rules/.
This keeps the install set identical while scoping the rules to one repository.
| Location | Scope | Path | Use Case |
|---|---|---|---|
| Global | All projects | ~/.claude/rules/*.md |
Default recommendation |
| Project | Current project only | ./.claude/rules/*.md |
Project-specific needs |
Global install: verify under
~/.claude/rules/. Project-specific install: verify under./.claude/rules/instead.
# Global install check
claude --version
head -20 ~/.claude/rules/anti-sycophancy.md
ls ~/.claude/rules/answer-presentation.md
ls ~/.claude/rules/phase-implementation.md
# Project-specific install check (run from project root)
head -20 ./.claude/rules/anti-sycophancy.md
ls ./.claude/rules/answer-presentation.md
ls ./.claude/rules/phase-implementation.md| Location | Purpose | File Type |
|---|---|---|
./design/*.design.md |
Design specifications | Design docs |
*.md (root) |
Active runtime rules | Rules files |
./changelog/changelog.md |
Master repository-wide history | Master changelog |
./changelog/*.changelog.md |
Per-chain authoritative history | Changelogs |
./phase/SUMMARY.md |
Governed summary/index for live phase planning, design rollup, and review rollup | Phase summary doc |
./phase/phase-010-<phase-name>.md |
Governed child per-phase execution detail with design extraction and review state | Child phase docs |
./patches/*.patch.md |
Governed patch/review artifacts outside live phase planning | Patch docs |
./phase-implementation-template.md |
Root helper for phased planning | Helper artifact |
💡 Single Source of Truth Principle:
- Design files (
.design.md) define active target state- Per-chain changelogs (
*.changelog.md) are the authority for governed chain historychangelog/changelog.mdrecords repository-level synchronization historyREADME.mdremains overview-only, not chain authority
This section defines how design, changelog, runtime rules, TODO, and governed phase-planning artifacts should be updated together.
| Document | Role | Update Trigger |
|---|---|---|
design/*.design.md |
Target behavior/specification | Requirement or policy change |
*.md (root runtime rules) |
Active runtime behavior | Approved design change requires runtime sync |
changelog/changelog.md |
Master repository-wide synchronization history | Repository-level governed sync events |
changelog/*.changelog.md |
Authoritative per-chain version history | Any rule/design update with version impact |
phase/SUMMARY.md |
Governed summary/index for live phased execution | Phased implementation work needs one summary file with a phase map, design extraction rollup, review rollup, and global coordination |
phase/phase-010-<phase-name>.md and peers |
Governed child phase-detail layer | Multi-phase execution detail under /phase, including design references, design extraction, review flow, reviewer checklist, review outcome, and execution detail |
patches/*.patch.md |
Governed patch/review artifact layer | Patch or review work that is separate from live phase planning |
phase-implementation-template.md |
Root helper for phased planning readability | Reusable authoring support when staged execution matters |
TODO.md |
Execution and progress tracking | Work starts/completes or task state changes |
Change request received
→ Update design target state
→ Synchronize runtime rule wording
→ Record per-chain changelog version + summary
→ Record repository-level sync in changelog/changelog.md when applicable
→ Update TODO pending/completed/history
→ Verify links, versions, and consistency
- Design file links to the correct changelog file
- Changelog unified row maps to an existing detailed section
- Runtime rule version/header aligns with changelog current version
phase/SUMMARY.mdexists when phased execution is usedphase/SUMMARY.mdincludes:- design extraction summary table
- overview flow diagram
- review summary table
- phase map
- child phase files include:
- design references
- design extraction
- review flow diagram
- reviewer checklist
- standardized review outcome fields
- TODO pending section contains pending-only items (
- [ ]) - TODO history has a dated entry for completed milestone work
design/recovery-contract.design.md
→ recovery-contract.md
→ changelog/recovery-contract.changelog.md
→ TODO.md (history/progress)
What was synchronized:
- Deterministic response keys were aligned across design and runtime (
decision_output,refusal_class,reason,what_can_be_done_now,how_to_proceed) - Changelog recorded the runtime/design version sync event
- TODO recorded completion in the hardening program history
design/safe-file-reading.design.md + design/safe-terminal-output.design.md
→ safe-file-reading.md + safe-terminal-output.md
→ changelog/safe-file-reading.changelog.md + changelog/safe-terminal-output.changelog.md
→ TODO.md (WS-5 completion)
What was synchronized:
- Shared verification-trigger model applied across related rules
- Deterministic output-cap wording standardized (
head -100 | head -c 5000, risky-file variant) - Changelog and TODO were updated to preserve traceability
TODO.md pending section audit
→ remove completed items from pending block
→ remove duplicate pending headings
→ add closure row in TODO history
What was synchronized:
- Pending section kept pending-only (
- [ ]) - Duplicate heading drift removed
- Program closure logged in dated history row
phase/SUMMARY.md
→ design extraction summary table
→ overview flow diagram
→ review summary table
→ phase/phase-010-*.md
→ TODO.md history
What was synchronized:
/phasebecame the live phase-planning namespaceSUMMARY.mdbecame the required summary/index for live phased execution- child phase files were required to carry design extraction, review flow, reviewer checklist, and standardized review outcomes
SUMMARY.mdwas extended to carry design rollup and review rollup views for faster approval- the model gained an explicit Definition of Done and stop rule so governance expansion does not continue by default after completion
- communication rules were narrowed so next-step options are suggested only when genuinely useful rather than treated as a mandatory ending pattern
The current phased execution model is now explicitly finalized and bounded.
phase/
SUMMARY.md
→ design extraction summary table
→ overview flow diagram
→ review summary table
→ phase map
phase-010-<phase-name>.md
→ design references
→ design extraction
→ review flow diagram
→ reviewer checklist
→ review outcome
What this gives you:
- reviewers can inspect the whole rollout from
SUMMARY.md - reviewers can inspect one phase deeply from the child phase file
- approvers can see sign-off status, severity, disposition, and blocker/follow-up state in one place
- the model now has an explicit completion boundary and stop rule, so governance expansion does not continue by default after it is operationally complete
- communication rules now treat next-step options as usefulness-based guidance, not as a mandatory ending pattern after already-complete work
Dynamic complexity adjustment based on task requirements
Simple Tasks (Level 0-2) → Minimal Processing
↓
Standard Tasks (Level 3-5) → Balanced Approach
↓
Complex Tasks (Level 6-7) → Deep Analysis
| Metric | Improvement | Impact |
|---|---|---|
| Response Speed | +30-50% | Faster answers |
| Token Efficiency | +40-82% | Lower costs |
| Cost Reduction | -25-35% | Budget-friendly |
Three expert perspectives analyzing every complex problem
Developer ──┐
Security ──┼──→ Unified Recommendation
Architect ──┘
How It Works:
- Developer Agent → Technical feasibility analysis
- Security Agent → Security & privacy evaluation
- Architect Agent → System design considerations
- Synthesis → All perspectives merge into unified recommendation
Result: Comprehensive analysis from multiple angles
Cache and reuse verified reasoning patterns
| Action | Benefit |
|---|---|
| Cache verified patterns | Store successful approaches |
| Reuse for similar tasks | 40% speed improvement |
| Validate before use | Ensure accuracy maintained |
Performance: 82% cache hit rate for recurring patterns
![]() Anti-Sycophancy Truth over pleasing |
![]() Anti-Mockup Real systems only |
![]() Zero Hallucination Verified info only |
![]() No Guessing Read before reference |
![]() Safe File Reading Plan before read |
![]() Safe Terminal Output management |
User: "Set up database connection"
↓
AI: "Here's the connection string:
DATABASE_URL=postgres://localhost:5432/mydb"
Result: ❌ Guessed values
❌ No verification
❌ Potentially wrong
❌ User frustrated
User: "Set up database connection"
↓
AI: "Let me check your .env file first..."
[Reading configuration...]
"Found your existing config:
DATABASE_URL=postgres://prod-server:5432/app_db
Should I use this, or do you want to change it?"
Result: ✅ Verified from actual files
✅ No guessing
✅ User confirmation
✅ Professional interaction
The difference? Professional AI behavior that respects your existing configuration.
| Metric | Target | Status | Impact |
|---|---|---|---|
| Factual Accuracy | 100% | ✅ | Zero hallucinations |
| Constitutional Compliance | 100% | ✅ | User sovereignty maintained |
| Token Efficiency | +40-82% | ✅ | Cost reduction |
| Response Speed | +30-50% | ✅ | Faster delivery |
| User Sovereignty | Absolute | ✅ | User always in control |
| Guarantee | Description |
|---|---|
| No Mock/Stub | Real implementations unless explicitly requested |
| No Guessing | Always verify from actual sources |
| No Hallucinations | 100% fact-based responses |
| No Sycophancy | Truth over agreement, always |
| Constitutional | Principles override everything |
Your safety and accuracy are non-negotiable.
These rules evolve based on real-world usage:
- 🔄 Real-world usage patterns → What actually works
- 💬 User feedback → Your experience matters
- 🔐 Safety considerations → Always improving
- ⚡ Performance optimization → Getting faster
Pull requests welcome! Please ensure:
- New rules follow existing format
- Include clear documentation
- Add visual assets if applicable
- Update changelog
- Respect completion boundaries — do not add new mandatory capability blocks to a completed governance model unless the change is explicitly justified and intentionally approved
We value: Quality over quantity, clarity over complexity, and bounded governance over endless expansion
MIT License - Feel free to adapt for your own use case.
Attribution appreciated but not required.
Personal rule set and configuration framework for Claude Code CLI.
Inspired by:
- Constitutional AI principles (Anthropic)
- Best practices for AI assistant development
- Real-world production experience
- Community feedback and contributions
Built with ❤️ for the Claude Code community
Version: 2.2.0 | Last Updated: 2026-03-12 | Framework: Sophisticated AI Framework with Constitutional Governance
Made with 💙 by developers who care about AI quality














