This project uses devenv for reproducible development environments with Nix.
devenv shell- Enter the development shelldevenv test- Run tests (currently runs git version check)go build- Build Go projectgo run main.go- Run the chat applicationgo test ./...- Run all Go testsgo test <package>- Run tests for specific packagego mod tidy- Download dependencieshello- Custom script that greets from the development environment
go run chat.go- Simple chat interface with Claudego run read.go- Chat with file reading capabilitiesgo run list_files.go- Chat with file listing and reading capabilitiesgo run bash_tool.go- Chat with file operations and bash command executiongo run edit_tool.go- Chat with full file operations (read, list, edit, bash)
All Go applications support a --verbose flag for detailed execution logging:
go run chat.go --verbose- Enable verbose logging for debugginggo run read.go --verbose- See detailed tool execution and API callsgo run edit_tool.go --verbose- Debug file operations and tool usage
- Environment: Nix-based development environment using devenv
- Shell: Includes Git, Go toolchain, and custom greeting script
- Structure: Chat application with terminal interface to Claude via Anthropic API
- Follow Nix conventions for devenv.nix configuration
- Use standard Git workflows
- Development environment configuration should be reproducible
When debugging issues with the chat applications, use the --verbose flag to get detailed execution logs:
go run edit_tool.go --verboseWhat verbose logging shows:
- API calls to Claude (model, timing, success/failure)
- Tool execution details (which tools are called, input parameters, results)
- File operations (reading, writing, listing files with sizes/counts)
- Bash command execution (commands run, output, errors)
- Conversation flow (message processing, content blocks)
- Error details with stack traces
Log output locations:
- Verbose mode: Detailed logs go to stderr with timestamps and file locations
- Normal mode: Only essential output goes to stdout
Common troubleshooting scenarios:
- API failures: Check verbose logs for authentication errors or rate limits
- Tool failures: See exactly which tool failed and why (file not found, permission errors)
- Unexpected responses: View full conversation flow and Claude's reasoning
- Performance issues: See API call timing and response sizes
- Ensure
ANTHROPIC_API_KEYenvironment variable is set - Run
devenv shellto ensure proper development environment - Use
go mod tidyto ensure dependencies are installed
- Requires ANTHROPIC_API_KEY environment variable to be set
- Chat application provides a simple terminal interface to Claude
- Use ctrl-c to quit the chat session