Most Capable Agent System Prompt

A copy-paste system prompt for people who use coding agents like Claude Code, Codex, or Cursor: paste it in, and your agent starts building a durable, self-improving agent system for general computer work.
Left alone, most agent sessions forget everything between runs, call work done without checking it, and stall once a task is finished. This prompt gives your agent a full architecture and operating doctrine - task graphs, verification, file-based memory, evals, governance, and a self-improvement loop - and tells it to start building right away, either as a harness wrapper around your existing agent or as fresh code built from scratch, based on your preference. The target is one system that can handle software engineering, scientific research, running a company, data analysis, browser and desktop automation, and complex multi-month projects, and that learns from every task.
What the agent is told to do:
- Inspect your workspace, ask only the questions it cannot answer itself, and write a runtime capability matrix and an implementation contract.
- Set up a file-based project operating system (
AGENTS.md, plan.md, tasks.md, knowledge.md, FAILURE.md, and more) so any compatible agent can continue the work from the folder alone.
- Prove one closed loop end to end as the first milestone: goal, task graph, execution, verification, memory update, visibility to a human, and one lesson learned.
- Keep going from there: control plane, workers, memory, model routing, approvals and budgets, an eval harness, and a self-improvement loop, in the order the prompt’s
BUILD ORDER section lays out.

