Conversation
… path
The hook checks the file size before deciding whether to intercept a Read.
It does this with statSync(filePath). But statSync needs an absolute path —
if Claude passes a relative path like 'src/api/foo.ts', statSync can't find
the file (the hook process has a different working directory than the project).
It throws, the catch block silently returns {}, and the hook does nothing —
the raw file is read as normal, bypassing the TLDR token savings entirely.
Fix: convert relative paths to absolute using input.cwd (the project directory
that Claude Code provides in the hook payload):
const filePath = isAbsolute(rawFilePath)
? rawFilePath
: join(input.cwd, rawFilePath);
Also fixes pre-existing TypeScript compile errors:
- daemon-client import missing .js extension (required by NodeNext module resolution)
- DaemonResponse interface missing imports/importers fields (used in importsDaemon())
- tsconfig excludes src/__tests__ to stop test files breaking the build
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ported from parcadei/Continuous-Claude-v3#152 by @marcuspuchalla
Problem
The hook checks file size with
statSync(filePath)but needs an absolute path. If Claude passes a relative path likesrc/api/foo.ts,statSynccan't find the file, throws, the catch block silently returns{}, and TLDR never kicks in.Fix
Convert relative paths to absolute using
input.cwd:Also fixes pre-existing TypeScript compile errors in daemon-client and tsconfig.
Test plan