Skip to content
Development
Hook

Hooks

What claude-token-reducer runs automatically, and when. A hook is a command Claude Code fires at a fixed moment, without you asking for it.

Install
$ npx -y skills add Madhan230205/token-reducer --agent claude-code

Ships with claude-token-reducer. Installing the plugin gets these hooks.

What fires, and when

UserPromptSubmit

Fires before Claude sees each prompt you send. A plugin can use it to inject context, so the same instruction reaches the model every turn instead of only at session start.

  • Runs userprompt_guard.py.
Read hooks/hooks.json

Where it lives

Read the script before you install anything that runs on your machine. This is the one part of a plugin that acts without being asked.

Ships withclaude-token-reducer

⚡ Cut Claude token usage by 90%+ — free, open-source, local-first context compression for Claude Code. Hybrid RAG (BM25 + ONNX vectors), AST chunking, reranking. No API needed.

Get the whole plugin, auto-invoked
Stats
42
Stars
0
Views
4
Forks
Maintained
Maintenance
Python
Language
MIT
License
3mo ago
Last commit
4mo ago
Created

Repo: Madhan230205/token-reducer