Set Up a Local AI Agent on macOS

Install OpenClaw, connect Anthropic Claude, and run a local AI agent on your Mac.

Introduction

30 Second Summary

Imagine having a personal assistant on your computer that you can talk to from the terminal or a browser, teach new tricks, and even schedule to do things while you're away. That's exactly what a local AI agent can do for you.

In this project, you will install and configure OpenClaw, an open-source AI agent framework, on your Mac. You'll connect it to Anthropic Claude, chat with your agent from the terminal and a web dashboard, and extend it by installing a community skill.

What You'll Build

A fully functional local AI agent powered by Claude, running entirely on your Mac with a gateway daemon, a browser-based dashboard, and an extensible skills system.

By the end of this project, you'll have:

  • A running OpenClaw gateway on your Mac, configured with your Anthropic API key through the onboarding wizard.
  • Experience chatting with your agent through both the Control UI dashboard in your browser and the CLI chat in your terminal.
  • A community skill installed from ClawHub that adds new capabilities to your agent.
  • Secret Mission: set up a recurring scheduled task so your agent does something useful on autopilot.

Are there any prerequisites?

You'll need Node.js 22.14 or higher installed on your Mac, along with an Anthropic API key. The project costs roughly $0.05 to $0.50 in API usage depending on how much you chat with the agent.

Before We Start

Before We Start...

Install OpenClaw

AI agents can do more than answer questions. They can run tools, search the web, and automate tasks on your behalf.

OpenClaw is an open-source framework that runs an AI agent locally on your Mac. In this step, you'll install the OpenClaw CLI, connect it to Anthropic Claude, and start the gateway daemon that keeps your agent running in the background.

In this step, get ready to:
  • Install the OpenClaw CLI using the official install script.
  • Configure Anthropic Claude as your model provider through the onboarding wizard.
  • Verify the gateway daemon is running and healthy.
Run the OpenClaw installer

OpenClaw provides an official install script that downloads the correct binary for your Mac and adds it to your system PATH. This works for both Intel and Apple Silicon machines.

  • Download and install the OpenClaw CLI by running this command:
curl -fsSL https://openclaw.ai/install.sh | bash

What does this command do?

The curl command downloads the install script from OpenClaw's website. The | bash part runs the script immediately.

The script detects your system architecture (Intel or Apple Silicon), downloads the matching OpenClaw binary, and places it in your PATH so you can run openclaw from any terminal window.

  • Confirm the installation succeeded by checking the version:
openclaw --version

You should see a version number printed in your terminal.

Command not found?

If you see a macOS Gatekeeper warning or a "cannot be opened" message, run this command to allow the binary:

xattr -d com.apple.quarantine $(which openclaw)

If your terminal says command not found: openclaw, your PATH may not include the directory where OpenClaw was installed. On Apple Silicon Macs, make sure /opt/homebrew/bin/ is in your PATH. Try opening a new terminal window and running the version check again.

Still stuck? Help me troubleshoot my OpenClaw installation on macOS.

Run the onboarding wizard

OpenClaw needs two things before your agent can work: a connection to an AI model and a background process called a gateway daemon. The onboarding wizard sets up both in one go.

  • The wizard is interactive. It will prompt you to choose a model provider, enter your API key, and configure the gateway.
  • Start the onboarding wizard by running this command:
openclaw onboard --install-daemon
  • When the wizard asks you to choose a model provider, select Anthropic.
  • When prompted for your API key, paste your Anthropic API key.
  • Accept the default options for any remaining prompts.

Once the wizard finishes, you should see a confirmation message that the gateway daemon has been configured and started.

What did the wizard just configure?

The wizard created a config file at ~/.openclaw/openclaw.json. This file stores your Anthropic API key and your gateway settings.

The --install-daemon flag told OpenClaw to set up the gateway as a background process. This means your agent stays available even when you close the terminal window.

Wizard failed or API key rejected?

Double check that your Anthropic API key starts with sk-ant- and that you copied the full key without any extra spaces.

If the wizard exits with an error about Node.js, make sure you have Node 22.14 or higher installed. Check your version by running:

node --version

Still stuck? Help me fix the OpenClaw onboarding wizard.

Verify the gateway is running

The gateway daemon is the engine behind your agent. It stays running in the background, ready to process your messages and execute tools.

  • Check that the gateway is running by running this command:
openclaw gateway status

You should see output showing the gateway is active and listening on port 18789.

  • Run the health check to confirm your entire setup is working correctly:
openclaw doctor

You should see all checks passing with no errors.

What does openclaw doctor check?

Think of openclaw doctor as a system-wide checkup for your agent. It tests your configuration, verifies your API key can reach Anthropic's servers, and confirms the gateway daemon is responsive.

If something breaks later in the project, this is the first command to run.

Gateway not running or health check failing?

If the gateway status shows it is not running, try re-running the onboarding wizard to reconfigure and restart it:

