Agent OS
One Go CLI and one set of config files that give every project the same agents, rules and guardrails.
- Language
- Go, for the CLI
- Agent tool
- Claude Code
- Agents
- 13, on three model tiers
- Skills
- 109 in the pool, 3 more read by path
- Config
- Nine hand-edited files with generated JSON schemas
- Required check
- One CI result gate on every pull request
Problem
I use Claude Code across several monorepos, some for client work and some personal. I wanted every project to get the same agents, rules and tooling without copying setup by hand.
I also wanted agents to work without anyone watching each step, but inside firm limits. An agent that stops to ask a question nobody will answer is no use, and an agent with blanket trust is a risk.
Approach
I built one shared checkout and one Go binary, infractl, that runs all of it. Every decision is written down once in hand-edited YAML. Settings, MCP configuration, agent definitions, the skill pool, skill headers and the reference tables in the docs are generated from those files. I never edit generated output. I change the source and regenerate.
JSON schemas are generated from the Go types of the config, so a file that does not match its schema fails a check. Drift checks fail the same way when a generated file no longer matches its source.
What I built
infractl is the one binary behind everything. It holds the hook handlers, the guard engine, the generators and their drift checks, a git control plane, health checks, scheduled host jobs, memory maintenance, reports and the path resolver. It also has a capability catalog, so a script or verb is listed with a run policy such as safe, destructive or human-only.
Around it sit 13 agents, among them a developer, a planner, a code reviewer, QA and a security auditor, on three model tiers. There are 109 skills in the pool, plus domain hubs with playbooks. Two MCP servers, one for memory and one for web crawling, and a local hybrid search engine complete the set.
Each project also gets a CI gate. One workflow runs unit tests, config and schema drift, every lint, the agent routing eval and a sandbox smoke test. A single job named CI result is the only check the main branch requires.
How it works
Claude Code hooks are registered in one file. A dispatcher runs the guards in order, a deny stops the chain, then the command rewrite runs, then observers run in parallel. Handlers are built into the binary, none is a script. The guard event is fail-closed against its own deadline.
The guard engine parses each call once and runs every rule pack over the same facts. The verdicts are deny, hand-off, ask, rewrite and allow. A deny names the rule and a ready fix. A hand-off is queued for me with the exact command to run. A rewrite swaps in a form the sandbox can run, and the result is checked again. An allow still passes native permissions and a bubblewrap sandbox that bounds writable roots, readable roots and network domains.
The engine knows how closely a session is watched: attended, auto or unattended. In an agent session an ask never reaches anyone. The rule's agent decision applies instead, which is an allow, a deny with a fix, or a hand-off.
Agents work only in linked worktrees, one per branch. Commit, push and pull request go through infractl git. A draft pull request comes back, CI runs, and I review and merge.
Key decisions
I generate everything from config and never edit the output. That way a project's settings, agents and skills cannot quietly diverge from the source, and drift checks in CI catch it when they do.
I made the guard hook fail closed. Claude Code treats a hook that passes its timeout as non-blocking and would run the call unguarded, so a watchdog writes a deny shortly before the deadline.
Agent sessions never get an ask. Nobody is there to answer, so each rule names what an agent receives instead: a run, a deny with a fix, or a hand-off queued for me while the agent carries on with other work.
Generated agents and skills are real directory copies, not symlinks. The sandbox turns a missing protected path into a read-only placeholder file, and a link whose target was missing used to block generation until setup ran with every session closed.
Agents never edit a main checkout. Each task gets a worktree on its own branch, the guards deny edits into the main checkout, and no agent merges to the default branch.
Memory injects little and points to the rest. The start packet is about 800 tokens, and agents pull more on demand through search, timeline and get, so a session never loads an unfiltered store.
In detail
An agent is a boundary: a tool grant, a caller identity for the guards, a guardrail hook or context isolation. A procedure that needs none of those is a playbook inside a domain hub. The registry therefore stays small. Each agent has a hand-written agent.md, an instructions file mapping each mode to a playbook, and registry keys for model, tools, skills, modes and route keywords. I invoke one as /agent with an optional mode flag.
Skills come from three sources: shared, owned by one agent, or inside a hub. Each is a SKILL.md with a size limit, and long material goes to linked reference files. Lints check names, links, descriptions and preload budgets, and a routing eval keeps agent selection honest.
Scheduled jobs run as systemd user timers, each under its own lock and timeout, and a failure becomes an inbox item. A nightly chain runs pruning, memory and vault backups with verification, settings drift checks and an end-to-end session test. Weekly reports cover autonomy, cost and retrieval quality, and a monthly restore drill checks that backups restore.
Memory is a set of file stores written only through the memory MCP server and infractl: decisions, learnings, summaries and a short-lived pad that hands work between agents. Health rows from a doctor command report what is healthy and what is not.
Status
Active. It is the setup I work in every day, and I keep optimizing it in my daily workflows before I share it as open source. I have no usage numbers to report.