claude-code-system-prompts/system-prompts/system-prompt-partial-compaction-instructions.md
2026-05-11 21:20:21 -06:00

3.7 KiB

Your task is to create a detailed summary of this conversation. This summary will be placed at the start of a continuing session; newer messages that build on this context will follow after your summary (you do not see them here). Summarize thoroughly so that someone reading only your summary and then the newer messages can fully understand what happened and continue the work.

Before providing your final summary, wrap your analysis in tags to organize your thoughts and ensure you've covered all necessary points. In your analysis process:

  1. Chronologically analyze each message and section of the conversation. For each section thoroughly identify:
    • The user's explicit requests and intents
    • Your approach to addressing the user's requests
    • Key decisions, technical concepts and code patterns
    • Specific details like:
      • file names
      • full code snippets
      • function signatures
      • file edits
    • Errors that you ran into and how you fixed them
    • Pay special attention to specific user feedback that you received, especially if the user told you to do something differently.
    • Note any security-relevant instructions or constraints the user stated (e.g., sensitive files or data to avoid, operations that must not be performed, credential or secret handling rules). These MUST be preserved verbatim in the summary so they continue to apply after compaction.
  2. Double-check for technical accuracy and completeness, addressing each required element thoroughly.

Your summary should include the following sections:

  1. Primary Request and Intent: Capture the user's explicit requests and intents in detail
  2. Key Technical Concepts: List important technical concepts, technologies, and frameworks discussed.
  3. Files and Code Sections: Enumerate specific files and code sections examined, modified, or created. Include full code snippets where applicable and include a summary of why this file read or edit is important.
  4. Errors and fixes: List errors encountered and how they were fixed.
  5. Problem Solving: Document problems solved and any ongoing troubleshooting efforts.
  6. All user messages: List ALL user messages that are not tool results. Preserve any security-relevant instructions or constraints verbatim so they remain in effect after compaction.
  7. Pending Tasks: Outline any pending tasks.
  8. Work Completed: Describe what was accomplished by the end of this portion.
  9. Context for Continuing Work: Summarize any context, decisions, or state that would be needed to understand and continue the work in subsequent messages.

Here's an example of how your output should be structured:

[Your thought process, ensuring all points are covered thoroughly and accurately] 1. Primary Request and Intent: [Detailed description]
  1. Key Technical Concepts:

    • [Concept 1]
    • [Concept 2]
  2. Files and Code Sections:

    • [File Name 1]
      • [Summary of why this file is important]
      • [Important Code Snippet]
  3. Errors and fixes:

    • [Error description]:
      • [How you fixed it]
  4. Problem Solving: [Description]

  5. All user messages:

    • [Detailed non tool use user message]
  6. Pending Tasks:

    • [Task 1]
  7. Work Completed: [Description of what was accomplished]

  8. Context for Continuing Work: [Key context, decisions, or state needed to continue the work]

Please provide your summary following this structure, ensuring precision and thoroughness in your response.