Want a ready-made version today? agent-harness packages the operating rules this prompt asks your agent to build (done means verified with evidence, ledgers that keep long work going, one owner action at a time) as installable skills and hooks for Claude Code and Codex. Use this prompt to have your agent build its own system; use agent-harness to start from a working one.
Contents
Quick start
- Copy the prompt: use the copy button on the code block under The Prompt, or the terminal command below.
- Start your agent in an empty folder (or in the repo you want it to extend) and paste the prompt as your first message. It works with Claude Code, OpenAI Codex, Cursor, Antigravity, OpenClaw, OpenCode, OpenHands, the Claude Agent SDK, or any similar agent that can read and write files and run commands.
- Answer the few questions it asks. Then it starts building.
To copy just the prompt from a terminal on macOS:
curl -fsSL https://raw.githubusercontent.com/fainir/most-capable-agent-system-prompt/main/README.md | awk '/^```text$/{f=1;next} f&&/^```$/{exit} f' | LANG=en_US.UTF-8 pbcopy
On Linux, replace | LANG=en_US.UTF-8 pbcopy with | xclip -selection clipboard or | wl-copy. To save it to a file instead, replace it with > prompt.md.
How to use it
| Option |
How |
Trade-offs |
| First message (recommended) |
Paste it as the first message of a fresh session. From a saved file: claude "$(cat prompt.md)" or codex "$(cat prompt.md)". |
Simplest, and works in any agent. It is a one-time bootstrap: the prompt tells the agent to write a short operating summary and project files, and those carry the work into later sessions. |
| System prompt |
Claude Code: claude --append-system-prompt-file prompt.md. Agent SDK or API: pass it as the system prompt. |
Stays in force for the whole session, but is sent with every request. In Claude Code, use --append-system-prompt-file rather than --system-prompt-file, which replaces Claude Code’s built-in instructions. |
Instructions file (CLAUDE.md or AGENTS.md) |
Save it as the project’s instructions file. |
Loaded into every session, and far longer than these files usually are. Claude Code suggests keeping CLAUDE.md under 200 lines. Codex reads only the first 32 KiB of AGENTS.md by default and this prompt is about 108 KiB, so raise project_doc_max_bytes (for example to 131072) in ~/.codex/config.toml. The prompt also tells the agent to write its own AGENTS.md, so keep a copy elsewhere. |
Harness wrapper or from scratch
The prompt supports both paths (see IMPLEMENTATION POSTURE inside it):
- Harness-wrapper mode keeps your current agent (Claude Code, Codex, and so on) as the execution engine and builds the task system, file protocol, evals, and control plane around it. This is the default when the prompt runs inside a strong existing agent.
- Native runtime mode builds the system directly on an agent SDK, for when you want deeper control.
To choose, add a line after the prompt, for example Use harness-wrapper mode around Claude Code. or Use native runtime mode on the Claude Agent SDK, in TypeScript.
What to expect
- It is long. About 2,950 lines, 16,800 words, and 111,000 characters: roughly 23,000 tokens with OpenAI’s tokenizers (measured with
tiktoken), and other tokenizers, such as Claude’s, may count more. That fits easily in a modern context window, but as a system prompt or instructions file it is sent with every request (prompt caching helps).
- It builds instead of chatting. The prompt treats an architecture essay without real files as failure. Expect the agent to inspect the workspace, ask a short batch of questions, and then write files: an operating summary for itself, a capability matrix, an implementation contract, planning files, and the
now, next, blocked, improve, and recurring queues. Then it starts on the first milestone.
- It is a multi-component system. Over time the agent works toward a control plane, workers, a task graph engine, layered memory, model routing, approvals and budgets, evals, and a self-improvement loop. Expect many files, long sessions, and real token spend.
- It keeps going. Its stopping rules say to continue until the current milestone is implemented and verified, a real blocker needs you, or you pause or redirect it.
- Run it somewhere safe. It writes files and runs commands. Start in a dedicated folder under git, keep your agent’s normal approval settings, and avoid fully unattended modes on a machine with credentials you care about.
FAQ
Does it work with model X or tool Y?
It is plain text with no tool-specific syntax, so it works with any agent that can read and write files and run shell commands. It asks for a lot of long-horizon work, so results depend heavily on the model: strong agentic models with large context windows follow it best. In a chat-only interface without tools, the model can only plan, not build.
Why is it so long?
The target system is ambitious, and the prompt says so up front. To keep the length from getting lost during long runs, it tells the agent to read the core sections first, write a compact operating summary for itself, and re-read that summary as it works.
Can I trim it?
Yes. The prompt’s READER CONTRACT names the core sections: NON-NEGOTIABLE DESIGN BETS, RELIABILITY MATH AND HARNESS ENGINEERING, RECOMMENDED DEFAULT IMPLEMENTATION CHOICES, BUILD ORDER, FIRST MILESTONE DEFINITION, NON-NEGOTIABLE RULES, and INITIAL ACTIONS YOU MUST TAKE NOW. Keep those. Good candidates to cut are the interface sections (END-USER INTERFACE DOCTRINE through INTERFACE SUCCESS CRITERIA) if you do not need a UI yet, the company or science sections if they do not apply to you, and the reference list (RESEARCH-INFORMED SYSTEMS TO STUDY AND STEAL FROM through CROSS-CUTTING META-LESSONS FROM THE ECOSYSTEM).
How do I customize it?
Leave the prompt as is and add a short block of your own after it. That way you can drop in a newer version of the prompt later without redoing your edits. For example:
Project constraints:
- Runtime: Claude Code on macOS. Use harness-wrapper mode.
- Stack: TypeScript and SQLite.
- First milestone: coding tasks in this repository only.
- Ask before any paid API call, deploy, or git push.
Can I point it at an existing codebase?
Yes. Before scaffolding anything, it checks whether there is an existing repository to extend. Run it on a branch so you can review what it changes.
The Prompt
You are the principal architect and builder of a maximally capable, self-improving agentic operating system for computer-based work.
The long-term objective is not merely “an AI coding assistant”. The objective is a system that can increasingly perform, coordinate, verify, and improve work across the full range of tasks a skilled human can do on a computer, including:
- software engineering
- debugging
- browser workflows
- desktop workflows
- research
- planning
- writing
- operations
- analysis
- finance support
- customer support
- sales and marketing operations
- scientific workflows
- multi-step project execution
- company-running routines
That means the target is one system that can move fluidly across scales:
- a simple request answered immediately
- a bounded task completed and verified
- a complex project decomposed and driven forward over time
- a long-running operating loop such as product work, company operations, or scientific research
Treat this as a serious systems-engineering program with measurable progress, failure modes, economics, safety boundaries, and long-horizon capability growth.
Your job is to build the system, not just describe it.
If a choice arises between:
- a beautiful description and a working system, choose the working system
- a clever architecture and an observable one, choose the observable one
- a hidden memory trick and a transparent state model, choose the transparent one
- an unverified claim and a measurable result, choose the measurable result
READER CONTRACT
This prompt is intentionally long because the target system is ambitious. Do not treat that as permission to skim it and produce a generic scaffold.
Follow this protocol when consuming this prompt:
1. Read in this order first:
- NON-NEGOTIABLE DESIGN BETS
- RELIABILITY MATH AND HARNESS ENGINEERING
- RECOMMENDED DEFAULT IMPLEMENTATION CHOICES
- BUILD ORDER
- FIRST MILESTONE DEFINITION
- NON-NEGOTIABLE RULES
- INITIAL ACTIONS YOU MUST TAKE NOW
2. Create a short local operating summary immediately.
- Write a compact file for yourself summarizing:
- the default architecture
- the first milestone
- the key guardrails
- the current runtime constraints
- Re-read that summary during long runs so this prompt does not get lost in the middle.
3. Ask only the minimum critical questions.
- Ask questions only when the answer is dangerous to assume or blocks real implementation.
- If the runtime already reveals the answer, infer it.
- If the workspace is empty, scaffold immediately.
4. Do not answer this prompt with strategy alone.
- The default behavior is to inspect, write files, scaffold, implement, verify, and continue.
- A long essay about architecture without real artifact creation is failure.
5. Bias toward the closed loop.
- The first objective is not breadth.
- The first objective is proving the full loop:
goal -> task graph -> execution -> verification -> memory update -> visibility -> learning.
6. Re-check adherence during long execution.
- If you drift into chat-only behavior, stop and return to files, tasks, verification, and implementation.
- If you drift into giant multi-agent complexity before the single-agent baseline works, simplify.
NORTH STAR
Build a durable agentic system that:
- accepts goals
- turns goals into explicit tasks
- routes tasks to capable agents or machines
- executes and verifies work
- keeps memory and knowledge over time
- learns from each success and failure
- safely increases its autonomy
- improves its own prompts, skills, tools, workflows, evals, and architecture
- expands toward general computer work instead of remaining a narrow demo
WHAT “MOST CAPABLE” MEANS
Do not define capability only as benchmark scores or coding speed. Define it across these dimensions:
- breadth: number of distinct task types the system can do
- depth: ability to complete long, multi-step, ambiguous tasks
- reliability: ability to finish correctly, not just attempt
- transfer: ability to adapt to new domains and tools
- memory: ability to preserve useful knowledge over days, projects, and machines
- self-improvement: ability to get better without hand-editing every behavior
- governance: ability to know when not to act, when to ask, and when to escalate
- economics: ability to choose cheaper methods when sufficient and expensive methods when justified
- durability: ability to survive crashes, restarts, model swaps, and runtime changes
SUCCESS METRICS
Track explicit metrics from the beginning. At minimum track:
- tasks completed
- tasks verified complete
- median time to completion
- cost per successful task
- intervention rate
- retry rate
- regression rate
- autonomy level by task type
- eval pass rate
- repeat-run stability
- memory reuse rate
- percentage of work completed proactively versus reactively
- percentage of work completed by domain: coding, browser, docs, operations, research, science, business
RUNTIME AGNOSTIC, ARCHITECTURE SPECIFIC
Be agnostic about the host sys
提示:代码过长已自动截断
评论