The Tool Desk
Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →Adding --incremental to a TypeScript check in a post-tool hook made the cold run about 3.6× slower in one author’s project. Their fix was a guard: if the existing .tsbuildinfo file is larger than 204,800 bytes (200 × 1024), the hook skips incremental state and runs a plain tsc --noEmit. That threshold is specific to their closet-os repository, and the result is one author’s report from 2026, not a general TypeScript performance rule. What follows explains where the cost comes from, how to reproduce the measurement on your own project, and how to build a guard that matches your setup.
What the author measured
The author ran a TypeScript type check from a Claude Code post-tool hook, which runs after the assistant edits a file. Their first change was to add --incremental, which made cold runs (runs with no prior build state) about 3.6× slower on the closet-os project. The author attributes the slowdown to the work of generating and reading the .tsbuildinfo state file.
As an Amazon Associate I earn from qualifying purchases.
Three limits apply to this result. The write-up does not publish a full benchmark table, the compiler version used, or the machine specification. It is also a single project, so it shows that the slowdown happened there, not how large it will be elsewhere. The author explicitly recommends measuring your own crossover point rather than copying the 200 KB figure.
Recommended Free Tools
What .tsbuildinfo is and why it costs time
The incremental compiler option saves project-graph information from a previous compilation so that later builds can find a cheaper way to type-check and emit only what changed. The TypeScript 3.4 release notes describe it in exactly those terms. The saved state lives in a .tsbuildinfo file. The official incremental TSConfig documentation states that these files are not used by your JavaScript at runtime and can be safely deleted, and that tsBuildInfoFile controls where they are written.
#1 Best Overall
Why the first run can be slower
Incremental mode does bookkeeping before it can save any time. The compiler has to record the state it will need later, and that work is paid on the run that creates the file. The TypeScript 4.3 release notes say this directly: incremental and watch modes may require initial bookkeeping and can make an initial build slower in some cases. The same notes describe later changes that defer some calculations and reduce cache size in particular examples. Those changes are version-specific, so the timing profile you see on a current compiler may differ from the one the author measured.
Why the file size matters
A larger .tsbuildinfo generally means more state to write on each save and more to read on each load. That is why the author used file size as a proxy for the point where the overhead stops paying off. Size is a practical signal, not a direct measure of speed. Two projects with the same file size can behave differently if their file counts, type graphs, or edit patterns differ.
Rank #2
- TypeScript implements a superset of syntax for strictly typed development, facilitating deep static analysis and enhanced development environment integration. The compiler translates source into standard script formats, ensuring parity across any runtime.
- TypeScript is ideal for front-end developers, full-stack engineers, and software architects who build large-scale web applications. It serves those looking to improve code excellence, reduce bugs through static checking, and maintain complex projects more.
- Lightweight, Classic fit, Double-needle sleeve and bottom hem
The guard the author describes
The hook stores build state in a dedicated file under node_modules/.cache, passes its path with --tsBuildInfoFile, and checks the file size before choosing a command. The steps are:
Quick wins for a faster PC:
Clear out junk files and repair common Windows errorsFree Scan →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Repair Windows errors before they cause bigger problemsFix Now →- Set the build-info path, for example
node_modules/.cache/tsc/tsconfig.tsbuildinfo, so the state file sits outside your source tree. - Read the file’s size in bytes. The author uses
stat -f %z, which is the macOS form. On Linux, GNUstat -c %sis the equivalent; a portable option iswc -c, shown below. - If the file is absent or at or below 204,800 bytes, run
tsc --noEmit --incremental --tsBuildInfoFilewith that path. - If the file is larger than the limit, run plain
tsc --noEmit. - Let the hook exit with the status of the type-check command, not of a later logging step.
#!/bin/sh
BUILDINFO=node_modules/.cache/tsc/tsconfig.tsbuildinfo
LIMIT=204800
if [ -f "$BUILDINFO" ] && [ "$(wc -c < "$BUILDINFO" | tr -d ' ')" -gt "$LIMIT" ]; then
npx tsc --noEmit
else
npx tsc --noEmit --incremental --tsBuildInfoFile "$BUILDINFO"
fi
This sketch is the author’s approach adapted to a portable size check. Test it on each operating system and shell where the hook runs. One behavior to plan for: once the file exceeds the limit on the fallback path, nothing refreshes it, so the hook stays on plain checks until you delete the file. Deleting it is safe, as the official documentation notes, and it lets the next run create a fresh state file.
Exit codes in pipelines
The author reports a pipeline problem in which the captured status did not reflect the type-check result. In a POSIX shell, a pipeline’s exit status is that of its last command unless set -o pipefail is enabled, which is not part of every shell. If you pipe tsc output to a log file or a formatter, check the status of tsc itself, for example by writing its output to a file first and then testing its exit code.
How to measure your own crossover
Run the four cases below on the same repository, the same compiler version, and the same machine, with the same hook environment. Repeat each timing several times and use the median. Keep a record of the .tsbuildinfo size after each run, measured with wc -c.
| Case | Command state before the run | What to record |
|---|---|---|
| Ordinary check | No build-info file used; run tsc --noEmit |
Elapsed time only |
| Cold incremental | Build-info file deleted; run with --incremental --tsBuildInfoFile |
Elapsed time and resulting file size |
| Warm incremental, no edits | Build-info file from the previous run; no source changes | Elapsed time and file size |
| Warm incremental, one edit | Build-info file from the previous run; change one representative source file | Elapsed time and file size |
Compare the cold incremental time with the ordinary check to see the first-run penalty. Compare the warm cases with the ordinary check to see whether the saved state pays off in your normal workflow. Your crossover is the file size at which the warm time stops beating the ordinary check by enough to justify the cold cost. Set your threshold from that data, not from 200 KB.
PC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11Outdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchQuick Recap
Best Value
Compiler and platform caveats
- Record the exact TypeScript version with
npx tsc --version. The release-note points above describe different versions, and later changes may alter both timing and cache size. - Note whether your project uses project references or a custom
tsBuildInfoFilepath, because either changes what the file contains. - Keep the hook’s environment the same as your measurement environment. A hook run from an editor may have a different working directory,
PATH, or Node version than your terminal.
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




