
I Stopped Rewriting the Same AI Agent Code. Here's What I Built Instead.
I Got Tired of Rewriting the Same AI Agent Scaffolding - So I Built a Proper Foundation Every time I started a new AI agent project, I wrote the same code. Tool use loop. Memory persistence. Retry logic. Structured logging. Over and over. Copy-pasting from my last project. Tweaking variable names. Hoping I didn't introduce a bug in the process. Sound familiar? I finally stopped doing that. I packaged everything into a clean TypeScript boilerplate — and in this article I'm going to show you exactly how it works, so you can either use it or build your own. The Problem With AI Agent Tutorials Most tutorials show you this: const response = await anthropic . messages . create ({ model : " claude-sonnet-4-6 " , max_tokens : 1024 , messages : [{ role : " user " , content : " Hello! " }], }); console . log ( response . content ); That's fine for a demo. But the moment you try to do anything real, you hit walls: What about tool calls? Claude doesn't just return text — it returns tool_use blocks
Continue reading on Dev.to Webdev
Opens in a new tab

