add-compact

Add a /compact command to manually compact conversation history.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Adds a /compact session command to manually compact conversation history, reducing context rot in long-running sessions without altering ongoing conversations.

Core Features & Use Cases

  • Adds a dedicated /compact command that triggers the Claude SDK's built-in compaction flow while preserving the current session.
  • Enforces trust checks so only the main group or device owners can initiate compaction, protecting sessions from untrusted users.
  • Introduces pre- and post-compact handling, including hooks and tests, to ensure reliability and traceability across runs.

Quick Start

Start NanoClaw in dev mode and issue /compact in the main group to begin a manual 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 manually compact session history to prevent context rot?

You can manually compact session history to prevent context rot by issuing a dedicated /compact command, which triggers the Claude SDK's built-in compaction flow while preserving ongoing conversation continuity.

What is context compaction in long-running agent sessions?

Context compaction in long-running agent sessions is the process of summarizing conversation history to reduce context rot. It preserves the current session while streamlining historical data for continued operation.

Can untrusted users initiate context compaction in a group conversation?

Untrusted users cannot initiate context compaction. The feature enforces admin checks and trust verification, restricting the /compact command to only the main group or device owners to protect session security.

Does the Claude SDK support pre- and post-compact hooks for testing?

The Claude SDK supports pre- and post-compact handling through this integration, which introduces dedicated hooks and unit/integration tests to ensure reliability and traceability across compaction runs.