mirror of
https://github.com/tiennm99/ccs.git
synced 2026-07-16 02:11:28 +00:00
Add PreToolUse hook that intercepts Read tool calls on image files (.png, .jpg, .webp, etc.) and blocks them with helpful message. This prevents context exhaustion when image generation skills produce multiple files and the agent tries to read them (each image can consume 100K+ tokens). Configuration: - Enable via config.yaml: hooks.block_image_read.enabled: true - Or env var: CCS_BLOCK_IMAGE_READ=1 Hook integration: - lib/hooks/block-image-read.cjs - the hook script - src/utils/hooks/image-read-block-hook-env.ts - config loader - Integrated into all spawn locations (ccs.ts, shell-executor, cliproxy-executor) Closes #426