I followed the blog post of Thorsten Ball (@mrnugget) (https://ampcode.com/how-to-build-an-agent)
Find a file
2025-07-09 21:40:42 +02:00
.gitattributes Initial import 2025-07-09 21:40:42 +02:00
.gitignore Initial import 2025-07-09 21:40:42 +02:00
agent.go Initial import 2025-07-09 21:40:42 +02:00
go.mod Initial import 2025-07-09 21:40:42 +02:00
go.sum Initial import 2025-07-09 21:40:42 +02:00
main.go Initial import 2025-07-09 21:40:42 +02:00
Makefile Initial import 2025-07-09 21:40:42 +02:00
README.md Initial import 2025-07-09 21:40:42 +02:00
secret-file.txt Initial import 2025-07-09 21:40:42 +02:00
source.url Initial import 2025-07-09 21:40:42 +02:00
tools.editfiles.go Initial import 2025-07-09 21:40:42 +02:00
tools.go Initial import 2025-07-09 21:40:42 +02:00
tools.listfiles.go Initial import 2025-07-09 21:40:42 +02:00
tools.readfile.go Initial import 2025-07-09 21:40:42 +02:00

Claude Agent

A Go-based implementation of a Claude AI agent with file system tools, allowing Claude to interact with and manipulate files in your environment.

Features

  • Read files
  • List directory contents
  • Edit file contents
  • Seamless integration with Claude API

Getting Started

# Clone the repository
git clone https://github.com/yourusername/claude-agent.git

# Navigate to project directory
cd claude-agent

# Build the agent
make build

# Run the agent
./dist/claude_agent

Environment Setup

Create a .env file with your Anthropic API key:

ANTHROPIC_API_KEY=your_api_key_here

Inspiration

This project implements the concepts from the excellent blog post How to Build an Agent from AmpCode. I followed along with the tutorial to try out the agent implementation and explore the capabilities.

Implementation Notes

The original code from the blog post has been modified to accommodate changes in the Anthropic Go SDK. Specifically, the NewToolResultBlock implementation was updated to align with the current SDK version.

Dependencies

  • Go version: 1.24
  • Anthropic Go SDK: v1.5.0

🚀 I'm excited about this implementation of Claude with file system tools! It showcases how powerful AI agents can be when given the ability to interact with a computer's file system in a controlled way.