add-compact

Add a /compact command to reduce conversation history via the Claude Agent SDK.

10|16|Updated Mar 9, 2026
One-click install
npx skills add https://github.com/qwibitai/nanoclaw-whatsapp --skill add-compact
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: add-compact
Source: https://github.com/qwibitai/nanoclaw-whatsapp/tree/main/.claude/skills/add-compact
Command: npx skills add https://github.com/qwibitai/nanoclaw-whatsapp --skill add-compact

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

This Skill combats context rot in long-running chat sessions by providing a command to intelligently summarize and compact the conversation history, ensuring continued coherence and performance.

Core Features & Use Cases

  • Context Compaction: Leverages the Claude Agent SDK's built-in /compact command to reduce memory footprint while preserving essential context.
  • Session Continuity: Ensures the conversation can continue seamlessly after compaction, with a new session ID provided.
  • Security Controls: Restricts the /compact command to trusted senders (main group, device owner) to prevent accidental data loss.
  • Use Case: In a multi-day support chat, use /compact to keep the conversation manageable and the AI's responses relevant without losing the thread of the ongoing issue.

Quick Start

Send the command /compact from the main group to initiate context compaction.

Frequently Asked Questions about add-compact

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

FAQPage Schema
How do I compact conversation history in a long-running AI assistant session?

You can compact conversation history by triggering a command that leverages the Claude Agent SDK's built-in compaction functionality to summarize and reduce memory footprint. This prevents context rot and maintains AI response relevance in long-running sessions.

Why does my AI assistant lose context in multi-day chat sessions?

Your AI assistant loses context due to context rot in long-running chat sessions. Compacting the conversation history intelligently summarizes past interactions to preserve essential context and prevent performance degradation.

Can I continue a chat session after compacting conversation history?

Yes, you can continue a chat session seamlessly after compacting conversation history. The process ensures session continuity by forwarding a new session ID and archiving the transcript before compaction occurs.

How do I secure the conversation compaction command to prevent accidental data loss?

You secure conversation compaction by restricting the command to trusted senders, specifically the main group or device owner. This security control prevents unauthorized users from triggering accidental data loss.

What is the best way to reduce conversation history size without losing essential context?

The best way to reduce conversation history size while preserving essential context is to leverage the Claude Agent SDK's built-in compaction mechanism. It intelligently summarizes past interactions to maintain AI response relevance.

Do I need archive storage before compacting an AI assistant session?

Yes, archive storage is needed before compacting an AI assistant session because the transcript is archived before compaction occurs. This ensures the original conversation history is preserved before memory reduction.