chat-compactor

Generate structured session summaries optimized for future AI agent consumption. Use when (1) ending a coding/debugging session, (2) user says "compact", "summarize session", "save context", or "wrap up", (3) context window is getting long and continuity matters, (4) before switching tasks or taking a break. Produces machine-readable handoff documents that let the next session start fluently without re-explaining.

25 stars

Best use case

chat-compactor is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Generate structured session summaries optimized for future AI agent consumption. Use when (1) ending a coding/debugging session, (2) user says "compact", "summarize session", "save context", or "wrap up", (3) context window is getting long and continuity matters, (4) before switching tasks or taking a break. Produces machine-readable handoff documents that let the next session start fluently without re-explaining.

Teams using chat-compactor should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/chat-compactor/SKILL.md --create-dirs "https://raw.githubusercontent.com/ComeOnOliver/skillshub/main/skills/aiskillstore/marketplace/zhanlincui/chat-compactor/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/chat-compactor/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How chat-compactor Compares

Feature / Agentchat-compactorStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Generate structured session summaries optimized for future AI agent consumption. Use when (1) ending a coding/debugging session, (2) user says "compact", "summarize session", "save context", or "wrap up", (3) context window is getting long and continuity matters, (4) before switching tasks or taking a break. Produces machine-readable handoff documents that let the next session start fluently without re-explaining.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# Chat Compactor

Generate structured summaries optimized for AI agent continuity across sessions.

## Why This Exists

