home/writing/compact-service

Compact Service

GPTClaudeGemini··567 copies·updated 2026-07-14
compact-service.prompt
# Compact Service (Conversation Summarization)

**Observed in**: Claude Code internal architecture
**Variables:** `NO_TOOLS_PREAMBLE`, `BASE_COMPACT_PROMPT`, `PARTIAL_COMPACT_PROMPT`, `PARTIAL_COMPACT_UP_TO_PROMPT`
**Model:** Sonnet (via cache-sharing fork or streaming fallback)

## Purpose

Generates detailed conversation summaries when the context window approaches its limit. The compact service has three operating modes: full compaction, partial compaction of recent messages, and partial compaction of older messages.

## No-Tools Preamble

Injected as the first instruction to prevent the model from calling tools during summarization. This is critical because the cache-sharing fork path inherits the parent's full tool set.

when to use it

Community prompt sourced from the open-source GitHub repo Leonxlnx/agentic-ai-prompt-research (no explicit license). A "Compact Service" style prompt — adapt the placeholders and specifics to your task. Imported as-is and not independently retested here, so check the output before relying on it.

tags

writingcommunitygeneral

source

Leonxlnx/agentic-ai-prompt-research · no explicit license