add-compact

Add a /compact slash command to trigger session compaction via the Claude SDK.

Updated Apr 25, 2026
One-click install
npx skills add https://github.com/iia-arg/claudeclaw --skill add-compact-iia-arg
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: add-compact
Source: https://github.com/iia-arg/claudeclaw/tree/main/skills/add-compact
Command: npx skills add https://github.com/iia-arg/claudeclaw --skill add-compact-iia-arg

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

This Skill enables users to manually trigger conversation context compression, helping prevent context decay during long sessions.

Core Features & Use Cases

  • Add /compact command: Inserts a slash command that initiates session compaction via the Claude SDK.
  • Session continuity: Maintains ongoing conversations without reset by forwarding the new session ID.
  • Use Case: A user running a long project dialogue can invoke /compact to condense the history, ensuring relevant context stays within model limits.

Quick Start

Use the add-compact skill to enable manual context compression by sending the /compact command to your chat assistant.

Frequently Asked Questions about add-compact

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

FAQPage Schema
How do I manually condense conversation history during long AI sessions?

You can manually condense conversation history by executing a slash command to trigger session compaction. This compresses the context to prevent decay while maintaining ongoing dialogue without resetting the session.

What is context rot and how does session compaction prevent it?

Context rot is the degradation of relevant context over long-running AI conversations. Session compaction prevents it by condensing the history, ensuring conversation summaries stay current and within model limits.

Can I compress context in an ongoing chat session without losing the session ID?

Yes, you can compress context without losing the session ID. The compaction process maintains session continuity by forwarding the new session ID, preventing a full reset of the ongoing dialogue.

How do I implement a custom slash command for context compression?

Implementing a custom slash command for context compression requires understanding SDK code modifications and proper code merging. You insert the command to initiate session compaction via the Claude SDK.

When should I trigger context compression in a long-running project dialogue?

You should trigger context compression when relevant context approaches model limits during extended dialogues. Invoking the compaction command condenses the history, keeping the necessary context available.

Does manual context compression work with the Claude SDK?

Yes, manual context compression works with the Claude SDK. The feature inserts a slash command that initiates the session compaction process directly through the SDK's code infrastructure.