Human-written summaries and ad-hoc AI summaries lose critical context:
- **Decision rationale** gets lost (why X, not Y)
- **Dead ends** get forgotten (agent re-tries failed approaches)
- **Implicit knowledge** isn't captured (file locations, naming conventions, gotchas)
- **State** is unclear (what's done, what's pending, what's blocked)

This skill produces **agent-optimized handoff documents** that prime the next session.

## Output Format

Generate a markdown file with this structure:

```markdown
# Session: [Brief Title]
Date: [YYYY-MM-DD]
Duration: ~[X] messages

## Context Snapshot
[1-2 sentences: What project/task, what state it's in right now]

## What Was Accomplished
- [Concrete outcome 1]
- [Concrete outcome 2]

## Key Decisions & Rationale
| Decision | Why | Alternatives Rejected |
|----------|-----|----------------------|
| [Choice] | [Reason] | [What didn't work and why] |

## Current State
- **Working**: [files/features that are functional]
- **Broken/Blocked**: [what's not working and why]
- **Modified files**: [list with brief note on changes]

## Dead Ends (Don't Retry)
- ❌ [Approach that failed] — [why it failed]

## Next Steps (Prioritized)
1. [ ] [Most important next action]
2. [ ] [Second priority]

## Environment & Gotchas
- [Any setup notes, versions, quirks discovered]

## Key Code/Commands Reference
[Only if there are non-obvious commands or snippets the next session needs]
```

## Workflow

1. **Scan conversation** for: decisions, outcomes, failures, file changes, blockers
2. **Identify the "handoff moment"** — what would a fresh agent need to continue?
3. **Generate structured summary** using format above
4. **Save to file**: `session-[topic]-[date].md` in project root or `/home/claude/sessions/`

## Compaction Triggers

Invoke this skill when:
- User says: "compact", "wrap up", "save session", "summarize for next time"
- Context window exceeds ~50% capacity and task is ongoing
- Before major context switches
- End of debugging/implementation session

## Quality Criteria

Good compactions are:
- **Scannable**: Next agent gets orientation in <30 seconds
- **Actionable**: Clear next steps, not vague summaries
- **Defensive**: Dead ends documented to prevent re-exploration
- **Minimal**: No fluff, every line earns its tokens

## Anti-Patterns

Avoid:
- Narrative prose ("First we tried X, then Y, then Z...")
- Redundant context (don't repeat what's in code comments)
- Vague summaries ("Made good progress on the feature")
- Missing failure documentation (most valuable part!)

## Example Trigger & Response

**User**: "Let's wrap up, compact this session"

**Agent**:
1. Reviews conversation for key decisions, outcomes, failures
2. Generates structured markdown per format above
3. Saves to `session-[topic]-[date].md`
4. Confirms: "Session compacted to `session-auth-refactor-2025-01-06.md` — ready for next time."

Related Skills

cursor-ai-chat

25
from ComeOnOliver/skillshub

Master Cursor AI Chat with @-mentions, inline edit, and conversation patterns. Triggers on "cursor chat", "cursor ai chat", "ask cursor", "cursor conversation", "chat with cursor", "Cmd+L", "inline edit".

gws-chat

25
from ComeOnOliver/skillshub

Google Chat: Manage Chat spaces and messages.

gws-chat-send

25
from ComeOnOliver/skillshub

Google Chat: Send a message to a space.

md2wechat

25
from ComeOnOliver/skillshub

Convert Markdown to WeChat Official Account HTML. Use this whenever the user wants WeChat article conversion, draft upload, image generation for articles, cover or infographic generation, image-post creation, writer-style drafting, AI trace removal, or needs to inspect supported providers, themes, and prompt templates before running the workflow.

azure-communication-chat-java

25
from ComeOnOliver/skillshub

Build real-time chat applications with Azure Communication Services Chat Java SDK. Use when implementing chat threads, messaging, participants, read receipts, typing notifications, or real-time chat features.

baoyu-post-to-wechat

25
from ComeOnOliver/skillshub

Post content to WeChat Official Account (微信公众号). Supports both article posting (文章) and image-text posting (图文).

chat-ui

25
from ComeOnOliver/skillshub

Chat UI building blocks for React/Next.js from ui.inference.sh. Components: container, messages, input, typing indicators, avatars. Capabilities: chat interfaces, message lists, input handling, streaming. Use for: building custom chat UIs, messaging interfaces, AI assistants. Triggers: chat ui, chat component, message list, chat input, shadcn chat, react chat, chat interface, messaging ui, conversation ui, chat building blocks

ai-partner-chat

25
from ComeOnOliver/skillshub

基于用户画像和向量化笔记提供个性化对话。当用户需要个性化交流、上下文感知的回应,或希望 AI 记住并引用其之前的想法和笔记时使用。

chatgpt-app-builder

25
from ComeOnOliver/skillshub

Build ChatGPT Apps using the Apps SDK and MCP. Use when users want to: (1) Evaluate if their product should become a ChatGPT App (2) Design and implement MCP servers with widgets (3) Test apps locally and in ChatGPT (4) Prepare for App Store submission Triggers: "ChatGPT app", "Apps SDK", "build for ChatGPT", "ChatGPT integration", "MCP server for ChatGPT", "submit to ChatGPT"

chatkit-widget

25
from ComeOnOliver/skillshub

Use when integrating OpenAI/ChatKit chat widgets into Next.js/React applications. Triggers for: embedding chat widgets, configuring widget appearance, implementing event handlers, setting up authenticated chat access, or customizing widget branding. NOT for: building custom chat UIs from scratch or backend AI model configuration.

building-chatgpt-apps

25
from ComeOnOliver/skillshub

Guides creation of ChatGPT Apps with interactive widgets using OpenAI Apps SDK and MCP servers. Use when building ChatGPT custom apps with visual UI components, embedded widgets, or rich interactive experiences. Covers widget architecture, MCP server setup with FastMCP, response metadata, and Developer Mode configuration. NOT when building standard MCP servers without widgets (use building-mcp-servers skill instead).

building-chat-widgets

25
from ComeOnOliver/skillshub

Build interactive AI chat widgets with buttons, forms, and bidirectional actions. Use when creating agentic UIs with clickable widgets, entity tagging (@mentions), composer tools, or server-handled widget actions. Covers full widget lifecycle. NOT when building simple text-only chat without interactive elements.