Skip to content
Back to skills

compaction-advisor

ASecurity

Provides context-aware compaction guidance with intelligent checkpointing. Monitors context during long tasks and suggests checkpoints before compaction interrupts your work.

  • 17 stars
  • 0 votes
  • 0 copies
  • 14 views
  • Added February 6, 2026
data-aigorefactoring

Works with

  • claude code
  • cli

Security analysis

A100/100

Pro scans all 13 files and shows the line behind each finding

Scanned February 12, 2026

npx -y skills add vignesh07/compaction-advisor --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of compaction-advisor?

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

Security grade badge for compaction-advisor
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/vignesh07-compaction-advisor/badge)](https://www.skillsdirectory.com/skills/vignesh07-compaction-advisor)

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: compaction-advisor
description: Provides context-aware compaction guidance with intelligent checkpointing. Monitors context during long tasks and suggests checkpoints before compaction interrupts your work.
license: MIT
compatibility: Claude Code CLI with hooks enabled
---

# Compaction Advisor

You receive automatic context status via XML tags when context is concerning.

## Message Types

### 1. Context Status (on user prompts)

When you see these tags at the start of a conversation turn:

```
<context-status>CRITICAL: Only 12k tokens free. Run /compact before any task.</context-status>
<context-status>WARNING: 25k tokens free. Only small tasks safe.</context-status>
<context-status>CAUTION: 40k tokens free. Medium tasks OK, compact before large.</context-status>
```

When context is healthy (50k+ free), you won't see any tag.

### 2. Checkpoint Suggestions (during long tasks)

During multi-step work, you may see:

```
<context-checkpoint>
CHECKPOINT RECOMMENDED: Context critically low (18k free) after 12 operations.
Good time to pause and /compact. Summarize progress so far and key context to preserve.
</context-checkpoint>
```

This means you've been working for a while and context is running low.

### 3. PreCompact Warning (emergency)

Just before auto-compaction triggers:

```
<precompact-warning>
AUTO-COMPACTION IMMINENT
Context window is full. Compaction will happen after this message.
</precompact-warning>
```

## How to Respond

### When you see `<context-status>` CRITICAL

Immediately advise:
```
Context is critically low (12k free). Before we proceed, run:
/compact Focus on [relevant context to preserve]
```

### When you see `<context-status>` WARNING

For small tasks: proceed with caution
For medium+ tasks: recommend compaction first

```
Context is at 25k free. For a refactor like this (~50k needed),
run /compact first to avoid mid-task interruption.
```

### When you see `<context-checkpoint>`

This is mid-task. Pause and offer a checkpoint:

```
Good checkpoint - I've completed:
• [List what you've done so far]
• [Key decisions made]
• [Files modified]

Context is at 18k. To continue safely, run:
/compact Focus on [key context for remaining work]

After compacting, I'll continue with [next steps].
```

### When you see `<precompact-warning>`

This is urgent. Quickly summarize:

```
Compaction is about to happen. Quick summary of our progress:
• [What we were working on]
• [What's been completed]
• [What remains to do]

After compaction, remind me to [specific next step].
```

### When you see nothing

Context is healthy. Proceed normally without mentioning it.

## Task Size Reference

| Task | ~Tokens Needed |
|------|----------------|
| Typo fix | 5k |
| Bug fix | 15k |
| New feature | 30k |
| Refactor | 50k |
| Architecture | 80k+ |

## Compact Commands

```
/compact                              # General
/compact Focus on [specific context]  # Preserve specific context
```

Examples:
- `/compact Focus on the auth changes and test failures`
- `/compact Keep the refactoring progress and file structure decisions`

## Key Points

- You automatically receive context state - no need to ask user
- During long tasks, checkpoint suggestions appear after 8+ operations
- Match urgency to the tag level (CRITICAL > WARNING > CAUTION)
- For checkpoints, summarize progress and suggest what to preserve
- For precompact, quickly capture essential context
- For healthy context, work normally without mentioning it

Files in this skill

  • .claude-plugin/marketplace.json416 B
  • .claude-plugin/plugin.json332 B
  • SKILL.md3.4 KB
  • commands/setup.md332 B
  • commands/test.md814 B
  • hooks/hooks.json622 B
  • install.sh4.3 KB
  • references/THRESHOLDS.md5.3 KB
  • scripts/checkpoint_advisor.sh3.1 KB
  • scripts/context_status.sh2.9 KB
  • scripts/inject_context.sh1.6 KB
  • scripts/precompact_advisor.sh1002 B
  • scripts/setup.sh2.3 KB

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.

View all in data-ai →

Comments

Loading comments…

Newsletter

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