A command-line interface tool that lets you interact with Claude AI in your terminal, with file system access capabilities.
This project provides a simple Go-based CLI that connects to Anthropic's Claude API, allowing you to chat with Claude directly from your terminal. What makes this agent special is that it enables Claude to:
- Read files from your local filesystem
- List directory contents
- Edit text files or create new ones
- Interactive terminal-based chat with Claude (Claude 3.7 Sonnet model)
- File system tools for Claude:
read_file: Read contents of a filelist_files: List files in a directoryedit_file: Make changes to existing files or create new files
- Go 1.24.2 or later
- Anthropic API key (set as an environment variable)
- Clone this repository
- Ensure you have Go installed
- Set your Anthropic API key:
export ANTHROPIC_API_KEY=your_api_key_here - Run the application:
go run main.go
Once the application is running, you can chat with Claude directly in your terminal. Claude can access your file system through the provided tools when you ask it to:
Chat with Claude (use ctrl-c to quit)
You: Can you list the files in the current directory?
Claude: I'll list the files in the current directory for you.
[lists files]
You: Can you read the contents of main.go?
Claude: Here are the contents of main.go:
[displays file content]
The application creates a chat interface with Claude using the Anthropic Go SDK. It provides Claude with three tool definitions:
- Read files
- List directories
- Edit or create files
When Claude needs to use one of these tools, the application handles the file system operations and returns the results back to Claude.