pre-compact

Preserve task context and generate a focused /compact instruction before compaction.

Updated May 24, 2026
One-click install
npx skills add https://github.com/empty-can/cc-relative-info --skill pre-compact
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pre-compact
Source: https://github.com/empty-can/cc-relative-info/tree/main/.claude/skills/pre-compact
Command: npx skills add https://github.com/empty-can/cc-relative-info --skill pre-compact

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill prepares an active Claude Code session for compaction so important working context is not lost between sessions. It helps you capture the current task state, surface any uncommitted changes that need a decision, and produce a focused compact instruction that makes the next restart easier.

Core Features & Use Cases

  • Memory Refresh Before Context Reset: Reviews and updates memory files so the latest task status, agreements, pending decisions, and restart points are recorded before compaction.
  • Selective Change Awareness: Checks for uncommitted Git changes and only interrupts the flow when there is something the user needs to review or decide on.
  • Focused Compaction Prompting: Generates a short, intent-driven /compact comment that emphasizes the current task, remaining steps, pending decisions, and any relevant work-in-progress.
  • Use Case: When a long coding or analysis session is nearing its context limit, use this Skill right before /compact to leave a clean handoff for the next session without cluttering the conversation.

Quick Start

Ask the assistant to run the pre-compact skill before you use /compact so it can refresh memory, check for uncommitted changes, and suggest the best compact instruction.

Frequently Asked Questions about pre-compact

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I preserve session context before running /compact in Claude Code?

To preserve session context before compaction, you need to capture the current task state, review uncommitted Git changes, and generate a focused compact instruction that ensures a reliable restart point for the next session.

What is the best way to prepare a coding session for context compaction?

Preparing for context compaction involves refreshing memory files to record task status and pending decisions, inspecting Git status for uncommitted changes, and producing an intent-driven compact comment that summarizes remaining workflow steps.

How does context preservation work when hitting the context limit during a long analysis session?

Context preservation works by reviewing and updating memory files with the latest task status and agreements before context compression occurs, generating a concise handoff instruction that prevents the loss of critical working state across sessions.

Do I need to check Git status before compacting an interrupted engineering workflow?

Checking Git status before compacting is required to surface uncommitted changes that need a decision, selectively interrupting the workflow only when there are pending changes the user must review before the session resets.

Can I generate a custom compact instruction for a workflow handoff across sessions?

Generating a custom compact instruction for workflow handoff is possible by emphasizing the current task, remaining steps, pending decisions, and work-in-progress into a short, intent-driven comment aligned with official compaction guidance.

What are the limitations of relying on context compaction for long research workflows?

Context compaction alone does not automatically save pending decisions or uncommitted code changes; without explicitly capturing task state and generating a focused restart instruction, interrupted research workflows may lose critical working context.