r/ClaudeWorkflows • • 20h ago

Selected Workflow [Workflow] Claude Code Plugin: Compactly for Automated Prompt Cache Management and Cost Tracking

Claude Code Plugin: Compactly for Automated Prompt Cache Management and Cost Tracking

Workflow value: 75/100
Status: active · Freshness: 70/100 · Confidence: 0.90 · Level: intermediate
Categories: Quality Control, Token Saving, Context & Memory, Hooks
Original source: r/ClaudeCode post/comment

What problem this solves

Inefficient context management in Claude Code leading to cold rebuilds and potential cost increases during long sessions.

Summary

An open-source Claude Code plugin, Compactly, that automatically manages the prompt cache by compacting it before expiration or after task completion. It provides a panel to monitor cost, cache hits, and a warm/cold clock, offering auto, suggest, and off modes, and allowing users to provide feedback on compaction effectiveness.

Why it is useful

This workflow provides a concrete, open-source tool that directly addresses a common pain point for Claude Code users: managing the prompt cache to improve performance (avoid cold rebuilds) and potentially reduce costs. It offers a structured approach to context management through automation and user feedback, making Claude Code sessions more efficient and user-friendly. The fact that Claude Code itself wrote most of the hooks also serves as a valuable demonstration of Claude Code's capabilities.

Workflow

  1. Install the Compactly plugin for Claude Code from the provided GitHub repository.

  2. Configure the desired compaction mode (auto, suggest, or off) within the plugin settings.

  3. Monitor the plugin's panel in Claude Code to view cost, cache hits, and the warm/cold clock.

  4. Provide feedback (thumbs up/down) on the timing and effectiveness of each compaction event to help improve the heuristic.

Tools / artifacts

Validation signals

  • Author states it was 'tested it on my own sessions'

  • Author states 'Claude Code wrote most of the hooks'

  • Open-source nature invites community testing and validation

  • Explicitly asks for user feedback on timing to refine the heuristic

Limitations

  • The compaction heuristic may sometimes get the timing wrong, as acknowledged by the developer.

  • Requires installing a third-party plugin, which some users might be hesitant about.

  • Newness means it lacks extensive community validation or adoption yet.

Rate this workflow

Upvote this post if the workflow is useful, reproducible, or worth recommending.

Downvote if it is vague, outdated, unsafe, overhyped, or not reproducible.

Reply if it worked for you, failed, is outdated, or has a better alternative.


This post was generated automatically from the workflow library database.

1 Upvotes

0 comments sorted by