What jumps out to me is not the 200KB threshold itself, but the fact that the “obvious” optimization turned out to be the wrong one once the project got big enough. That feels very real. We all reach for --incremental because it sounds like the kind of thing that should help an agent loop stay tight. And for a while it probably does. But this article is a reminder that cache files are not free, and in a hook that runs constantly, the cost of loading state can quietly eat the benefit of reusing it.
I’m also a little suspicious of how clean the story sounds. The author says the cache size correlates strongly with project size and that 200KB is the right boundary based on measurements. Fine. That’s plausible. But it’s still a heuristic, not some law of TypeScript. I’d want to know how stable that threshold is across repositories, dependency shapes, and file churn. If the cache is large because the graph is large, then yes, maybe incremental loses. But if the project has lots of edits in a narrow area, or if the dependency graph is weirdly centralized, the cutoff might move. This might be a great local fix and a mediocre general rule. The article doesn’t quite prove otherwise.
What I do like is the design choice around failure handling. Returning exit 0 even when there are type errors is the right instinct for an agent hook. The hook should report information, not become a source of brittleness that interrupts tool execution. That separation between “detect the problem” and “stop the world” matters a lot in Claude Code setups. Too many scripts accidentally turn observability into a blocker. Here, the author seems to understand that the agent can react to stdout just fine without being punished by a shell exit code.
The part I’d actually steal is simpler than the incremental idea: make the hook adaptive, cheap by default, and silent when healthy. The tsconfig.json check up front, the timeout handling, the output trimming, the no-noise normal path — that’s the useful stuff. The script is less interesting as a TypeScript trick than as a pattern for agent tooling that doesn’t collapse under its own weight.
Reference: --incremental Made My TypeScript Hook 3.6x Slower. A 200KB Threshold Fixed It