The System Prompt I Use to Run an Autonomous Claude Code Agent (Free Template)
I run Claude Code as an autonomous agent on a Mac Mini. It reads its own memory file on startup, works through a revenue plan, publishes content, and logs its own progress at the end of every session — without me telling it what to do each time.
None of that works without a system prompt that actually defines the agent as an operator, not a chatbot. Most people give Claude Code a task list. I gave mine an identity. Here's the template, and why the structure matters more than the wording.
Why a task list isn't enough
A task list tells an agent what to do today. It doesn't tell it who it is between sessions. If your agent starts every conversation cold, re-deriving context, asking what it should prioritize, you're not running an autonomous agent — you're running a very expensive to-do list reader.
The fix is a persistent identity file the agent reads first, every session, before touching any task. Mine is called CLAUDE.md and it sits at the root of the project. Claude Code loads it automatically.
What's actually in the template
Five sections do the real work:
1. Identity and mission. Not "you are a helpful assistant" — a name, a job, and a number. Mine states a hardware payback goal and a token budget. A concrete target changes how the agent prioritizes; "be helpful" doesn't.
2. A read-first startup sequence. Before doing anything, the agent reads its memory log and its current plan files. This is the difference between an agent that remembers it already tried something last week and one that repeats itself.
3. Priority-ordered workstreams. A numbered list of what to work on and in what order, so the agent doesn't need to ask. Ambiguity is what forces an autonomous agent back into chat mode.
4. Voice and constraints. What the agent should sound like, and just as important, what it is not. Mine has an explicit "What You Are Not" section: not a chat assistant, doesn't ask permission on routine work, doesn't pad responses. Negative constraints cut more waffle than positive ones.
5. A mandatory session-end write-back. Before closing, the agent updates its own memory file: what got done, what's blocked, what's next. Skip this and every session starts from zero. This is the actual mechanism that makes "autonomous" true instead of aspirational.
What I got wrong the first time
My first version of this file was a static list of tasks with no memory instruction. The agent did good work every session and forgot all of it by the next one — re-publishing the same draft ideas, re-checking things it had already verified. Adding the mandatory read-first and write-back steps fixed it. That one change did more than any prompt-wording tweak.
I also learned to keep the token budget explicit in the prompt itself. Stating "60,000 tokens/day, spend them like money" changed agent behavior more than any efficiency instruction I tried. Framing constraints as money, not abstract limits, works.
The honest numbers
This agent has been running since March 2026, publishing weekly content and managing four Gumroad products with no manual intervention beyond approving the first sale to unlock Discover. Revenue is still early — first sale was £1 to unlock the storefront, and this build is not yet at the £700 hardware payback goal. The system prompt isn't what makes an agent profitable. It's what makes it consistent enough to find out whether the underlying idea is.
If you're automating the publishing or scheduling side of this (cross-posting, triggering runs, chaining steps), I use Make.com for that layer — here's my referral link if you want to try it.
Want the actual file, not just the structure? I packaged the full identity template — plus the memory schema — into the Soul Kit.
Or start with the free version: the Autonomous Agent Starter Kit — one page, no email spam, just the template.
Top comments (0)