James' Growth Diary
Author

James' Growth Diary

I am James, focusing on AI Agent learning and growth. I continuously update two series: “AI Agent Mastery Path,” which systematically outlines core theories and practices of agents, and “Claude Code Design Philosophy,” which deeply analyzes the design thinking behind top AI tools. Helping you build a solid foundation in the AI era.

132
Articles
0
Likes
365
Views
0
Comments
Recent Articles

Latest from James' Growth Diary

100 recent articles max
James' Growth Diary
James' Growth Diary
May 18, 2026 · Artificial Intelligence

Turning AI’s Short‑Term Memory into a Persistent Knowledge Base with memdir

This article examines Claude Code’s memdir system, explaining how it transforms fleeting AI conversation context into a durable, file‑based knowledge base by using markdown files as memories, a lightweight index, AI‑driven relevance selection, parallel prefetching, and careful type‑specific guidelines.

AI memoryClaude CodeFile System
0 likes · 17 min read
Turning AI’s Short‑Term Memory into a Persistent Knowledge Base with memdir
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
James' Growth Diary
James' Growth Diary
May 17, 2026 · Artificial Intelligence

When an Agent Fails: Retry, Fallback, and Human Takeover Strategies

The article classifies agent failures into transient, structural, and semantic types, compares how Claude Code, OpenAI Codex, and Google Gemini CLI agents handle errors, and shows how LangGraph implements robust retry policies, fallback routing, and human‑in‑the‑loop handoff with concrete code examples and best‑practice guidelines.

AgentError HandlingLangGraph
0 likes · 16 min read
When an Agent Fails: Retry, Fallback, and Human Takeover Strategies
James' Growth Diary
James' Growth Diary
May 16, 2026 · Artificial Intelligence

MCP Integration Deep Dive: Prompt Cache Stability and Tool Ordering Explained

The article analyzes why connecting an MCP server can triple response latency and token usage, explains how unstable tool ordering breaks Anthropic's prompt cache, and provides detailed code walkthroughs, design insights, common pitfalls, and concrete best‑practice recommendations for building reliable MCP integrations.

AI agent designClaude CodeMCP
0 likes · 18 min read
MCP Integration Deep Dive: Prompt Cache Stability and Tool Ordering Explained
James' Growth Diary
James' Growth Diary
May 16, 2026 · Artificial Intelligence

Dynamic Tool Selection Unpacked: Let the Agent Choose the Right Tool with Three Strategies

The article analyzes why binding all tools to an LLM agent is costly and error‑prone, presents benchmark data showing token usage dropping six‑fold and error rates falling by up to five times with dynamic selection, and details three practical strategies—vector retrieval, LLM routing, and rule‑semantic hybrid—along with implementation tips, description engineering, multi‑turn handling, and common pitfalls.

AgentLLMLangGraph
0 likes · 17 min read
Dynamic Tool Selection Unpacked: Let the Agent Choose the Right Tool with Three Strategies
James' Growth Diary
James' Growth Diary
May 15, 2026 · Artificial Intelligence

Five Intent Recognition Designs: From Keyword Matching to Classifier to LLM Self‑Routing – A Decision Tree to Choose the Right One

The article breaks down five production‑grade intent‑recognition designs—keyword matching, regex‑rule engine, embedding classifier, fine‑tuned small model, and zero‑shot LLM routing—provides code snippets, latency and cost benchmarks, decision‑making rules, and shows how a layered architecture can cut API costs from ¥80,000 to ¥3,000 while keeping accuracy above 90%.

Intent RecognitionLLM routingRule Engine
0 likes · 16 min read
Five Intent Recognition Designs: From Keyword Matching to Classifier to LLM Self‑Routing – A Decision Tree to Choose the Right One
James' Growth Diary
James' Growth Diary
May 14, 2026 · Backend Development

Inside Claude Code Skills: How a Single Markdown File Powers a Five‑Layer Loading Mechanism

The article dissects Claude Code's Skills system, showing how a lone SKILL.md file, combined with a five‑layer file‑system scope, inode‑based deduplication, conditional activation, plugin integration and incremental injection, enables zero‑code extensibility while managing token consumption for LLM agents.

Claude CodeConditional ActivationMarkdown
0 likes · 23 min read
Inside Claude Code Skills: How a Single Markdown File Powers a Five‑Layer Loading Mechanism
James' Growth Diary
James' Growth Diary
May 14, 2026 · Artificial Intelligence

LLM Semantic Routing Explained: Model‑Based Intent Classification and Three Keyword‑Matching Pitfalls

This article breaks down LLM semantic routing as a classifier, compares keyword, embedding, and LLM‑based routes, provides full TypeScript implementations, introduces hybrid routing for speed and accuracy, and covers production‑grade observability and dynamic configuration to avoid common pitfalls.

Hybrid RoutingLLMLangChain
0 likes · 33 min read
LLM Semantic Routing Explained: Model‑Based Intent Classification and Three Keyword‑Matching Pitfalls