add-compact

Add a manual /compact command for Claude Code sessions with admin-gated access.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill adds a controlled way to compact long-running Claude Code sessions, reducing context rot without resetting the conversation or losing the session’s logical continuity.

Core Features & Use Cases

  • Manual /compact Command: Adds a slash command that triggers the SDK’s built-in compaction flow.
  • Trusted Access Control: Limits compaction to the main group or trusted/admin senders to prevent accidental or malicious memory loss.
  • Safe Session Continuity: Preserves the conversation by forwarding the new session ID after compaction instead of performing a destructive clear.
  • Operational Validation: Includes checks for active containers, message ordering, transcript archiving, and denial handling in untrusted groups.

Quick Start

Ask the assistant to implement the add-compact skill so your NanoClaw deployment can support a safe, admin-gated /compact command for long sessions.

Frequently Asked Questions about add-compact

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

FAQPage Schema
How do I reduce context rot in long-running Claude Code agent sessions?

A manual session compaction command reduces context rot in long-running Claude Code agent workflows by forwarding the Agent SDK's built-in /compact flow. It limits compaction to the main group or trusted senders to prevent accidental memory loss.

How do I safely compact a Claude Code chat history without losing session continuity?

Safely compact Claude Code chat history by forwarding the Agent SDK built-in /compact command, which generates a new session ID to preserve conversation continuity instead of performing a destructive clear.

Can I restrict session compaction to admin users in a Claude Agent SDK workflow?

Yes, you can restrict session compaction to admin senders by applying trusted access control limits to the /compact command. This blocks unauthorized compaction attempts while allowing the main group to safely reduce history.

What checks are needed before running manual compaction on Claude Code agent transcripts?

Before running manual compaction on Claude Code transcripts, operational validation checks are needed for active containers, message ordering, and transcript archiving. These checks ensure safe history reduction and proper denial handling in untrusted groups.

Does manual session compaction delete the previous Claude Code conversation context?

No, manual session compaction does not destructively delete the previous Claude Code conversation context. It forwards a new session ID after compaction to preserve the conversation's logical continuity and prevent memory loss.