Tagged articles
2 articles
Page 1 of 1
James' Growth Diary
James' Growth Diary
May 17, 2026 · Backend Development

Deep Dive into the buildTool Factory and Its Fail‑Closed Default Values

The article explains how the buildTool factory injects conservative default safety flags (Fail‑Closed), dramatically reduces boilerplate for the 30‑plus methods required by Claude Code's Tool interface, and combines TypeScript compile‑time checks with Zod runtime validation, illustrated with GlobTool, BashTool and FileEditTool examples, while discussing trade‑offs and design recommendations.

Code GenerationFactory PatternFail-Closed
0 likes · 16 min read
Deep Dive into the buildTool Factory and Its Fail‑Closed Default Values
James' Growth Diary
James' Growth Diary
May 17, 2026 · Backend Development

Why Claude Code’s Tool System Relies on a Generic Triple for Safety and Flexibility

The article dissects Claude Code’s tool architecture, showing how a single generic triple (Input, Output, Progress) defined in src/Tool.ts unifies over 60 runtime tools, enforces type‑safe contracts, streamlines permission checks, progress reporting, and implements a fail‑closed default strategy.

Claude CodeDesign PatternsFail-Closed
0 likes · 20 min read
Why Claude Code’s Tool System Relies on a Generic Triple for Safety and Flexibility