Three months ago I used Claude Code as smart autocomplete. Today Claude Code runs the daily operations of my one-person AI company. The change had almost nothing to do with better prompting. It came from treating Claude Code as a junior operator that executes, not a genie that answers.
From a genie that answers to a junior operator that executes
At first I treated Claude Code like a genie. I asked a question, pasted code, and copied the answer back. It was useful, but I was still the bottleneck for every single step.
The shift was deciding to treat Claude Code as a junior operator. A junior operator does not need cleverer questions. It needs the same three things you give any new hire: written rules, a clear scope, and persistent memory. Once Claude Code had those three things, it could run recurring work on its own and stop to ask me only when something was irreversible.
What does a written constitution for an AI agent look like?
The foundation is a layered CLAUDE.md file. CLAUDE.md is the instruction file Claude Code reads before it acts. I structure it in layers: global tone and hard rules at the top, then one file per business area below.
The hard rules sit at the top because they must never be overridden by a local instruction. Examples: every command runs inside Docker, never write to a production database, never delete published work. Each business area (marketing, the 2asy.ai pipeline, the Entity Resolution API) then gets its own CLAUDE.md with the details that only apply there. Claude Code reads its boundaries before it touches anything.
Why seven specialized sub-agents instead of one
I run seven specialized sub-agents, and each one owns a single recurring job. One drafts marketing posts. One analyzes job-fit. One triages email. One extracts knowledge-graph seeds for 2asy.ai.
The reason is context hygiene. If one agent does everything, its context fills with unrelated work and its judgment degrades. With specialized sub-agents, the main Claude Code agent routes a task to the right specialist instead of doing everything inside one bloated context. The main agent stays a router and reviewer. The specialists stay focused.
How does an agent remember decisions across sessions?
Claude Code writes and recalls a set of small memory files, nearly thirty of them, across sessions. Each file holds one fact: a user preference, a past decision, a project constraint, or a piece of feedback.
This matters because context windows are finite. Without persistent memory, every decision I made with Claude Code would evaporate when the session ended. With it, a rule I set once survives context limits and applies the next time the situation comes up.
What guardrails does an autonomous coding agent actually need?
The guardrails are the unglamorous part, and they are the part that makes autonomy safe. These are the hard rules I enforce on Claude Code:
- Every command runs inside Docker, never on the host machine.
- No writes to production databases. Neo4j and Elasticsearch are read-only for autonomous work.
- Never delete published work, database records, or user files.
- Read, analyze, and draft freely. Then stop and ask before anything irreversible.
I enforce these with hooks, not good intentions. A hook intercepts a command before it runs and blocks it if it violates a rule. Discipline that depends on the agent remembering to behave is not discipline. Discipline that is enforced by code is.
Why do most of these rules exist?
Here is the honest part. Most of these rules exist because something broke first.
I defined sub-agents mid-session that silently never loaded. I made batching mistakes that corrupted outputs. Permission prompts stalled autonomous runs because I had not pre-approved the safe commands. Each failure turned into a written rule, and the written rule turned into a hook. The system got safer not because I planned it perfectly, but because I wrote down what broke.
The real lesson: operational discipline, not prompting
The hard part of production AI agents is not prompting. It is operational discipline.
You are not summoning a genie that grants wishes. You are onboarding a fast, tireless junior who will do exactly what you allow, including the damage. The work is the same work you would do for a human hire: write the rules down, scope the job, give it memory, and put hard limits where mistakes are expensive.
I went quiet for a month building this, and the products Claude Code now helps run. This is the first of a series where I document what worked and what did not. If you are putting coding agents into real production, the question worth asking is not which model is smartest. It is which guardrail saved you.