When a System Prompt Grows to 200,000 Characters: Analyzing the Cross-Session Memory Design of an AI Assistant

    A leaked system prompt for a flagship AI assistant grew from about 120,000 to 200,000 characters in one month. This article examines why such prompts keep expanding, how the assistant's cross-session memory file system loads only the context it needs, and what this growth reveals about the limits of prompt engineering.

    Leaked system prompts circulating within the AI industry show that the flagship model prompt of one platform grew from about 120,000 characters to 200,000 characters within a month. At this size, the prompt rivals many small code projects, and it raises an engineering question: is the system prompt being misused as a catch-all container for patches?

    Based on the leaked content, the expanded sections fall into several groups:

    • A full persistent memory file system specification: covering when to read and write, file formats, directory structure, privacy boundaries, and conflict handling. It runs to more than 200 lines and reads like an internal product specification.
    • Behavior rules for multiple product forms: separate interaction guidelines for different entry points, including a coding assistant, office collaboration, a browser extension, and document processing.
    • Tool calling rules: constraints for capabilities such as search, file operations, code execution, writing assistance, and citation tracing.
    • Safety and compliance items: detailed rules for risk scenarios, including child protection, mental health, weapons, cybersecurity, and reminders in long conversations.
    • Extensive language style and interaction rules: specific requirements for wording, tone, and formatting.

    This pattern shows clear patch-style growth. Each newly discovered problem adds another prompt rule, and each new requirement adds another section or classifier description. Over time, this creates serious maintainability risks.

    1. Why Do System Prompts Keep Growing?

    1.1 Instruction Forgetting and Adversarial Risk

    Large language models tend to follow instructions less reliably when those instructions sit in the middle of a long context. This is known as the “lost-in-the-middle” effect. To counter it, engineering teams often repeat key constraints or split them into finer-grained sub-rules. Jailbreak techniques also keep evolving. Security teams typically close each known gap by adding a new clause, so the number of safety-related entries grows linearly.

    1.2 A Diverse Product Matrix

    When one model serves several product forms, such as chat, programming, office work, and browser extensions, the easiest option is to put every scenario’s requirements into a single system prompt. The alternative is to maintain a separate prompt for each entry point. Choosing the single prompt is a typical trade-off: it accepts higher complexity to reduce maintenance cost.

    1.3 Prompts as a Training-Free Tuning Method

    Compared with fine-tuning or reinforcement learning, editing a prompt is the fastest and lowest-risk way to tune model behavior. When a business team wants to fix a behavioral defect quickly, adding a prompt rule is almost always the first choice. Over time, the prompt takes on duties that model training, retrieval augmentation, or post-processing logic should handle.

    2. A Highlight: The Cross-Session Memory File System

    The most notable part of this expanded prompt is the memory subsystem. It addresses a basic question: how does an assistant keep an ongoing understanding of a user across multiple sessions?

    2.1 Design Philosophy: Writing for Your Future Self

    The prompt opens with a representative statement: this memory is your working memory across sessions. You write to it not because the user asked, but because your future self will need this context. This turns memory writing from a passive response into active planning. It makes the agent’s responsibility for managing its own state explicit.

    2.2 Injection Strategy: A Three-Part Minimal Context

    The system does not load all memory on every turn. It injects only three things:

    1. User profile body: stable identity information such as name, occupation, and long-term roles. The test for inclusion is whether the information is still likely to hold three months later.
    2. Preference settings: the user’s requirements for response style, format, and tone.
    3. Memory index: the path, summary, aliases, and source of every memory file.

    The other memory files appear only as a directory listing. When the model judges that a file may be relevant, it calls a read tool to fetch the full text. This is a typical lazy loading pattern, closely resembling the on-demand paging approach used in operating systems.

    2.3 A Typical Retrieval Flow

    1. Directory structure:
    2. /profile.md # stable identity
    3. /areas/flutter-project.md # long-term project area
    4. /people/partner.md # important relationship
    5. /topics/food.md # interest topic
    6. User question: "What architecture did I previously decide on for my project?"
    7. Flow:
    8. 1. Scan <memory_listing> and find that /areas/flutter-project.md may be relevant
    9. 2. Call memory_read() to load the body of that file
    10. 3. Answer based on the body; only if the file still contains no relevant information
    11. may the assistant reply that nothing is recorded

    The prompt places particular emphasis on one rule: before answering that no such information is recorded, the model must first check the directory and read any files that might be relevant. This rule targets a common failure mode of memory systems. When the full text is not injected, the model simply says it doesn’t know, and the memory exists in name only.

    2.4 Memory Categories and Write Criteria

    Memories are divided into five categories by semantic domain: identity profile, preferences, areas, people, and topics. Each category has explicit criteria. For example, the identity profile category uses “will this still hold three months from now?” as its write threshold. This separates stable facts from temporary states and keeps memory files free of conversational noise.

    2.5 Privacy and Concurrency Boundaries

    The design defines privacy boundaries, including what must never be written and when users can request deletion. It also sets conflict-handling rules, such as how multiple entry points share one set of memory files and what write policy applies when several updates could happen at once. Shared memory across entry points cuts both ways. It provides a consistent experience, but it also widens the attack surface for dirty writes and privacy leaks. Keeping the data consistent requires mechanisms such as file locking or version merging.

    3. Reflection: Where Are the Limits of Prompt Engineering?

    A 200,000-character system prompt exposes the methodological limits of current prompt engineering:

    • Poor testability: Prompts lack the unit tests that code has. The effect of each new rule on existing behavior is hard to verify through regression testing.
    • Diluted attention: As rules multiply, each one is less likely to be followed. This creates a vicious cycle: more rules lead to less reliable behavior, and less reliable behavior leads to more rules.
    • Misplaced responsibilities: Memory specifications, product instructions, and safety policies belong in different system layers, such as a memory middleware, entry-point prompts for each product, and independent safety classifiers. Packing them into a single prompt violates separation of concerns.

    A more sound architectural direction is a layered prompt system. The model layer keeps only general behavioral principles. The product layer injects scenario-specific rules. Capabilities such as memory and safety run as independent middleware modules and inject structured context on demand. This approach is easier to maintain, and it keeps inference costs more under control.

    4. Conclusion

    The leaked prompt works both as a cautionary example and as a valuable design reference. It shows the full engineering detail of a cross-session memory system, including categorization, indexing, lazy loading, and read/write boundaries. It also shows that a prompt is not an unlimited configuration file. When a prompt grows into an encyclopedia, responsibilities should move down into the system architecture. For developers building agent applications, the useful takeaway is the design thinking behind the memory system, not copying its size.