Back to guide/Developer Tools

Context Window Management

Prevents context loss during long sessions by creating a checkpoint summary before compacting, so important decisions survive the trim.

claude-code-tipsnext_task
Edit View
Prompt
I'm starting a new task in a long session. Before we proceed:

1. Summarize the key changes we've made so far in this session
2. List any files that are currently modified but uncommitted
3. Note any decisions or constraints we established

Then use /compact to trim context. After compacting, I'll describe the next task.

The new task is: {{next_task}}

Variables to customize

{{next_task}}

Why this prompt works

Prevents context loss during long sessions by creating a checkpoint summary before compacting, so important decisions survive the trim.

Save this prompt to your library

Organize, version, and access your best prompts across ChatGPT, Claude, and Cursor.