Compact Command
The /compact command is a powerful capability that allows you to compress your conversation history to free up context window space while preserving essential context, architectural decisions, and pending tasks.
PostQode supports two modes of compaction: User-Triggered and Auto-Triggered.
User-Triggered Compaction
When your context window is filling up but you want to continue working in the same task, you can manually trigger compaction:
- Type
/compactin the chat input field. - PostQode will analyze the conversation history and generate a comprehensive summary.
- You will be presented with a preview of the generated summary to review:
- Accept: If you approve, the detailed conversation history is truncated, and only the summary is kept as context.
- Feedback: If the summary is missing important details, type your feedback. PostQode will use this feedback to regenerate a revised summary for you to review again.
Unlike /newtask, which creates a completely new task, /compact keeps you within the same task workspace and history.
Auto-Triggered Compaction
PostQode includes an intelligent Auto-Compaction (or Auto-Condense) feature (which can be toggled on/off in Settings). When the current context window usage crosses the threshold (default: 75% for next-generation models):
- PostQode automatically initiates a silent compaction process without interrupting your flow.
- It generates the conversation summary, including a special Required Files section.
- Automatic File Restoration: PostQode parses the
Required Fileslist, reads up to 8 of the most critical files (capped at 100KB), and pre-loads their latest content into the new context window. This ensures that the agent doesn't lose access to the files it was actively working on. - Browser Session State Sync: If you are using Web Agent with an active browser session, PostQode automatically resets the element locator snapshots. Since the previous conversation steps are truncated, resetting prevents the agent from referencing stale snapshots.
Summary Structure
When PostQode compacts a conversation, it captures the following sections:
- Primary Request and Intent: The user's original goals.
- Key Technical Concepts: Coding standards, frameworks, and conventions discussed.
- Files and Code Sections: A list of all files created, modified, or examined, along with key code snippets.
- Problem Solving: Troubleshooting steps, errors encountered, and how they were resolved.
- Pending Tasks & Next Steps: Verbatim quotes and details on what needs to be worked on next, preventing task drift.
- Task Progress (Focus Chain): The exact checklist state from the Focus Chain showing what is completed and what remains.
Compact vs. New Task
| Feature / Command | /compact | /newtask |
|---|---|---|
| Primary Use Case | Continuing a long/complex task while freeing up memory. | Shifting to a new phase or starting a fresh sub-task. |
| History Retention | Summarizes and truncates history within the same conversation. | Creates a new task with a clean context, preserving the old task intact. |
| Momentum | Keeps the developer momentum going without switching tasks. | Provides a clean handoff like bringing a new developer to a project. |
| Approval | User-triggered requires approval; Auto-triggered runs silently. | Requires user confirmation to launch the new task. |
Best Practices
- Use
/compactduring deep debugging sessions: If you are exploring multiple files and running commands, your context window will fill up fast. Type/compactto clean the workspace of intermediate noise (like long terminal outputs) while keeping the lessons learned. - Keep Settings optimized: If you work with large codebases, turn on
useAutoCondense(Auto-Compaction) in settings to let PostQode manage your context window size automatically.