The simplest possible agent: LLM + Tools + Loop
Start with an agent that can only READ files. Use it to teach yourself how to add WRITE. Then use READ+WRITE to add SHELL. This mimics how real development tools evolve!
- Install uv:
curl -LsSf https://astral.sh/uv/install.sh | sh - Create
.envfile:echo "ANTHROPIC_API_KEY=your-api-key-here" > .env
- Paste in your actual Anthropic API key
- Run:
uv run agent.py
uv run agent.pyYour first conversation:
> Can you read agent.py and tell me how to add a write tool?
[Agent reads the file, sees the pattern, and gives you exact code to add]
- The agent gives you code for a write function
- You manually paste this into agent.py
- Update the tools list:
tools=[read, write] - Restart the agent
Now with both read and write:
> Can you read your own file (agent.py) and add a shell tool to yourself?
[Agent reads itself, generates shell function, writes it back to the file]
You now have a fully functional agent that you bootstrapped from almost nothing!
- Understand how agents work by building one piece by piece
- Experience the limitations before solving them
- See how tools enable other tools
- Learn the agent's code patterns by using the agent itself
Once you have all three tools:
- Build something that is actually cool using it... maybe with the GenAI tooling?
- Use it as a CLI tool
You're using an AI agent to help you build an AI agent. This is how development works - we use tools to build better tools!
