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 Compact feature (configured under Settings > Feature Settings). When conversation context usage approaches the model's threshold limit (typically 75%–80% of total context window capacity):
- Silent Background Compaction: PostQode automatically initiates background compaction without disrupting your workflow or requiring manual intervention.
- Context Summarization: It creates a comprehensive structured summary that preserves active goals, architectural decisions, completed code changes, and next steps.
- Automatic File Restoration: PostQode identifies actively referenced and modified files, reading up to 8 of the most critical files (capped at 100KB each) and restoring their fresh contents into the compacted context so the AI retains immediate visibility into your active code.
- Focus Chain & State Persistence: The full Focus Chain checklist state and pending subtasks are preserved across the compaction boundary.
- Browser Session State Sync: When using Web Agent with an active browser session, PostQode refreshes element locator snapshots to prevent the model from referencing stale DOM elements.
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, enable Auto Compact in Settings > Feature Settings to let PostQode manage your context window size automatically.