Mathspp iconMathsppJul 6, 2026 ~1 min source read

Rodrigo Girão Serrão: Write a coding agent from first principles: better tools

In this tutorial, you'll take your agent and improve its capabilities by implementing the text edit and bash command tools that Anthropic provides. In the previous tutorial you implemented a coding agent that has a few tools that it can use to read, write, and execute, code.

Rodrigo Girão Serrão: Write a coding agent from first principles: better tools

Share this story

Send the public story page.

Useful takeaways from this story.

In this tutorial, you'll take your agent and improve its capabilities by implementing the text edit and bash command tools that Anthropic provides.

As it turns out, these tools are so universally useful that Anthropic trained its models on specific schema definitions for these tools.

In the previous tutorial you implemented a coding agent that has a few tools that it can use to read, write, and execute, code.

Building the complete brief

The page is ready to read now. The fuller skim-friendly version will appear here automatically.

The useful part

In this tutorial, you'll take your agent and improve its capabilities by implementing the text edit and bash command tools that Anthropic provides. In the previous tutorial you implemented a coding agent that has a few tools that it can use to read, write, and execute, code. The tool "bash" can be used to execute arbitrary commands and the tools "read", "write", "replace", and "insert", can be used to edit files.

How it works

  • As it turns out, these tools are so universally useful that Anthropic trained its models on specific schema definitions for these tools.
  • The tools still run on the client side, so you'll still get tool use blocks in the API responses, but you don't have to define the schema for the tool.
  • You just specify the tools by their Anthropic types and names, and the LLMs will happily request tool uses.
  • Anthropic trains their models on a number of useful tools but you'll focus your attention on two tools that emulate the functionality you already have:

Details worth keeping

Improve the capabilities of your agent by providing it with better tools.

Keep reading in the app

Open the app view to save this story, compare related coverage, and continue from the same source.

Open in app