Developer fixes TypeScript hook slowdown with 200KB cache threshold switch
A solo developer building an autonomous Claude Code setup discovered that adding the --incremental flag to a TypeScript post-edit hook made cold compilation runs 3.6 times slower, not faster. The slowdown was caused by the .tsbuildinfo cache file growing large enough that reading it on every hook execution outweighed the incremental diff savings. After measuring the project where the issue appeared, the developer identified roughly 200KB as the point where incremental mode stops being beneficial. A one-line script was added to automatically fall back to plain --noEmit when the cache file exceeds that threshold. The fix restored fast feedback loops in large projects while preserving incremental speed gains in smaller ones.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in