openclaw onboard --install-daemon

If the health check reports a connectivity error, make sure your Mac has an active internet connection. The check needs to reach Anthropic's API to verify your key.

If another process is already using port 18789, the gateway will fail to start. Check for port conflicts by running:

lsof -i :18789

Still stuck? Help me troubleshoot my OpenClaw gateway.

Your agent is installed, configured, and running. Next up, you'll have your first conversation with it.

Chat with Your Agent

Your OpenClaw gateway is up and running. Now it's time for the best part: actually talking to your agent.

OpenClaw gives you two ways to interact: a browser-based dashboard and the CLI. You'll try both in this step.

In this step, get ready to:
  • Open the Control UI dashboard and send your first message.
  • Test interactive and one-shot chat in the CLI.
  • Check your agent's status and logs.
Open the Control UI dashboard

The Control UI is OpenClaw's browser-based dashboard. It gives you a visual chat interface for talking with your agent.

  • Launch the Control UI by running this command:
openclaw dashboard

Your default browser opens with the OpenClaw Control UI dashboard.

  • Type What can you help me with? in the chat input.
  • Press Enter to send your message.

You should see a response from Claude appear in the chat window within a few seconds.

Dashboard not loading?

Make sure your gateway is still running. Open a separate terminal window and run openclaw gateway status to check.

If the browser didn't open automatically, navigate to http://localhost:18789 manually.

Help me debug my OpenClaw dashboard

Test the CLI chat modes

The terminal is another way to chat with your agent. Let's start with interactive mode.

  • Start an interactive chat session by running this command:
openclaw chat

A chat interface appears directly in your terminal, ready for input.

  • Enter Tell me a fun fact about space as your first message.
  • Enter another message like Why is the sky blue? to continue the conversation.
  • Press Ctrl+C to exit the interactive session.

That was interactive mode, where context builds across messages. Now let's try one-shot mode.

  • Send a one-shot message to your agent by running this command:
openclaw chat "What is the capital of France?"

The agent responds directly in your terminal, then returns you to the command prompt. One-shot mode is perfect for quick, standalone questions.

Not getting a response?

Run openclaw doctor to check your configuration and connectivity. This catches common issues like an invalid API key or a stopped gateway.

If the gateway stopped, restart it with openclaw gateway status to confirm, then re-run the onboarding wizard if needed.

Help me troubleshoot my OpenClaw chat

Check agent status and logs

Knowing how to monitor your agent helps you spot issues fast. OpenClaw gives you two commands for this.

  • Check your agent's overall status by running:
openclaw status

You should see details about your gateway, model provider, and any active sessions.

  • Stream real-time logs from your agent by running:
openclaw logs --follow

You should see log entries appearing as the gateway processes events.

  • Press Ctrl+C to stop the log stream.

Logs are your debugging superpower

If your agent ever behaves unexpectedly, run openclaw logs --follow in a separate terminal window while chatting. You'll see requests and responses flowing through the gateway in real time.

You've explored both ways to talk to your agent. Next up, you'll expand what your agent can do by installing a skill from ClawHub.

Install a Skill from ClawHub

You've chatted with your agent through the dashboard and the terminal. Now it's time to make it more capable.

OpenClaw has a skills system that extends what your agent can do. Skills are community-built add-ons hosted on ClawHub, OpenClaw's skill marketplace. In this step, you'll browse what's available and install one into your agent.

In this step, get ready to:
  • Explore the skills already bundled with your agent and search ClawHub for new ones.
  • Install a skill from ClawHub into your workspace.
  • Test the new skill in a chat session to confirm it works.
Explore bundled and available skills

Your agent already comes with a set of bundled skills. Before adding anything new, take a look at what's already loaded.

  • List the skills currently available to your agent by running this command:
openclaw skills list

You should see a table of skill names along with short descriptions. These are the skills your agent can already use.

What is a skill?

A skill is a self-contained add-on that gives your agent new abilities. Each skill is a folder containing a SKILL.md file that describes what the skill does and how to use it.

Think of skills like apps for your agent. Bundled skills come pre-installed. ClawHub skills are ones the community has published for anyone to grab.

Now let's see what the community has built. ClawHub is the public marketplace where developers publish skills for anyone to install.

  • Search ClawHub for skills by running this command:
openclaw skills search "productivity"

What does this command do?

This searches ClawHub for any skills matching the keyword you provide. You can swap "productivity" for any term that interests you, like "writing" or "code".

You should see a list of matching skills with their slugs and descriptions. Pick one that sounds useful. You'll install it in the next substep.

Get more details before installing

If you want to learn more about a skill before committing, run openclaw skills info <name> to see its full description and usage details.

No results showing up?

Try a broader search term. Single words like "summary" or "web" tend to return more results than specific multi-word phrases.

