Claude Code: Rules, Output Styles, Settings & CLAUDE.md
Path-Specific Rules
Location: ~/.claude/rules/
Rules auto-load when Claude Code edits files matching their glob patterns. No invocation needed — the frontmatter paths: array controls activation.
| Rule File | Glob Patterns | What It Enforces |
|---|---|---|
|
|
AsciiDoc documentation standards: always use antora.yml attributes (never hardcode IPs/hostnames/paths), no inline |
|
|
Neovim Lua configuration standards: domus-nvim architecture ( |
|
|
Shell script standards: safety ( |
|
|
Python development standards: architecture ( |
|
|
D2 diagram standards: structure (descriptive node IDs, container grouping, explicit direction, <100 lines per file), styling (standard shape conventions, |
Rule File Format
Each rule is a Markdown file with YAML frontmatter defining the glob patterns that trigger it:
---
paths:
- "**/*.adoc"
- "**/docs/**"
---
# AsciiDoc Documentation Rules
When editing AsciiDoc files:
## Attributes
- ALWAYS use attributes from antora.yml - NEVER hardcode IPs, hostnames, paths
- Check `grep -E "^ [a-z]" docs/antora.yml` before using any attribute
- If attribute doesn't exist, ADD IT to antora.yml first
## Structure
- NO inline TOC (`:toc:`) - Antora UI provides sidebar TOC
- Use `include::partial$` for reusable content
- Use `include::example$` for code blocks >10 lines
Output Styles
Location: ~/.claude/output-styles/
Output styles control Claude Code’s communication tone and formatting. They are Markdown files with YAML frontmatter. The active style is set in settings.json via the outputStyle key.
Activation
"outputStyle": "professional"
This loads ~/.claude/output-styles/professional.md and applies its rules to all Claude Code responses.
professional.md
The professional style enforces direct, senior-engineer communication. Key frontmatter fields:
| Field | Value |
|---|---|
|
|
|
Direct, senior-engineer communication. No fluff, no sycophancy. Teaching-focused with CLI mastery emphasis. |
|
|
Communication Rules
-
No sycophantic openers ("Great question!", "That’s a great idea!", "Absolutely!")
-
No filler or hedging ("I think", "perhaps", "it might be worth")
-
No trailing summaries of what was just done — the user can read the diff
-
Challenge incorrect assumptions directly with evidence
-
Verify independently when asked "am I right?" — do not reflexively agree
-
Admit errors immediately without defensive framing
Technical Level
Assumes senior systems engineer proficiency:
-
Use advanced CLI patterns (awk, sed, jq, process substitution)
-
Show precise verification commands (before AND after changes)
-
Suggest the harder, more educational approach when multiple options exist
-
Include line numbers and file paths in references
-
Provide production-grade commands, not tutorial-level ones
Teaching Mode
When introducing new concepts:
-
Show the command or pattern first
-
Explain WHY it works, not just WHAT it does
-
Connect to concepts the user already knows
-
Suggest a harder variation for practice
Security Posture
Flag security issues immediately and explain the attack vector. Do not soften warnings.
Configuration: settings.json
Location: ~/.claude/settings.json — 252 lines, 7.8KB. Consolidated from a bloated 60KB settings.local.json.
Core Settings
| Setting | Value | Purpose |
|---|---|---|
|
|
Auto-approve file edits without prompting |
|
|
Extended thinking on every response |
|
|
Loads |
|
|
Honors |
|
|
Auto-cleanup of old session data |
|
|
Include git workflow guidance in context |
|
|
Display time per response |
|
|
Show progress bar during operations |
|
|
Maximum reasoning effort |
Attribution
"attribution": {
"commit": "",
"pr": ""
}
Empty strings — no AI attribution on commits or pull requests. Aligns with the AI Attribution Policy in CLAUDE.md.
Environment Variables
| Variable | Value |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Permissions: Allow List (107 entries)
Organized by category. All use the Bash(command:*) format unless noted otherwise.
Git Operations
git
Standard Unix Tools
ls, tree, find, grep, cat, head, tail, wc, sort, awk, sed, diff, basename, dirname, readlink, realpath, ln, echo, printf, chmod, xargs, rsync, mkdir, rm, cp, mv, touch, tee, tr, cut, paste, uniq, rev, column
File Inspection
stat, file, od, xxd, which, type
System Information
env, id, uname, hostname, date, uptime, lsblk, df, du, free, ip, ss, ps
Service Management (Read-Only)
systemctl status, journalctl
Build Tools
make, npm, npx
Language Tools
python, python3, uv, cargo, rustc
Documentation & Data Tools
d2, jq, yq, shellcheck
Network & GitHub
curl, gh, ping, dig, ssh, scp
Security Tools
gpg
Package Management
stow
Miscellaneous
claude, rmapi, timeout, wl-copy, gopass ls, gopass list
WebFetch Domains
| Allowed Domain |
|---|
|
|
|
|
|
WebSearch
WebSearch — unrestricted web search.
Permissions: Deny List (10 entries)
| Denied Pattern | Reason |
|---|---|
|
Secrets protection — environment files may contain credentials |
|
Secrets protection — catches |
|
Hard boundary — encrypted secrets store is off-limits |
|
Hard boundary — age encryption keys are off-limits |
|
Prevents Claude from decrypting any age-encrypted file |
|
Prevents Claude from reading password store entries |
|
Destructive protection — prevents wiping root filesystem |
|
Destructive protection — prevents wiping home directory |
|
Destructive protection — prevents wiping any top-level path |
|
Prevents shell injection via arbitrary command strings |
Hooks (Summary)
Hooks run shell commands at specific lifecycle events. Full details in the hooks partial.
| Event | Matcher | Purpose |
|---|---|---|
|
|
Prints environment banner, counts config backups |
|
|
Warns if sensitive files ( |
|
|
Creates timestamped backup of file before editing |
|
|
Creates timestamped backup of file before overwriting |
|
|
Runs ShellCheck on |
|
|
Validates AsciiDoc attributes via |
Auto Mode
Auto mode defines guardrails for autonomous operation.
Environment Context
-
Multi-repo documentation system (domus-*) using Antora and AsciiDoc
-
Source control: GitHub (EvanusModestus), GitLab, Gitea (local)
-
Build: Makefile + Antora + Kroki for diagrams
-
Trusted workspace:
~/atelier/_bibliotheca/domus-*
Allow (Always Safe)
-
Building documentation with
make -
Reading and editing
.adocfiles in domus-* repos -
Git operations (add, commit, log, diff, status) on domus-* repos
-
Running python scripts in
scripts/directories
Soft Deny (Requires Confirmation)
-
Deleting
.claude/configuration -
Force-pushing to any branch
-
Modifying files outside
~/atelier/ -
Accessing
~/.secrets/or decrypting.agefiles -
Running
rm -rfon directories -
Modifying
antora-playbook.ymlin domus-docs
Sandbox
| Setting | Value |
|---|---|
|
|
|
|
|
|
|
|
|
|
Allowed Unix Sockets
-
/run/user/1000/keyring/ssh— SSH agent socket -
/var/run/docker.sock— Docker daemon
Filesystem Deny-Write
Prevents write access to sensitive directories:
-
~/.secrets -
~/.age -
~/.ssh/id_* -
~/.gnupg
Plugins
| Plugin | Status |
|---|---|
|
Enabled |
Tier 6: CLAUDE.md (Global Instructions)
Location: ~/.claude/CLAUDE.md (873 lines)
Section Breakdown:
| Section | Purpose | Lines |
|---|---|---|
Learning-First Approach |
Bootcamp replacement philosophy - document before execute |
3-45 |
CLI Mastery Training |
awk/sed/grep/find/xargs deliberate practice |
49-95 |
FORBIDDEN: Secrets Access |
Never decrypt .age, never gopass show, never read ~/.secrets |
98-124 |
SSH Config Encryption Workflow |
age-encrypted SSH config with stow symlinks |
127-167 |
CI/CD: Cloudflare Pages |
Spoke repos → Cloudflare Pages pipeline |
170-216 |
Senior Engineer & Life Mentor |
Role definition - coach, teacher, guardian |
219-274 |
AI Attribution Policy |
NO AI attribution ever - no Co-Authored-By |
277-297 |
Communication Style |
Direct, honest, not sycophantic |
299-318 |
Command Quality Standards |
Senior-level commands with verification, git -C patterns |
320-393 |
Git Workflow Automation |
gach/gacp heredoc functions, .gitconfig aliases |
395-432 |
Documentation Strategy |
domus-* migration from Principia/PRJ-* legacy structure |
434-445 |
File Format Preferences |
AsciiDoc only, D2/Mermaid diagrams, commit output artifacts |
447-451 |
AsciiDoc & Antora Standards |
Attributes, partials, cross-refs, NO inline TOC, no hardcoding |
453-727 |
Code Block Formatting |
Separate vs group commands, placeholder examples |
729-780 |
Pre-Write Attribute Verification |
MANDATORY grep antora.yml before writing any .adoc |
783-817 |
Root Cause Analysis Format |
RCA template for build failures and documentation errors |
820-846 |
Claude Code System Awareness |
Layered config overview (settings, skills, hooks, rules, agents, output style), deployment model (stow from dots-quantum), auto-load principle for rules |
848-873 |
Modernization Needed: See CR: CLAUDE.md Modernization
CLAUDE.md Workshop
A lab for collecting, analyzing, and building CLAUDE.md configurations. Your configs, community configs, and drafts for new ones.
Your Collection
Global Baseline
| Config | Purpose |
|---|---|
|
Snapshot of production |
Context Configs (Purpose-Built)
Ready-to-use configs for specific work contexts. Use as project-scoped CLAUDE.md files, combine sections, or reference during sessions.
| Config | When to Use |
|---|---|
|
Spanish study sessions — DELE/SIELE prep, Don Quijote, conectores, subjuntivo, all-Spanish instruction |
|
RHCSA exam prep — RHEL 9 framing, SELinux priority, dnf/firewalld (not pacman/nftables), exam-style verification |
|
Production infrastructure work — VyOS, ISE, Vault, k3s, BIND, converged troubleshooting, runbook-first |
|
Python/netapi development — Click/Rich/httpx patterns, API integration, pytest, code review |
|
CISSP exam prep — managerial mindset, 8 domains, HIPAA context, real infrastructure mapped to frameworks |
|
Math study — College Algebra, LaTeX notation, step-by-step proofs, engineering connections |
|
Neovim/Lua development — LuaJIT (not 5.4), instrumentum-nvim, mini.nvim, AsciiDoc text objects, LSP config |
How to Use
As project-scoped CLAUDE.md:
# Copy a context config into a project
cp examples/claude/context-rhcsa-study.md /path/to/project/.claude/CLAUDE.md
Combine contexts:
# Merge infrastructure + python for netapi work
cat examples/claude/context-infrastructure-ops.md examples/claude/context-python-dev.md > /path/to/netapi/.claude/CLAUDE.md
Reference during sessions:
Paste relevant sections into conversation context or use as / skill input.
Project-Scoped (domus-* repos)
| Repo | Focus | Lines |
|---|---|---|
domus-captures |
Hub-spoke architecture, project structure standard, build commands, partials system |
|
domus-infra-ops |
Infrastructure runbooks, diagrams, inventory |
|
domus-ise-linux |
802.1X EAP-TLS methodology |
|
domus-ise-ops |
ISE policy, profiling, deployment |
|
domus-ise-windows |
Windows 802.1X EAP-TLS |
|
domus-linux-ops |
Linux administration patterns |
|
domus-windows-ops |
Windows/PowerShell administration |
|
domus-identity-ops |
Identity & SSO (SAML, Keycloak, FreeIPA) |
|
domus-automation-ops |
Templates, GitOps, Ansible |
|
domus-siem-ops |
SIEM (QRadar, Sentinel, Wazuh, Splunk) |
|
domus-math |
Mathematical content (Quarto) |
|
domus-docs |
Antora aggregator hub |
|
dots-quantum |
Dotfiles stow packages (includes all Claude config) |
Full configs stored in examples/claude/domus-*.md.
Archived Versions
Superseded configs kept for evolution tracking.
Location: examples/claude/archived/
Community Collection
Configs collected from community repos for study and pattern extraction. Not for copying wholesale — for understanding what patterns others use and what’s worth adopting.
Location: examples/claude/community/
| File | Source | What’s Interesting |
|---|---|---|
|
FlorianBruniaux/claude-code-ultimate-guide |
FIRE framework (First Response → Investigate → Remediate → Evaluate), safety rules for destructive commands, runbook template format |
|
rohitg00/awesome-claude-code-toolkit |
Opinionated CI/CD rules (pin actions to SHAs, 10-min pipeline max), Docker multi-stage patterns, K8s resource limit philosophy, GitOps promotion flow |
|
VoltAgent/awesome-claude-code-subagents |
Network engineering checklist (99.99% uptime, <50ms latency), DNS architecture patterns, hybrid cloud networking, zero-trust implementation |
Community Sources
Repos where engineers publish their Claude Code configs:
-
awesome-claude-code — curated skills, hooks, configs
-
everything-claude-code — 30+ contributors, hackathon-born
-
claude-code-best-practice — CLAUDE.md patterns
-
claude-howto — copy-paste templates, hook scripts
-
awesome-claude-skills — 22k+ installs, skills gallery
Building New Configs
Template: Project-Scoped CLAUDE.md
Minimum viable CLAUDE.md for a new domus-* repo:
# Component Name - Claude Context
## Identity
- **Repository:** domus-<name>
- **Component:** `<antora-name>`
- **Domain:** <name>.domusdigitalis.dev
## Purpose
<One paragraph: what this repo does>
## Build Commands
```bash
make # Build
make serve # Build + serve
```
## Cross-References
```asciidoc
xref:<component>::page.adoc[Link Text]
```
## Sensitive Content
- Redact passwords, API keys, tokens with `<REDACTED>`
- Use `dsource`/`dsec` references for credential loading
Analysis: What Makes a Good CLAUDE.md
See Patterns & Anti-Patterns for the full breakdown. Key principles:
-
Rules, not suggestions — Claude follows firm directives, not polite requests
-
RCA-driven — Every rule should trace back to a real incident
-
Layered — Global CLAUDE.md for behavior, project CLAUDE.md for context, rules/ for file-type patterns
-
Under 200 lines per file — Split into rules/ if the global file grows past this (yours is at 873 — splitting is overdue)
-
No stale data — Don’t duplicate values that live in antora.yml or git history