Chat Context Transitioner

Structured instruction set designed to help a large language model gracefully exit a conversation approaching the context window limit. Its purpose is to generate a comprehensive closure package that captures all key outputs, decisions, artifacts, and insights from the current session so that work can be seamlessly resumed in a future chat. It directs the model to: • Plan its output strategy with a meta plan (step 0), • Summarize the session in a detailed abstract (step 1), • Organize important outputs into categorized appendices (step 2), • Optionally externalize files using the code interpreter (step 3), • Ensure quality and break into multi-part outputs if needed (step 4), • Conclude with a standardized signal: [CLOSURE PACKAGE COMPLETE], • And generate a reusable prompt for initializing a follow-up session. How to Use: Use this prompt when a session is nearing the LLM’s context window limit and you want to preserve continuity across sessions. Paste the full or abridged version of the prompt into the conversation. Once the closure package is generated, copy both the closure and the follow-up session prompt. Use the follow-up prompt to start a new conversation, referencing the closure package as context. This enables continuity, reusability, and minimal re-onboarding effort between sessions.

Prompt Text:

SYSTEM: We are approaching the context window limit for this conversation. Before transitioning to a new session, I need you to generate a full closure package that preserves the strategic, technical, and operational value of this dialogue.

Follow these steps precisely:

**Step 0: Meta Plan**
- Before generating any final outputs, construct and present a meta plan detailing how you will structure the abstract, appendices, and any auxiliary files or outputs.
- Explain the logical structure, rationale for segmentation, and criteria for inclusion of content.
- Explicitly note any content areas where you anticipate uncertainty or ambiguity, and describe how you will address them.

**Step 1: Abstract**
- Create a comprehensive, multi-paragraph summary of the entire session.
- Cover the progression of the dialogue, key decision points, insights uncovered, problems solved, code or systems developed, and strategic implications.
- Emphasize continuity elements that must be preserved in the follow-up session.

**Step 2: Appendices**
Create well-structured, clearly labeled appendices as follows:
  - **Appendix A: Critical Code Artifacts** — All major code snippets, functions, or modules created. Include inline comments and usage instructions where relevant.
  - **Appendix B: Mathematical or Logical Constructs** — Key formulas, algorithms, or derivations. Provide notation context and application notes.
  - **Appendix C: Architectural or Design Insights** — Pain points, constraints, bottlenecks, architecture tradeoffs, and mitigation strategies discussed.
  - **Appendix D: Auxiliary Constructs (if applicable)** — Diagrams, data schemas, workflows, or conceptual models relevant to system-level thinking.

**Step 3: Output Engineering (Optional but Recommended)**
- If any part of the output (e.g., appendices, code modules, schema definitions) exceeds optimal inline formatting, use the code interpreter to generate downloadable files.
- Suggested formats: `.md` for documentation, `.py` for code, `.json` or `.csv` for structured data, etc.
- Clearly name each file according to its appendix or purpose.

**Step 4: Quality and Completeness Check**
- Validate that each appendix is complete, non-redundant, and logically organized.
- If the scope exceeds a single reply, divide into logical multi-turn subtasks and clearly label the sequence (e.g., [Part 1 of 3]).
- Confirm the final output is maximally re-usable and sufficient to reinitialize a new conversation without rework.

**Final Output Tag:** Once all content is delivered and verified internally, conclude with: **[CLOSURE PACKAGE COMPLETE]**

**Post-Closure Prompt Instruction:** Immediately after delivering the closure package, generate a well-structured, standalone prompt that can be used to initialize a new chat. This prompt should assume the closure package is available and instruct the model to resume execution using it. Output the new session prompt in a separate, clearly marked code block.