If you're getting a connection error instead, make sure your internet connection is active and that your gateway is still running with openclaw gateway status.

Why can't I search ClawHub for skills?

Install a skill

Now that you've found a skill you want, it's time to add it to your agent's workspace.

  • Install your chosen skill by running this command:
openclaw skills install [[SKILL_SLUG="the skill slug from your search results"]]

What does this command do?

This downloads the skill from ClawHub and adds it to your local workspace. The slug is the short identifier you saw in the search results, like daily-digest or meeting-notes.

  • Confirm the skill was installed by running:
openclaw skills list

You should see your newly installed skill in the list alongside the bundled skills.

Skill not appearing in the list?

Double check that the slug you used matches exactly what appeared in the search results. Slugs are case-sensitive.

If you see a "not found" error, run your search again and copy the slug directly from the output.

Why isn't my skill installing from ClawHub?

Test the installed skill

Skills are loaded when a new session starts. To use the skill you just installed, you need to open a fresh chat session.

  • Start a new interactive chat session by running:
openclaw chat
  • Send a message that exercises the skill you installed. For example, if you installed a summarization skill, paste a paragraph of text and ask the agent to summarize it.
  • Look at the agent's response. It should reflect the skill's described capabilities, not just a generic answer.

If the response clearly uses the skill's functionality, your installation is working. You've successfully extended your agent with a community-built skill.

Agent not using the new skill?

Make sure you started a new chat session after installing the skill. Skills are loaded at session start, so an existing session won't pick up new additions.

Try being more explicit in your prompt. Mention what you want the agent to do in terms that match the skill's description.

Why isn't my agent using the skill I installed?

Your agent is now running with extra capabilities from the community. Next up is the Secret Mission, where you'll teach your agent to do something useful on autopilot with scheduled tasks.

Secret mission

Schedule a Recurring Task with Cron

Your agent doesn't have to wait for you to type. Set up a recurring scheduled task with OpenClaw's cron scheduler so your agent does useful work on autopilot.

Before you go

Clean Up Your Resources

Decide whether to keep your resources running, pause them to come back later, or delete them entirely. The OpenClaw gateway runs locally on your Mac, so there are no hosting costs. However, every message you send to your agent uses your Anthropic API key, which incurs a small per-token charge.

Cost warning

Your Anthropic API key is billed per token used. Typical personal usage costs under $2/month. If you leave the gateway running but don't send any messages, no tokens are consumed and no charges are incurred.

If you set up a cron job in the Secret Mission, each scheduled run sends a prompt and consumes tokens automatically. Pause or remove cron jobs if you want to avoid unattended API charges.

Resources you used:

  • OpenClaw CLI installed on your Mac.
  • OpenClaw gateway daemon running in the background.
  • Anthropic API key stored in ~/.openclaw/openclaw.json.
  • Skills installed from ClawHub into your workspace.
  • Cron jobs (if you completed the Secret Mission).

Keep everything running

No action needed. Choose this if you plan to keep chatting with your agent or experimenting with new skills.

  • The gateway daemon stays running in the background and restarts automatically when your Mac reboots.
  • Your Anthropic API key remains configured and ready to use.
  • Any cron jobs you created will continue running on schedule. Keep an eye on your Anthropic usage dashboard if you have active cron jobs.

Pause - I'll come back to this later

Stop the gateway daemon to free up system resources and prevent any automated API usage. Your configuration and installed skills stay on disk.

  • Remove any active cron jobs to stop automated API calls. List them with openclaw cron list and remove each one with openclaw cron remove <job-id>.
  • Stop the gateway daemon by running openclaw gateway stop in your terminal.
  • When you are ready to come back, run openclaw gateway start to restart the daemon. Your configuration and skills will still be there.

Delete - I don't want to use this again

Remove all OpenClaw resources from your Mac. This deletes the CLI, gateway, configuration, and installed skills.

  • Stop the gateway daemon by running openclaw gateway stop in your terminal.
  • Remove the OpenClaw configuration directory by running rm -rf ~/.openclaw in your terminal. This deletes your config, installed skills, cron jobs, and session history.
  • Uninstall the OpenClaw CLI by running npm uninstall -g openclaw in your terminal.
  • Your Anthropic API key still exists in your Anthropic account. If you want to revoke it, visit the Anthropic console and delete the key from your API keys page.

Mission accomplished

That's a Wrap!

Nice work! You now have a personal AI agent running locally on your Mac, powered by Anthropic Claude.

You've learned how to:

  • Installed OpenClaw, configured Claude as your model provider through the onboarding wizard, and verified the gateway is running and healthy.
  • Chatted with your agent through both the Control UI dashboard and the CLI in interactive and one-shot modes.
  • Explored the skills system and installed a community skill from ClawHub to extend your agent's capabilities.
  • Secret Mission: Set up a recurring cron job to automate a task with your agent on autopilot.

Ready to quiz yourself?