Moving from CLAUDE.md rules to infrastructure enforcement with Citadel

✍️ OpenClawRadar📅 Published: March 23, 2026🔗 Source
Moving from CLAUDE.md rules to infrastructure enforcement with Citadel
Ad

The problem with rule accumulation

When Claude ignored instructions, the instinct was to add more rules to CLAUDE.md. Starting at 45 lines, it grew to 190 lines over three months, but compliance worsened. Instructions past line 100 started being treated as suggestions rather than rules. A forensic audit revealed 40% redundancy—rules saying the same thing in different words, rules contradicting each other, and outdated rules. Trimming to 123 lines improved compliance immediately.

The infrastructure shift

The real fix was recognizing CLAUDE.md as an intake point for orientation (project conventions, tech stack, key priorities), not a permanent home for all rules. Everything else should be loaded only when needed. The key shift: moving enforcement from instructions to the environment.

For example, instead of a rule saying "always run typecheck after editing a file," which Claude followed inconsistently, a lifecycle hook script runs automatically on every file save. This ensures typechecking happens without agent choice, surfacing errors immediately rather than 20 edits later. This cut review time dramatically, allowing focus on intent and design rather than chasing type errors.

The progression system

The author outlines a five-level progression:

  • Level 1: Raw prompting (nothing persists, same mistakes repeat)
  • Level 2: CLAUDE.md (rules help but hit a ceiling around 100 lines)
  • Level 3: Skills (modular expertise that loads on demand, zero tokens when inactive)
  • Level 4: Hooks (environment enforces quality, not instructions)
  • Level 5: Orchestration (parallel agents, persistent campaigns, coordinated waves)

Most projects are fine at Level 2 or 3. The critical insight: when CLAUDE.md stops working, the answer isn't more rules—it's moving enforcement into infrastructure.

Ad

Specific implementations

The author implemented three key systems:

  • Skills: Markdown files encoding patterns, constraints, and examples for specific domains. The agent loads relevant skills for the current task, avoiding token waste on irrelevant context.
  • Campaign files: Structured documents tracking what was built, decisions made, and what remains. These persist across sessions, eliminating daily re-explanations.
  • Automated hooks: Typecheck on every edit, anti-pattern scanning on session end, circuit breaker killing the agent after 3 repeated failures on the same issue, and compaction protection saving state before Claude compresses context.

Citadel: The open-source system

The full system, called Citadel, has been open-sourced at https://github.com/SethGammon/Citadel. It includes the skill system, hooks, campaign persistence, and a /do command that routes tasks to the right orchestration level automatically. Built from 27 documented failures across 198 agents on a 668K-line codebase, every rule traces to something that broke.

📖 Read the full source: r/ClaudeAI

Ad

👀 See Also

Claude to PDF Chrome Extension Exports Long Conversations with Formatting Intact
Tools

Claude to PDF Chrome Extension Exports Long Conversations with Formatting Intact

A developer has released a free Chrome extension called Claude to PDF that captures full conversation history from Claude AI chats and preserves code blocks, LaTeX math, and table formatting when exporting to PDF.

OpenClawRadar
claude-powerline v1.20 adds TUI dashboard mode, context bar styles, and environment variable display
Tools

claude-powerline v1.20 adds TUI dashboard mode, context bar styles, and environment variable display

claude-powerline v1.20 introduces a TUI dashboard mode that replaces the single statusline with a full panel showing model info, context usage with progress bar, costs, git status, and more. The update adds 9 visual progress bar styles for context usage and environment variable display capability.

OpenClawRadar
AutoProber: AI-driven flying probe automation for hardware hacking
Tools

AutoProber: AI-driven flying probe automation for hardware hacking

AutoProber is a hardware hacker's flying probe automation stack that enables AI agents to discover targets, map microscope images, perform safety-monitored CNC motion, review probes, and conduct controlled pin probing. It includes Python control code, a web dashboard, CAD files, and operates with GRBL CNC controllers, USB microscopes, and oscilloscope safety monitoring.

OpenClawRadar
PocketBot: iOS app uses Claude to generate deterministic JavaScript automations from natural language
Tools

PocketBot: iOS app uses Claude to generate deterministic JavaScript automations from natural language

PocketBot is an iOS mobile automation app that uses Claude via AWS Bedrock to convert plain-language requests into self-contained JavaScript scripts. The LLM writes the code once, then the deterministic scripts run on schedule in a sandboxed runtime without AI involvement.

OpenClawRadar