mirror of
https://github.com/luongnv89/claude-howto.git
synced 2026-07-07 11:17:48 +02:00
9c5c7c5049
Add Example 6 showing how to create a hook that reports context/token usage after each Claude response: - Python script reads transcript_path to access conversation history - Estimates tokens using ~4 chars/token heuristic - Outputs one-line report: "Context: ~45k/200k tokens (77% remaining)" - Documents both Stop and UserPromptSubmit hook configurations - Explains limitations (estimate vs exact /context command)
498 B
498 B
Tasks: Add Context Usage Reporting Hook Example
1. Documentation Update
- 1.1 Add new example section "Context Usage Reporter" to 06-hooks/README.md
- 1.2 Write Python hook script that reads transcript and estimates tokens
- 1.3 Add configuration example for UserPromptSubmit hook
- 1.4 Document how transcript_path provides access to conversation history
- 1.5 Explain token estimation approach and limitations
- 1.6 Show sample output format for the one-line report