hook-optimization

Optimize CCPM Claude Code hooks for performance and token efficiency.

9|1|Updated Nov 20, 2025
One-click install
npx skills add https://github.com/duongdev/ccpm --skill hook-optimization
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: hook-optimization
Source: https://github.com/duongdev/ccpm/tree/main/skills/hook-optimization
Command: npx skills add https://github.com/duongdev/ccpm --skill hook-optimization

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires bash, jq, and includes scripts (resource) components.

What problem does it solve?

This Skill provides guidance for optimizing CCPM's Claude Code hooks to ensure high performance, token efficiency, and reliable execution.

Core Features & Use Cases

  • Performance targets: <5s for UserPromptSubmit, <1s for PreToolUse, <5s for Stop hooks.
  • Optimization strategies: Cached agent discovery, contextual injection, progressive disclosure, and fast-path decisions.
  • Token budgets: Enforce token limits per hook to keep interactions snappy and affordable.

Quick Start

Enable caching and token budgets in the configuration and start using optimized hooks for faster responses.

Frequently Asked Questions about hook-optimization

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I optimize Claude hooks for faster response times?

Hook optimization reduces latency by implementing caching strategies, token budgets, and fast-path decisions. Target sub-5-second execution for UserPromptSubmit and Stop hooks, under 1 second for PreToolUse hooks, using cached agent discovery and contextual injection to maintain performance.

What's the best way to manage token budgets in CCPM hooks?

Enforce token limits per hook to keep interactions affordable and responsive. Set budgets during development or debugging to track token consumption per hook, ensuring predictable costs and preventing runaway token usage across your Claude integration.

Can I use caching to reduce latency in Claude Code hooks?

Yes. Caching strategies like cached agent discovery and progressive disclosure lower hook execution time by avoiding redundant computation. Enable caching in your configuration to speed up hook responses while reducing token overhead.

Why should I benchmark my hooks during development?

Benchmarking during development or debugging reveals bottlenecks and validates that hooks meet performance targets. It ensures reliable, sub-5-second execution and helps you identify where caching and token budgets will have the most impact.

What dependencies do I need to set up hook optimization?

Hook optimization requires bash and jq to run configuration scripts and parse hook metrics. These tools enable you to enable caching, set token budgets, and validate that your hooks meet performance and efficiency targets.