Skip to content
Back to skills

Compact Window

ASecurity

Compare Claude Code auto-compact window sizes on the user's own recent sessions, and set one if they choose. Use when the user asks about compaction, long or expensive sessions, why sessions get so large, or how to spend fewer tokens automatically (including in the desktop app, where autopilot cannot reach).

  • 2 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added October 13, 2026
ai-agentsbashnode

Works with

  • claude code
  • cli

Security analysis

A100/100

Scanned October 13, 2026

npx -y skills add KushalP1/context-doctor --skill compact-window --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Compact Window?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Compact Window
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/kushalp1-compact-window/badge)](https://www.skillsdirectory.com/skills/kushalp1-compact-window)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: compact-window
description: Compare Claude Code auto-compact window sizes on the user's own recent sessions, and set one if they choose. Use when the user asks about compaction, long or expensive sessions, why sessions get so large, or how to spend fewer tokens automatically (including in the desktop app, where autopilot cannot reach).
---

Run this and show the user its output as it is (it is already formatted):

```bash
node "${CLAUDE_PLUGIN_ROOT}/dist/cli.js" compact-window
```

It replays their last 30 days at windows from 200k to 800k and shows input cost, saving and compactions a week for each. Then say in one or two sentences what the trade-off is for them: a smaller window costs less but compacts more often, and each compaction replaces the session's history with a summary.

Do not set a window unless the user picks one. When they do, run (with their size, e.g. `400k`):

```bash
node "${CLAUDE_PLUGIN_ROOT}/dist/cli.js" compact-window 400k
```

It writes `autoCompactWindow` to `~/.claude/settings.json` and keeps a backup; it applies to sessions started afterwards. `compact-window off` undoes it.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.