The Engineering Cost of Extremely Long System Prompts
A leaked instruction text reportedly tied to a closed-source large model has grown to roughly 200,000 characters, up from about 120,000 in earlier versions. Regardless of its authenticity, this scale is a warning sign for anyone building AI agents. This article breaks down the practical costs of oversized system prompts—latency, per-request spend, and diluted attention—and explains how layered loading, a memory file system with time-based write criteria, versioned conflict resolution, and observability practices can keep resident instructions lean and maintainable.
1. The Trend: Instruction Sets Are Turning from Manuals into Encyclopedias
A long instruction text reportedly belonging to a closed-source large model has been circulating in public communities, reaching a scale of around 200,000 characters. In several earlier versions, similar texts were only about 120,000 characters. Setting aside whether it is genuine, this order of magnitude is itself a signal that everyone doing agent engineering should take seriously: the system prompt is no longer just “role definition plus a few constraints,” but is gradually evolving into an all-encompassing internal specification collection.
Judging from the structure of the circulated content, the additions are concentrated in a few areas: read/write specifications for cross-session persistent memory (when to read, when to write, directory structure, file formats, privacy boundaries, conflict handling), capability descriptions across different product forms (conversational assistants, intelligent coding tools, office collaboration, browser extensions, spreadsheet and presentation generation, design tools), retrieval and file and artifact and citation specifications, finer-grained reminders for high-risk scenarios such as child safety, mental health, weapons, cybersecurity, and very long conversations, plus a large number of highly specific language style and interaction rules. The most obvious expansion is a memory file system specification whose length rivals a product specification document.
This evolution pattern is very typical: every time a problem is exposed, a prompt is patched in; every time a new requirement appears, a classifier description or a block of behavioral constraints is added. In the short term, each addition looks like a patch; in the long term, it migrates complexity from code and workflows into natural language. Natural language has no type system, no module boundaries, and no dependency analysis. Once it exceeds a certain scale, maintenance costs rise nonlinearly.
2. Context Budget: What 200,000 Characters Actually Means
First, let’s clarify the units. For most mainstream tokenizers, English text is roughly 1 character ≈ 0.25–0.3 tokens, so 200,000 characters is about 50,000–60,000 tokens; if the text contains a large amount of Chinese, the token count will be even higher. In other words, the “opening remarks” alone consume a substantial portion of the context window.
This creates three direct costs:
- Higher time to first token (TTFT). Computation in the prefill stage is roughly linear with input length; the longer the input, the longer the user waits.
- Higher cost per request. Input tokens are typically billed by volume, so the fixed overhead is multiplied by every call. In high-concurrency products, this is a continuous expense.
- Diluted effective attention. Reduced recall of information in the middle of long contexts is a widely observed phenomenon in the industry. The more instructions there are, and the more centrally located they are, the lower the probability they are actually “seen.”
Here is a rough estimate of the fixed overhead per request:
Fixed instruction overhead = system prompt tokens × input price per callDaily cost ≈ fixed instruction overhead × daily request count# 60,000 resident tokens at a million daily requests is an astronomical number
The conclusion is clear: resident instructions should be managed as a scarce resource, not treated as free sticky notes.
3. Layered Loading: Splitting the “Encyclopedia” into an On-Demand Index
The most worthwhile design in the circulated text is not what it says, but its loading strategy: each turn injects only three things—the user profile body, answer preferences, and the “directory” of all memory files (path + summary + alias + source). The remaining bodies are not injected; after the model sees a relevant entry, it explicitly reads it.
This idea can be abstracted into a general engineering principle: only the index can be resident; bodies must be fetched on demand.
Resident layer (injected every turn, as small as possible)- Role and safety baseline- Tool list and invocation protocol- Memory directory (path, summary, alias, source)On-demand layer (triggered by tool calls)- memory_read(path) -> body- Specification docs / domain manuals / historical decision records
In practice, it is advisable to set a hard budget for the resident layer—for example, no more than 10%–15% of the total context—and to apply summary compression and deduplication to directory entries. For the on-demand layer, set limits on the number of reads and total bytes to avoid “reading too much” and blowing up the window.
4. Memory File System: Five File Types and Write Criteria
The original text mentions that memory is organized into five categories and specifies /profile.md for stable identity (name, title, role, organization, long-term responsibilities). The criterion is “whether it still holds three months later.” This is a very practical time-scale criterion that can be generalized into a universal memory governance rule:
| Layer | Typical content | Time scale | Write criterion |
|---|---|---|---|
| Identity profile | Role, responsibilities, long-term goals | Months–year | Still holds after three months |
| Preferences | Answer length, format, language style | Months | User explicitly states it or repeatedly corrects it |
| Project area | Architecture decisions, technology choices | Weeks–months | Affects multiple subsequent tasks |
| People/topics | Collaboration relationships, interest topics | Months | Recurs repeatedly and is reusable |
| Session temporary | Current task context | Hours–days | Not persisted by default |
Three things need to be made explicit: writing is not done only when the user asks, but when it will be useful in the future; privacy boundaries (what content is forbidden from being persisted, and how persisted content is encrypted and isolated); and source annotation (recording which session or file a memory entry came from), which facilitates auditing and rollback.
5. Concurrency and Conflicts: The Risks of Sharing One Memory Across Clients
The original text points out that different interfaces—conversational assistants, intelligent coding tools, collaboration spaces—may share the same set of memory files and even modify them simultaneously. In engineering terms, this is a classic multiple-writer shared state problem that must be handled explicitly; otherwise, lost updates and self-contradictions will occur.
Practices worth borrowing:
# Add version and source to the file header; writes use "read-modify-verify-write"---version: 7updated_at: 2026-01-10T09:00:00Zsource: coding-agent---# On conflict: higher-priority source > newer version > explicit user confirmation
In engineering, you can introduce optimistic locking (version number/ETag semantics), replace in-place overwrites with an append-only log, and establish a “single source of truth” convention for key fields (for example, architecture decisions may only be modified in the area file). Conflicts should not be left to the model’s discretion but resolved by deterministic rules.
6. Observability of Behavioral Drift and Instruction Conflicts
The more instructions there are, the greater the probability they contradict each other: one side requires “concise,” the other requires “explain item by item”; one side requires “conclusion first,” the other requires “restate the requirements first.” Such conflicts do not raise errors; they only cause output style to drift randomly.
It is recommended to establish three types of observability:
- Instruction coverage evaluation: prepare automatically judgeable test cases for each hard constraint, measure pass rates during regression, and identify dead instructions that are “written but not effective.”
- Prompt versioning and canary rollout: manage the system prompt like code, with changes going through review, canary release, and rollback; each change should include the token increment and cost increment.
- Behavioral instrumentation: record the hash of the actually injected resident content, the number of on-demand reads, and directory entries hit/missed, to locate cases of “should have read but didn’t” and “read but didn’t use.”
7. An Execution Checklist for Teams
- Set a character/token budget for the resident prompt; anything over the limit must be pushed down to the on-demand layer.
- Replace full-body injection with directory + summary + explicit reading.
- Use time-scale criteria for memory writes, and mandate source and privacy-level annotation.
- Introduce version verification and append-only logs for shared state across clients; resolve conflicts with rules.
- Use independent policy modules rather than scattered entries for high-risk scenarios (child safety, mental health, weapons, cybersecurity), making auditing and updates easier.
- Bring prompts into code review and regression testing; every expansion must come with a cost explanation.
8. Conclusion
A 200,000-character system prompt essentially moves “runtime decisions” forward into “text specifications.” It buys short-term behavioral controllability, but it also accumulates three debts: latency, cost, and drift. A truly mature approach is not to keep stuffing more in, but to build a governance system of layered loading, on-demand reading, rule-based conflict resolution, and observable regression. For teams that want to build long-term usable agents, this methodology is independent of the specific model and can be implemented on your own tech stack and general cloud capabilities (object storage, logging services, monitoring and alerting, container platforms)—validate it in small- and medium-scale scenarios first, then expand gradually.
