Build1 distinct publisher3 min readUpdated
A dev.to writeup on Claude Code hooks puts a number on a common configuration mistake: the TypeScript compiler costs seconds of startup before it checks anything.
The Engineer · Build desk
Compiled by The EngineerSomething wrong?How this is made
A dev.to post on Claude Code hook configuration makes one narrow, checkable claim worth acting on: `tsc` needs 2 to 4 seconds just to boot the Node process, parse `tsconfig.json` and load type definitions, and that cost repeats on every invocation [1]. Wire the compiler into a per-edit hook and you pay it once per file touched; batch it into a single run at the end of the turn and you pay it once per session [6].
The arithmetic is the whole argument. The author reports that days where an agent session touches 100 files are not unusual, and that per-file launches push the cumulative cost into minutes [3]. At 2 to 4 seconds of startup, 100 files is 200 to 400 seconds, or roughly 3.3 to 6.7 minutes of process boot with zero type checking done [1]. In a monorepo the multiplier gets worse, because the startup repeats per package [2].
The reason this hurts more than the equivalent save hook in an editor is scheduling. Claude Code hooks are called synchronously, so the agent blocks until the hook returns [4]. The author's framing is that an IDE running a whole-project check on save does not bother anyone because the UI and the background process are decoupled, and that the problem here is not checking but checking every time [5]. His description of the naive setup is slightly muddled: he describes the obvious wiring as Prettier on PostToolUse and the compiler on Stop [16], while the symptom he reports is the type check firing on every write [3]. The mechanism is clear enough regardless. Anything expensive in a PostToolUse hook is a stall the agent eats before its next tool call.
The fix is a two-file split. `post-edit-accumulator.js` runs on PostToolUse and does nothing but stack paths; `stop-format-typecheck.js` runs on Stop and processes them in bulk [8]. The accumulator tests each path against `/\.(ts|tsx|js|jsx)$/` and appends it with `appendFileSync` [9], chosen because Claude Code sometimes fires tool calls in parallel, meaning several hook processes can write at once and an atomic append is the cheap way to survive that [10]. Paths land in `/tmp/ecc-edited-{sessionId}.txt`, one per line, duplicates allowed, scoped to the session [11]. The Stop hook reads that file and immediately unlinks it to prevent double processing, dedupes with a `Set`, groups by project root for one formatter pass (`biome check --write` or `prettier --write`), and groups by `tsconfig.json` for one `npx tsc --noEmit` per config [12]. Errors are filtered to lines touching the edited files, capped at 10, and written to stderr [13].
The claimed result is that a 50-file session launches `tsc` 1 to 3 times rather than 50 [7]. On the author's own startup figure that is 100 to 200 seconds of boot replaced by 2 to 12, a saving of roughly 88 to 198 seconds per session [2].
Treat the rest of the post with more distance. The author frames this inside a personal revenue arc ending at 1.2 million yen a month [15], and credits about half of his increased workload and code quality to accumulated environment work [14]. None of that is verifiable and none of it is needed; the startup number stands on its own.
What to watch: the Stop-only design means type errors surface at the end of a turn, not at the edit that caused them, so measure whether your agent wastes more time building on a broken file than it saved on process boot. Also check the unlink-on-read step under parallel Stop events, and confirm the 10-line error cap is not hiding the failure that matters [12][13].
Follow any of these and your For You feed starts watching them — no settings page required.
Ranked by verification strength, evidence, and original report placement.
tsc takes 2-4 seconds just to start up: booting the Node.js process, parsing tsconfig.json and loading type definition files, all of which repeats on every invocation.
In a monorepo, the per-file tsc launch cost repeats per package.
Days where you touch 100 files during a Claude Code session are not unusual, and launching tsc each time pushes the cumulative cost into minutes; the author's reported symptom is that the TypeScript check runs every single time and the response keeps stalling.
The fix is to accumulate paths on every edit and run the check only when Claude finishes the turn (Stop); processing multiple files in one launch drops the startup cost to 1/N.
Even if you touched 50 files during a session, tsc launches 1-3 times (per tsconfig).
Claude Code hooks are called synchronously; Claude stops until the hook finishes, so the next operation is blocked until tsc completes.
Evidence-backed comparisons of source perspectives and observed adoption signals. Read the methodology
Which Builder, Operator, and Investor concerns the observed source mix emphasized—not a truth score.
Evidence, demonstrated adoption, hype gap, incentives, and confidence are assessed independently, each on its own current evidence. How these are measured.
Mechanism documented, headline timing unmeasured
The implementation side is well evidenced for a blog post: named hook files, code excerpts with line ranges, an explicit concurrency argument for appendFileSync, a filename-sanitizing scheme, and a step-by-step Stop-hook pipeline. What carries the story's thesis, however, is the 2-4 second startup figure and the 1/N saving, and neither has a benchmark, hardware, repo size, or before/after timing anywhere in the source. Single publisher, no corroboration, and the article's own description of the 'default' wiring conflicts with its description of the baseline behavior.
One self-reported personal setup
The only adoption evidence is the author's own disclosure that he runs this hook pair in his Claude Code sessions. There is no repository, package, template, star count, team deployment, or third-party report of anyone else using the pattern, and no usage numbers beyond anecdotal file counts per session.
Sound mechanism, oversold numbers and outcomes
The underlying mechanism — synchronous hooks make fixed per-process startup a per-edit tax, so batch at turn end — is coherent and modestly stated. The overstatement sits in the framing: a precise-sounding 2-4 second figure with no measurement, a 1/N saving claim never demonstrated end to end, a revenue trajectory used as proof of method, and 'about half attributable' credit to environment work. The post also omits the costs of its own fix (delayed type feedback within a turn, 10-line error truncation) and the incremental-compilation alternatives, which inflates the apparent size of the win.
Personal-brand and monetization framing around a technical tip
The post opens and closes on the author's income story (100,000 yen budget, 600,000 from side jobs, layoff to zero, 1.2 million yen a month) and credits half his gains to environment work of this kind, which is a promotional structure typical of developer-platform self-publishing. There is no disclosed vendor relationship, sponsorship, or commercial product in the source, so the incentive is reputational and audience-building rather than paid, and the technical content itself is checkable code.
Confident on mechanism, weak on magnitude and reach
Confidence is moderate because the qualitative core (synchronous hooks block the agent; batching amortizes process startup; here is the exact code) is internally consistent and inspectable, while everything quantitative or outcome-related rests on one unaudited self-report from a single publisher with no adoption beyond the author. An internal contradiction about the naive baseline further caps confidence.
build
Yadda 3's real artifact is not the code, it is the rules the agent could not rewrite1 distinct publisher
build
A GAN beauty filter is a device budget allocation, not a feature toggle1 distinct publisher
build
The 46GB Leak Your RSS Alert Cannot See: macOS Compressed Memory Breaks Threshold Monitoring1 distinct publisher
build
Write the ledger row before the transcription call, or stop guessing at per-tenant margin1 distinct publisher
Distinct publishers with included, body-backed reporting in this cluster.
dev.to
1 article · August 19, 2026