POSIX sh hook (50 LOC) that intercepts Read on .docx/.doc/.xlsx/.pptx/.csv and auto-redirects Claude to a cached markdown conversion via the tomd primitive. - jq absence → exit 0 (graceful degrade, matches assemble-validate style) - tomd primitive missing → exit 0 (don't block) - cache dir via KEISEI_TOMD_CACHE env (default /tmp/keisei-tomd-cache) - cache key = basename + mtime, portable stat for macOS/Linux - exit 2 with [tomd-preread] stderr message on successful conversion - conversion failure → exit 0 (let Claude try original, fail naturally) Not wired into settings-snippet.json yet — follow-up commit adds the PreToolUse(Read) entry alongside install.sh hooks-copy loop extension. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| assemble-agents.sh | ||
| assemble-validate.sh | ||
| no-hand-edit-agents.sh | ||
| tomd-preread.sh | ||