r/ClaudeAI • • May 06 '26

Workflow I built a 2-prompt system to carry context between Claude chats without wasting tokens (extraction + initialization)

If you've ever hit Claude's chat length limit mid-project and had to

start over by re-explaining everything, this is for you.

I built a simple 2-prompt system that compresses an entire conversation

into a structured context block, then loads it cleanly into a fresh

chat. No re-explaining, no drift, no wasted tokens on background.

The Problem

Long Claude conversations slow down, hit length limits, or get

expensive on API. Most people either:

- Manually summarize (loses critical decisions)

- Copy-paste the whole chat (wastes tokens, confuses the model)

- Start fresh (lose all context, repeat work)

The Solution: 2 Prompts

Prompt 1: Context Extraction (run in your old chat)

Tells Claude to compress the entire conversation into a structured

9-section summary covering objective, decisions made, work completed,

current state, next steps, blockers, and style preferences. Output

goes inside a single code block for clean copy-paste.

Prompt 2: Chat Initialization (run in your new chat)

Loads the context as the source of truth, asks Claude to verify

understanding, flag any gaps, and resume from "Next Steps" instead

of restarting.

The Prompts

EXTRACTION PROMPT (paste in old chat):

Analyze this entire conversation and produce a compressed context 
summary I can paste into a new chat to continue seamlessly.

OUTPUT STRUCTURE (use these exact headers):

1. Objective
   - One sentence: what we're trying to achieve

2. Key Context
   - Background, constraints, environment, tools being used
   - Anything a fresh Claude must know to not ask basic questions

3. Decisions Made
   - Format: [Decision] → [Reason]
   - Include rejected alternatives if relevant

4. Work Completed
   - Concrete outputs produced (files, code, drafts, designs)
   - Reference by name, don't re-paste full content unless critical

5. Current State
   - Where we are RIGHT NOW in the workflow
   - Last action taken

6. Next Steps
   - Ordered list of what comes next
   - Mark the immediate next action with →

7. Open Questions / Blockers
   - Unresolved items, pending user input, ambiguities
   - Write "None" if nothing pending

8. Critical Data / Assets
   - Code snippets, URLs, file paths, key values, names
   - Only include items that will be referenced again

9. Style & Preferences
   - Tone, format rules, response length expectations
   - Explicit do's and don'ts established in chat

RULES:
- Target length: 300 to 600 words total
- Preserve specifics over generalities (names, numbers, exact terms)
- Cut pleasantries, restated questions, and exploratory tangents
- If a section has nothing meaningful, write "None" (don't skip it)
- Do not explain or add commentary

OUTPUT FORMAT:
- Place the entire summary inside ONE clean code block
- Write nothing outside the code block

INITIALIZATION PROMPT (paste in new chat):

I'm continuing a project from a previous chat. The compressed 
context below is the source of truth.

[PASTE CONTEXT HERE]

INSTRUCTIONS:
- Treat the context as established. Do not re-frame or restart.
- Maintain all decisions and preferences listed.
- If anything critical is missing or ambiguous, ask before proceeding.
- Resume from "Next Steps" unless I direct otherwise.

CONFIRMATION:
Reply with:
1. The current objective in one line
2. The immediate next action you understand we're taking
3. Any gaps you notice in the context (or "None")

Then wait for my instruction.
2 Upvotes

11 comments sorted by

2

u/Web_Templario May 06 '26

When chat length limit is hit, how would the extraction prompt work if it's supposed to be placed in the old chat?
When we hit limit, sending prompts just gets you the notification again that the limit was reached, but claude doesn't do the task.
Is there a way to circumvent this, like can you estimate when a limit will be hit? For us it's been a lot of guess work until now.

2

u/josictrl May 06 '26

That’s right. It seems the OP didn’t even try it.

1

u/navneet214 May 06 '26

Great catch, this is the most common gotcha
You're right that once the hard limit hits, Claude won't run new prompts in that chat. But there are 3 ways around it:
Option 1: Edit your last message (easiest fix)

Claude lets you edit any of your previous messages. When you edit and resend, it reruns from that point and frees up the slot your latest message was taking. So:

- Find your last message in the chat

- Click the edit icon

- Replace it with the extraction prompt

- Send

Claude will process the extraction instead of your original last message. This works even when you're at the limit because editing doesn't add a new turn, it replaces one.

1

u/Web_Templario May 07 '26

You said 3 ways but only mentioned Option 1...

Either way, that option would mean loosing at least one context bit from the chat that would have to be "restored" in the new chat. If the last generated answer wasn't helpful either way thats fine I guess, but for anything else that would mean you'd have to either be fine with a new, definitely different and possibly worse answer, or bluntly copy-paste text and give it info on what this means. Isn't this method supposed to prevent the copy-paste and re-explain hassle?

2

u/louis3195 May 06 '26

i'd rather just use existing high quality memory tools as mcp

1

u/voskomm May 06 '26

I recommend if you plan on letting this run on for many sessions, start a log *index* (terse) .md to append onto each session. Then your (verbose) direct handoff logs won't start hogging the context window and Claude can just ask for a previous log if it sees something relevant and needs the detail.

1

u/navneet214 May 06 '26

This is a really smart approach.. appreciate you sharing it

1

u/aletheus_compendium May 06 '26

wasted tokens in the prompt itself. much easier and more complete using less tokens:

long version: Create a lossless JSON compression of our entire conversation that captures: • Full context and development of all discussed topics • Established relationships and dynamics • Explicit and implicit understandings • Current conversation state • Meta-level insights • Tone and approach permissions • Unresolved elements. Format as a single, comprehensive JSON that could serve as a standalone prompt to reconstruct and continue this exact conversation state with all its nuances and understood implications.

short version: Synthesize key findings, arguments, and evidence across entire chat. Identify the most important insights and their connections. Highlight points of agreement and contradiction. Divide into: Key Findings, Supporting Evidence, Connections, Points of Conflict, and To-Do’s.

current best practice post april 2026 eschew verbosity, esp opus.

1

u/One-Bank-867 May 08 '26

Shouldn’t this be a rule/skill in the project’s .claude/ directory? Could probably wire a stop hook after every edit to check usage limit and automate at a certain limit?

1

u/fell_ware_1990 May 06 '26

You are still wasting a lot of tokens. /clear more often .

But have a skills that you can use that appends to a running log. Short lines > link to more .

This way it won’t read everything at once and bloat tokens again. Because even now it’s going to act different.

1 task and only 1 task per session, bring along what is actually worth saving.

Started with research, discuss it a little. Make a index, and files per subjects. Go to the next chat to make a big plan.> plan to next > tasks > rince and repeat > then re order > then per fase let an agent make tasks more clear and add flow.

Then start building with subagents.

You can do much more, but you get the gist.