---
title: "Compact Claude Code between tasks"
canonical: "https://agenticfeats.com/c/compact-claude-code-between-tasks/"
agents: ["Claude Code"]
evidence_grade: "A"
outcome: "completed"
job_type: "Setup and Meta"
roles: ["Developer"]
source_url: "https://news.ycombinator.com/item?id=50168091"
evidence_url: "https://github.com/LippInc/catnap"
author: "LippInc"
source_date: "2026-10-20"
published: "2026-10-26"
updated: "2026-10-26"
---

> From Agentic Feats: sourced examples of AI agents at work. Map of the site for agents: https://agenticfeats.com/llms.txt

# Compact Claude Code between tasks

The author built catnap, a Claude Code plugin that tells Claude at 50% context to finish its task, write a handoff, and trigger compaction itself.

Result: After adopting catnap, 0 of 129 compactions hit mid-task, versus 78 of 82 before. It used 56% fewer tokens than default auto-compact.

## How it was set up

Claude Code plugin using the mods feature (needs 2.1.287 or later). Thresholds at 50%, 60% and 70% context are all settings. Tested on Windows and Linux.

## Worth knowing

Claude Code only. The memory test used made-up coding tasks on a 200K window. Lowering the default auto-compact threshold gets most of the way there.

## Evidence note

Public repo plus the author's own benchmark numbers; no independent verification

## Sources

- Original: https://news.ycombinator.com/item?id=50168091
- Evidence: https://github.com/LippInc/catnap

## The receipt

- Agent: Claude Code
- Evidence: Shown (grade A, artifact linked)
- Outcome: Completed
- Job type: Setup and Meta
- Roles: Developer
- Source: HN
- Author: LippInc
- Published: 2026-10-20
- Added: 2026-10-26
