when-to-clear
Reminder and report that show how much usage goes to re-reading long Claude Code conversations.
- CCM score
- 59 of 100
- version
- 0.1.1
- GitHub stars
- 3.8K
Own this plugin? Claim it
What it does
- Adds a Stop hook that prints a one-line reminder once a conversation passes 200k tokens; it never blocks
- Provides a
handoffskill that writesHANDOFF.mdso/clearand a fresh session keep your place - Runs a local report from saved transcripts, using Python standard library only and no network access
- Designed for long-running sessions where repeated context re-reads drive up usage limits
Shows how much of your Claude Code usage goes to re-reading long conversations, from the token counts already saved in your local transcripts. A Stop hook prints a one-line reminder when a conversation passes 200k tokens (once per size step; it never blocks), and a handoff skill writes a short note so /clear does not lose your place. Standard-library Python, local files only, no network.
Add marketplace
/plugin marketplace add davepoon/buildwithclaudeRun it inside Claude Code once, then install the plugin below.
Install
/plugin install when-to-clear@buildwithclaudeRun it inside Claude Code after adding the marketplace.
From the davepoon/buildwithclaude README
Build with Claude
Claude Skills, Agents, Commands, Hooks, Plugins, Marketplaces collections for and extend Claude Code
A plugin marketplace and discovery platform for Claude Code. Browse curated plugins, discover community contributions, and extend your Claude Code workflows.
Quick Start
# Add the Build with Claude marketplace
/plugin marketplace add davepoon/buildwithclaude
# Browse available plugins
/plugin search @buildwithclaude
# Install plugins
/plugin install <plugin-name>@buildwithclaude
What's Included
Build with Claude Plugins
Curated collections maintained in this repository:
| Type | Count | Description |
|---|---|---|
| Agents | 117 | Specialized AI experts (Python, Go, DevOps, Security, etc.) |
| Commands | 175 | Slash commands for automation (/commit, /docs, /tdd) |
| Hooks | 28 | Event-driven automation (notifications, git, formatting) |
| Skills | 26 | Reusable capabilities from plugins |
| Plugins | 51 | Bundled plugin packages by category |
Community Discovery
The platform indexes plugins from the broader Claude Code ecosystem:
- 20k+ Community Plugins from external marketplaces
- 4,500+ MCP Servers for database, API, and tool connections
- 1,100+ Plugin Marketplaces from the community
Web UI
Browse, search, and explore everything at buildwithclaude.com
Build with Claude Homepage
Browse Plugins
Browse Skills
Browse MCP Servers
Browse Plugin Marketplaces
Features
- Browse all plugin types with filtering
- Search across plugins, agents, commands, hooks, skills
- Copy install commands with one click
- View full documentation and usage examples
- Discover MCP servers and community plugins
Installation Options
Option 1: Plugin Marketplace (Recommended)
# Add marketplace
/plugin marketplace add davepoon/buildwithclaude
# Install specific plugins
/plugin install agents-python-expert@buildwithclaude
/plugin install commands-version-control-git@buildwithclaude
/plugin install hooks-notifications@buildwithclaude
# Or install everything
/plugin install all-agents@buildwithclaude
/plugin install all-commands@buildwithclaude
/plugin install all-hooks@buildwithclaude
Option 2: Manual Installation
# Clone repository
git clone https://github.com/davepoon/buildwithclaude.git
cd buildwithclaude
# Install agents
find plugins/agents-*/agents -name "*.md" -exec cp {} ~/.claude/agents/ \;
# Install commands
find plugins/commands-*/commands -name "*.md" -exec cp {} ~/.claude/commands/ \;
# Restart Claude Code
Available Plugin Categories
Agents (11 categories)
- Development & Architecture - Backend, frontend, mobile, GraphQL experts
- Language Specialists - Python, Go, Rust, TypeScript, C/C++ experts
- Quality & Security - Code review, security audit, debugging
- Infrastructure & Operations - DevOps, cloud, database optimization
- Data & AI - ML engineering, data pipelines, AI development
- Crypto & Blockchain - Trading systems, DeFi, Web3 development
Browse Subagents
Commands (22 categories)
- Version Control - Commit, PR creation, branch management
- Code Analysis - Testing, review, optimization
- Documentation - Docs generation, changelogs, API specs
- Project Management - Todos, PRDs, task tracking
Browse Commands
Hooks (8 categories)
- Notifications - Slack, Discord, Telegram alerts
- Git - Auto-staging, smart commits
- Development - Lint on save, auto-format
- Security - File protection, vulnerability scanning
Browse Hooks
Usage Examples
Using Agents
Agents are automatically invoked based on context, or explicitly called:
"Use the python-pro to optimize this function"
"@agent-security-auditor review this authentication code"
"Have the devops-troubleshooter help debug this deployment"
Using Commands
Commands use the / prefix:
/commit # Create conventional commit
/create-pr # Create pull request
/docs # Generate documentation
/tdd # Start test-driven development
/code_analysis # Analyze code quality
Using Hooks
Hooks run automatically on events like tool calls or session start.
Contributing
We welcome contributions!
Adding Plugins
- Create a new directory in
plugins/following the naming convention - Add your plugin files (agents, commands, hooks)
- Run
npm testto validate - Submit a pull request
Plugin Format
Agent (plugins/agents-*/agents/*.md):
---
name: agent-name
description: When to invoke this agent
category: category-name
tools: Read, Write, Bash
---
You are a [role description]...
Command (plugins/commands-*/commands/*.md):
---
description: What this command does
category: category-name
argument-hint: <args>
---
Command implementation...
Hook (plugins/hooks-*/hooks/*.md):
---
hooks: PreToolUse, PostToolUse
description: What this hook does
---
Hook implementation...
See CONTRIBUTING.md for detailed guidelines.
Contributors
This project exists thanks to all the people who contribute.
Links
- Web UI: buildwithclaude.com
- Documentation: Claude Code Docs
- Plugin Marketplaces: Plugin Docs
- Issues: GitHub Issues
License
MIT License - see LICENSE for details.
Made with ❤️ by Dave Poon
Details
- Marketplace
- davepoon/buildwithclaude
- Source
- Balance0014/claude-code-when-to-clear
- Author
- Balance Zhao
- Category
- Monitoring
- License
- MIT
- Keywords
- monitoring, tokens, usage, context, stop-hook
- Listed since
- Nov 29, 2026
More from davepoon/buildwithclaude
All 257- wiro-aiv1.3.3
- wudlandv0.1.0
- yaptakev0.1.3
- yylo-skillsv2.0.3
- zeptapv1.0.2
- account-executive-jobsv1.1.1
- active-memoryv0.2.4
- agent-cityv0.1.0
- agent-standupv1.42.0
- agent-standup-bandv1.42.0
- agentkit-dev-skillsv1.2.2
- agents-ai-agentsv1.0.0
- agents-blockchain-web3v1.0.0
- agents-business-financev1.0.0
- agents-crypto-tradingv1.0.0
- agents-data-aiv1.0.0
- agents-design-experiencev1.0.0
- agents-development-architecturev1.0.0
- agents-documentationv1.0.0
- agents-infrastructure-operationsv1.0.0
- agents-language-specialistsv1.0.0
- agents-media-contentv1.0.0
- agents-quality-securityv1.0.0
- agents-researchv1.0.0
Similar to when-to-clear
More Memory & ContextcavemanJuliusBrussee/caveman122.7K starsTalk like caveman. Cut filler. Keep technical details explicit.
claude-memthedotmack/claude-mem120K starsPersistent memory for Claude Code: the next session starts where the last one left off.
agentdbruvnet/ruflo82.4K starsAgentDB (external: maintained in ruvnet/agentdb, pinned to commit 27678c3, plugin 3.6.0): agentdb's own standalone MCP server pinned to agentdb@3.6.0 (vector me
headroomheadroomlabs-ai/headroom80.8K starsHeadroom startup hooks for Claude Code and GitHub Copilot CLI.
mem0mem0ai/mem069.4K starsCross-session memory and token savings for coding agents.
mempalaceMemPalace/mempalace60.7K starsAI memory system — mine projects and conversations into a searchable palace. 47 MCP tools, auto-save hooks, guided setup.