Craft

Prompts, evaluation, reliability and the day-to-day practice of building agents.

Craft · 7 min read

Rate limits in agent loops: read the headers before the 429 shows up

Claude, OpenAI and Gemini all meter requests and tokens per minute, but they count different tokens, report them in different formats and throw different 429s. Here's how an agent loop should pace itself on each one.

Read article →
Craft · 8 min read

Tool choice for agents: when to force a tool call, when to forbid one, and when to leave it alone

Claude, OpenAI and Gemini all let you force, restrict or block tool calls, but the option names, the thinking trade-offs and the caching side effects differ. Here's how tool_choice actually behaves on each and where it fits in an agent loop.

Read article →
Craft · 8 min read

Too many tools: tool search and deferred loading for agents

Once an agent has dozens or hundreds of tools, sending every schema on every turn costs tokens and makes the model pick worse. Here's how Anthropic's and OpenAI's tool search work, where they differ, and the mistakes that get you a 400.

Read article →
Craft · 8 min read

Stop reasons are your agent loop's control flow: handling every way a model turn ends

Every model response says why it stopped, and that one field decides whether your loop runs a tool, continues, retries or gives up. Here is what Anthropic, OpenAI and Gemini actually return, and a small dispatcher that handles all of it.

Read article →
Craft · 8 min read

When to split an agent into subagents, and when one loop is better

Multi-agent setups can find answers a single agent misses, but they burn far more tokens and can contradict themselves. Here is how the orchestrator-worker pattern, handoffs and agents-as-tools actually differ, and a practical test for whether your task should be split at all.

Read article →
Craft · 13 min read

Sandboxing agents that run code: isolation, network policy, and what to let back into context

When an agent writes and runs code, the sandbox is the real security boundary. Here is how hosted containers and self-hosted isolate APIs actually work as of November 2026, and the mistakes that leak files, tokens, or untrusted output.

Read article →
Craft · 8 min read

Agent Skills: how to write a SKILL.md your agent actually loads

Agent Skills package instructions, scripts and reference files so an agent only pulls them in when a task calls for them. Here is how the loading works, how to write a description that triggers, and the portability and security traps to check before you ship one.

Read article →
Craft · 10 min read

Agent memory design: what to remember across sessions, where to keep it, and how to stop it rotting

How Claude's memory tool, OpenAI Agents SDK sessions and LangGraph stores split short-term and long-term memory, and the design decisions they leave to you: what to write, when to write it, who can read it, and when to forget.

Read article →
Craft · 9 min read

Prompt injection in tool results: designing agents that stay safe when they read untrusted text

Filters and stern system prompts don't stop indirect prompt injection. Here is how to reason about the risk with the lethal trifecta, and the design patterns that actually limit what injected text can do.

Read article →
Craft · 9 min read

Evaluating agent tool calls: outcomes, paths and consistency

How to build evals for a tool-using agent: grade outcomes, check only required tool calls, track pass^k, and catch grader bugs.

Read article →
Craft · 9 min read

Approval gates for agent tool calls: where to put the human in the loop

How OpenAI's Agents SDK, the Claude Agent SDK, LangGraph and MCP let an agent pause for a person before risky tool calls, and how to choose which calls need a gate, what the reviewer sees, and how to resume safely.

Read article →
Craft · 9 min read

Handling tool errors in agent loops: retries, idempotency, and knowing when to stop

A practical craft guide to the failures that happen between an agent and its tools, how to report them so the model can recover, when your code should retry instead of the model, and how to keep retries from doing damage.

Read article →
Craft · 7 min read

Writing tool descriptions and schemas that agents use reliably

A practical craft guide to naming tools, writing descriptions, and designing JSON schemas so language models call the right function with the right arguments.

Read article →