<aside> 🛡️
Sovereign engineering is what happens when you treat your AI coding agent like production infrastructure: governed, secure, modular, and measurably reliable.
This manifesto documents a practical setup that prevents context drift, eliminates brittle imperative habits, and turns “AI coding” into a repeatable engineering system.
</aside>
<aside> 🧠
Goal
Persistent, context-aware coding.
</aside>
<aside> ⚙️
Mechanism
A modular instruction stack + functional patterns.
</aside>
<aside> 🏛️
Non‑negotiables
Privacy, PoLP, and post‑task memory.
</aside>
AI coding fails in predictable ways:
Sovereign Engineering treats the agent as a first-class engineer inside a governed system. The system forces alignment before code and closes the loop after code.
~/.claude/settings.json<aside> ⚙️
This file is the runtime control plane for Claude Code: it enables plugins, sets environment flags, defines guardrail permissions, and wires lifecycle hooks that keep memory in sync.
</aside>
<aside> 📝
Note: This settings.json is subjective to the specific setup and use-cases covered in this article (memory workflows, tool-guardrails, and multi-agent experimentation). Your optimal configuration can be very different depending on your risk tolerance, local environment, and the plugins/hooks you rely on.
</aside>
settings.json is doing<aside> 🧪
1) Environment flags
CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1: Enables experimental agent teams / multi-agent workflows.CLAUDE_MEM_MODE=code--zh: Selects the memory mode used by claude-mem (tuned for code-centric capture).
</aside><aside> 🧩
2) Plugin enablement
enabledPlugins.claude-mem@thedotmack=true: Turns on the claude-mem plugin so memory can be injected/captured automatically.extraKnownMarketplaces.thedotmack: Pins the plugin source to GitHub (thedotmack/claude-mem) so Claude knows where to resolve it.
</aside><aside> 🔒
3) Guardrail permissions (deny list)
You explicitly deny reading sensitive locations and dangerous shell commands.
Read(…/.ssh/**), Read(…/.aws/**), Read(…/.gnupg/**)Read(…/**/.env*) (blocks common dotenv secret sprawl)Read(…/node_modules/**), Read(…/vendor/**)Bash(rm -rf /), Bash(rm -rf ~)Bash(git push --force)Bash(curl *|bash), Bash(wget |bash)This enforces PoLP + blast-radius reduction for an agent that can use tools.
</aside>
<aside> 🔁
4) Lifecycle hooks (memory automation)
You’ve wired hooks so memory is injected at the start, captured after tool use, and finalized on stop:
startup|resume|clear|compact)
npx claude-mem inject (timeout 60s).)
npx claude-mem capture (timeout 120s, async: true).*)
npx claude-mem stop (timeout 120s)~/.claude/settings.json