---
title: "compact-nudge"
description: "Nudge the user to run /compact once the session context passes a token threshold, with a ready-to-edit /compact command drafted from the conversation. Claude Code only (function hooks); never compacts on its own."
canonical: https://agentpluginsdirectory.com/plugins/compact-nudge
last-updated: 2026-10-07
---

# compact-nudge
Nudge the user to run /compact once the session context passes a token threshold, with a ready-to-edit /compact command drafted from the conversation. Claude Code only (function hooks); never compacts on its own.
- Slug: compact-nudge
- Publisher: AgentRelay Maintainers
- Repository: https://github.com/trisjr/agent-relay
- Manifest: plugins/compact-nudge/plugin.json
- Version: 0.1.0
- Category (editorial): other
- Skills: 0
- MCP servers: 0
- Stars: 1
- Repository created: 2026-09-25
- Repository last pushed: 2026-10-07
- Publisher type: User
- Listing: https://agentpluginsdirectory.com/plugins/compact-nudge
- Schema: https://agent-plugins.org/schemas/1.0.0/plugin.schema.json

## What compact-nudge does, in the publisher's words

Plugin cho Claude Code. Khi context của session vượt một ngưỡng token, plugin nhắc người dùng chạy /compact và soạn sẵn lệnh /compact dựa trên chính cuộc hội thoại. Plugin không bao giờ tự compact: người dùng quyết định.

Mỗi lượt, Claude Code gửi lại toàn bộ context. Context càng lớn thì mỗi lượt càng tốn, kể cả khi prompt cache hit gần 100%: tiền đọc cache tỉ lệ thuận với độ dài context. Audit thực tế trên khoảng 21.000 API call cho thấy:

- khoảng 51% chi phí nằm ở các call có context trên 200K token;
- người dùng có compact thủ công, nhưng thường quá muộn (trung vị khoảng 300K);
- sau compact, context còn khoảng 15 to 18K token, nên một lần compact hoà vốn sau 3 to 5 lượt.

From the project README, punctuation lightly normalized. Full text: https://raw.githubusercontent.com/trisjr/agent-relay/HEAD/plugins/compact-nudge/README.md
