Stop Chatting, Start Automating: How to Build Your First AI Agent on Mac using NanoClaw & Sonnet 5
You have a supercomputer on your desk (your M-Series Mac), but you are likely using AI like a typewriter. You go to ChatGPT, you type a prompt, you wait, you copy the answer, and you paste it into Word or VS Code. This is the “Chatbot Era.” It is slow, manual, and boring.
Welcome to the “Agent Era.” Imagine typing: “Organize my messy Downloads folder by file type and delete the duplicates.” And instead of giving you a list of instructions, the AI just does it. It moves the files, creates the folders, and reports back when it is done.
In a previous article we provided a beginners introduction on OpenClow, NanoClow, and Moltbook. Today, we are going to build your first Autonomous Agent on macOS using two breakout tools of February 2026:
- NanoClaw: The secure, lightweight agent framework (perfect for Mac).
- Claude Sonnet 5: The new “Fennec” model from Anthropic that is smart enough to handle your computer.

The Difference: Chatbot vs. Agent
- Chatbot (ChatGPT/Claude.ai): You ask, “How do I rename 100 files?” It gives you a Python script. You have to run it.
- Agent (NanoClaw): You ask, “Rename these 100 files.” It writes the script, executes it, checks for errors, and finishes the job.
Why NanoClaw? (The Mac User’s Choice)
You might have heard of “OpenClaw.” It is the powerful, viral agent framework. But for a beginner, it is overkill and potentially dangerous (it has full system access).
NanoClaw is the “Lite” version.
- Sandboxed: It can only touch the specific folder you allow.
- Lightweight: It runs instantly on Apple Silicon without eating 16GB of RAM.
- Transparent: You see every line of code it executes before it runs.
Step 1: The Setup (5 Minutes)
We assume you have Node.js installed. (If not, type brew install node in Terminal).
1. Download NanoClaw
Open your Terminal (Cmd + Space, type “Terminal”) and run these three commands:
mkdir MyFirstAgent
cd MyFirstAgent
git clone https://github.com/gavrielc/nanoclaw.git .
npm install 2. Get the Brain (Sonnet 5)
NanoClaw is the body; it needs a brain. The best brain for agents right now is Claude Sonnet 5 (released Feb 3, 2026).
- Go to
console.anthropic.com. - Generate a new API Key.
- In your
MyFirstAgentfolder, rename the file.env.exampleto.env. - Paste your key inside:Bash
ANTHROPIC_API_KEY=sk-ant-api03...your_key... MODEL=claude-3-5-sonnet-20260203
Step 2: Your First Automation (“The Sandbox”)
CRITICAL SAFETY WARNING: Never run an agent on your root folder (/) or your entire Desktop. Always create a “Playground” folder first.
- Create a folder named “Playground” inside your
MyFirstAgentdirectory. - Put some messy files in there (a few screenshots, a random PDF, a text file).
- Start the Agent with this command:
npm start -- --dir ./Playground You will see a prompt: > NanoClaw is listening...
Step 3: The Magic (Real-World Examples)
Now, let’s stop chatting and start automating. Type these commands into NanoClaw and watch it work.
Mission 1: The Organizer
Prompt: “Look at the files in this folder. Create subfolders named ‘Images’, ‘Documents’, and ‘Code’. Move the files into the correct folders based on their extension.”
What happens:
- NanoClaw reads the file list.
- It writes a script (usually in Python or Shell) to move the files.
- It asks for permission (Safety First!).
- You press “Y” (Yes).
- Boom. Your folder is organized instantly.
Mission 2: The Researcher
Prompt: “Research the latest rumors about the iPhone 17 Air from the last 3 days. Summarize them into a markdown file called ‘iPhone_Rumors.md’.”
What happens:
- NanoClaw uses its web-browsing tool to search Google.
- It reads the top 3-4 articles.
- It synthesizes the info.
- It creates the
.mdfile in your Playground folder.
Mission 3: The Coder
Prompt: “Create a simple HTML website that displays the current price of Bitcoin. Save it as index.html.”
What happens:
- It writes the HTML/JS code.
- It saves the file.
- You can now double-click
index.htmland see a working crypto tracker.
Troubleshooting & Tips
- The Loop: If the Agent gets stuck in a loop trying to fix a bug, press
Ctrl + Cto kill it. - The Cost: Sonnet 5 is cheap, but not free. A complex task might cost $0.01 – $0.05. Monitor your usage in the Anthropic Console.
- The “Context Window”: NanoClaw remembers your previous commands in the session. You can say, “Now change the background color of that website to blue,” and it knows which website you mean.
Conclusion
Once you successfully run your first NanoClaw command, you will never want to go back to basic ChatGPT.
You are no longer just a user; you are a Manager. You give the orders; the Agent does the work.
Ready to try it? Download NanoClaw and let us know: What is the first boring task you are going to automate?
2 thoughts on “Stop Chatting, Start Automating: How to Build Your First AI Agent on Mac using NanoClaw & Sonnet 5”