heyweston.ai

God Mode:
Claude Code + OpenClaw

The Mac Mini M4 AI Command Center Setup Guide

From zero to autonomous AI agent in one afternoon

9Modules
~2hrsSetup
0Prior Experience Needed
01

What Is Claude Code?

The AI agent that lives in your terminal and actually does things

Not a chat box. An agent.

Claude Code is Anthropic's official CLI tool. Install it, open your terminal, type claude, and you now have an AI that can read, write, edit, and run things on your actual computer.

It DOES things

Ask it to fix a bug — it reads the file, writes the fix, runs the tests, and asks if you want a PR. Ask it to document your codebase — it reads every file and writes the docs. For real.

Key Capabilities

📖Reads your codebase
✏️Writes & edits files
⚙️Runs terminal commands
🌐Browses the web
🔌Uses MCP tools
🧠Remembers project context

Install It Now

bash
npm install -g @anthropic-ai/claude-code
claude  # Launch Claude Code

Interactive Demo — See It In Action

claude — terminal
▊ Click a prompt below to see Claude Code in action

Click a task to try it:

02

Key Concepts

Newbie survival guide — understand these before you start

🔐

Permission Modes

Claude Code asks before doing anything dangerous. "I want to run this command — approve?" You can set it to always ask, auto-approve safe things, or full auto. Start with "always ask" until you trust it.

🧠

MCP Servers — Claude's Superpowers

MCP (Model Context Protocol) lets Claude Code connect to external tools: Notion, GitHub, Google Calendar, databases, Slack, and more. You install an MCP server and Claude can now read/write to that system.

🪝

Hooks — Automated Actions

Hooks run shell commands automatically before or after Claude does things. Example: "After Claude edits any file, run the linter." Set-and-forget automation.

📋

CLAUDE.md — Project Memory

Drop a file called CLAUDE.md in any project folder. Claude reads it every session. Put your coding standards, project description, context. This is how it remembers who you are and what you're building.

markdown
# My Project
This is a Shopify store backend. Stack: Node.js, PostgreSQL.
Never use var. Always write tests. PR naming: feat/ticket-name

Slash Commands

/helpShow all available commands
/clearClear conversation (saves tokens)
/compactSummarize context to save memory
/costSee how much API this session cost
/memoryView what Claude remembers about you

Chat Claude vs Claude Code

Chat Claude (claude.ai)
  • Explains concepts
  • Drafts text and documents
  • Answers questions
  • Can't touch your files
  • Lives in the browser
vs
Claude Code (terminal)
  • Fixes actual bugs in your code
  • Reads & writes real files
  • Runs terminal commands
  • Manages your whole project
  • Lives in your machine
⚡
The Golden Rule: Claude Code does exactly what you tell it. Be specific. "Fix the authentication" is vague. "Fix the JWT token expiry bug in src/auth/middleware.js — tokens should expire in 24 hours" gets results.
03

What Is OpenClaw?

The always-on AI agent runtime that runs on your Mac Mini 24/7

A local AI agent that never sleeps

OpenClaw runs as a background service on your Mac Mini. It connects Claude to Discord, GitHub, your files, and the internet. You DM your agent and it works while you're doing other things.

Claude Code is its coding brain

When you tell OpenClaw to write code, it hands that task to Claude Code. Claude Code reads your repos, writes the fix, runs tests, and opens a PR — triggered by a single Discord message.

How It All Connects

🖥️
Mac Mini M4
Always-on, 24/7
↓
⚙️
OpenClaw Runtime
Orchestrates everything
↓
🧠
Claude API
The AI brain (Opus 4.6)
💬
Discord
🐙
GitHub
📁
Files
🌐
Internet

What Your Agent Can Do

💻Write & fix code
🔍Web research
📁Manage files
🐙Open GitHub PRs
📩Draft emails
🔔Notify when done
04

Mac Mini M4 Setup

Your always-on AI command center — hardware and accounts

Why Mac Mini M4?

🔇Completely silent
🏃M4 chip is blazing fast
🌙Always-on, never sleeps
💰No monthly server fees
🔒Your data stays local
⚡$1,399 pays for itself fast

Pre-Setup Checklist — Click to Check Off

  • Mac Mini M4 purchased, unboxed, and connected to wired Ethernet
  • External SSD attached for Time Machine backups (Samsung T7 ~$80)
  • Anthropic API account created at console.anthropic.com — add $10–20 credits
  • Discord account created + developer app set up at discord.com/developers
  • GitHub account created — dedicated "agent" account, separate from yours
  • Remote Login (SSH) enabled: System Settings → General → Sharing → Remote Login
  • Energy set to Never Sleep: System Settings → Energy → Prevent automatic sleeping

Required Accounts

05

OpenClaw Installation

Copy, paste, run. It really is this simple.

Step 1

Install Homebrew + Node 24

⚠️ Node 24 is required. Not 18. Not 20. Node 24.

bash
# Install Homebrew (macOS package manager)
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

# Install Node 24
brew install node@24 && brew link node@24
echo 'export PATH="/opt/homebrew/opt/node@24/bin:$PATH"' >> ~/.zshrc && source ~/.zshrc

# Verify
node --version  # Should show v24.x
Step 2

Install OpenClaw

bash
npm install -g openclaw@latest
openclaw --version

# Run the onboarding wizard (creates your config + installs daemon)
openclaw onboard --install-daemon

# Start the gateway
openclaw gateway --port 18789
Step 3

Configure Claude API Key

Get your API key from console.anthropic.com → API Keys → Create new key.

bash
# Add to ~/.zshrc (NEVER hardcode keys in files)
export ANTHROPIC_API_KEY="sk-ant-api03-YOUR-KEY-HERE"
source ~/.zshrc

# Verify it loaded
echo $ANTHROPIC_API_KEY
Step 4

Discord Bot Setup

  • Go to discord.com/developers → New Application → name it "OpenClaw Agent"
  • Click "Bot" in sidebar → Enable: SERVER MEMBERS INTENT, MESSAGE CONTENT INTENT, PRESENCE INTENT
  • ⚠️ MESSAGE CONTENT INTENT must be ON or the bot silently ignores all your messages
  • Copy your bot token and save it
bash
export DISCORD_BOT_TOKEN="YOUR_BOT_TOKEN_HERE"

openclaw config set discord.botToken "$DISCORD_BOT_TOKEN"
openclaw discord pair
# Approve the DM pairing code, then:
openclaw guild create --name "My Agent Workspace"
Step 5

GitHub Setup

bash
brew install gh
gh auth login  # Follow the prompts

Discord Channels to Create

#coding
Coding tasks, Claude Code sessions, code output
#research
Research queries, competitive analysis, web search
#tasks
General task queue, status updates, completions
#pr-review
PR review requests and automated review comments
DMs
Personal conversations, quick queries, sensitive work
06

God Mode Activation

Connect Claude Code as OpenClaw's coding brain

⚡
This is the power move. OpenClaw handles the 24/7 runtime and Discord interface. Claude Code handles all the actual coding. Together: an autonomous coding agent you can message from anywhere on Earth.

Install the Coding Skill

bash
# Install Claude Code (if not already done)
npm install -g @anthropic-ai/claude-code

# Install the coding-agent skill in OpenClaw
openclaw skills install coding-agent

# Verify
openclaw skills list | grep coding

Full Config (~/.openclaw/openclaw.json)

json
{
  "agentModel": "anthropic/claude-opus-4-6",
  "agentName": "MyAgent",
  "llm": {
    "provider": "anthropic",
    "apiKey": "${ANTHROPIC_API_KEY}"
  },
  "channels": {
    "discord": {
      "botToken": "${DISCORD_BOT_TOKEN}",
      "requireMention": false,
      "channels": {
        "coding": "CHANNEL_ID_CODING",
        "research": "CHANNEL_ID_RESEARCH",
        "tasks": "CHANNEL_ID_TASKS"
      }
    }
  },
  "skills": ["coding-agent"],
  "memory": { "enabled": true, "maxItems": 500 },
  "logging": { "level": "info", "file": "~/Library/Logs/openclaw.log" }
}

Pick the Right Model

Coding Agent
claude-opus-4-6
Serious coding & autonomous dev tasks
$15/$75 per M tokens
Best Default
claude-sonnet-4-6
Speed + capability balance
$3/$15 per M tokens
Discord Chatbot
claude-haiku-4-5
Fast, cheap, simple tasks
$0.80/$4 per M tokens

God Mode Commands

🐛
bash
openclaw task "Fix the login bug in auth.js"

Claude Code reads your code, finds the bug, writes the fix, creates a PR — you just review and merge.

⚡
bash
openclaw task "Fix issues #12, #15, #18 in parallel"

Multiple Claude Code instances work simultaneously on separate branches. Massive speed boost.

🔍
bash
openclaw skills run pr-review --repo myorg/myrepo --pr 42

Automatically reviews pull requests, leaves inline comments, flags issues. Like having a senior dev on call.

🌙
bash
openclaw task "Refactor the data pipeline" --notify-on-complete

Runs overnight while you sleep. Pings your Discord when done. Wake up to a finished refactor.

07

The Trust Ladder

Don't skip this. Earn trust incrementally — it's for your own safety.

Your agent is powerful. That means if it's confused or misconfigured, it can do real damage. The Trust Ladder exists to catch mistakes before they become disasters. Follow it. Do not skip weeks.

Click each week to expand →

Week 1
Minimal Trust
▼
Week 2
Basic Trust
▼
Week 3
Standard Trust
▼
Advanced
Full Trust
▼
08

First Week Survival Kit

Practical habits that separate power users from frustrated ones

01

Front-Load Your Context on Day 1

In your very first conversation, tell your agent everything. Don't drip-feed it over weeks.

text
I'm [your name]. I work on [projects].
My communication style is [direct/detailed/casual].
My current main project is [X], the goal is [Y].
Tools I use: [list them].
Here's what I need help with most: [Z].
02

Monthly State of the Union

Ask your agent "What do you know about me and my projects?" once a month. Correct any drift before it compounds. Agent memory can get stale — catch it early.

03

Use Consistent Project Names

The agent treats "vending machine business" and "VM project" as two completely different things in memory. Pick one name per project and always use it. Same with people's names.

04

Separate Channels by Context Type

Don't mix coding and personal tasks in the same channel. The agent blends context. Use #coding for code, #research for research, DMs for personal. Context doesn't bleed across channels.

05

Session Opener for Ongoing Projects

Before resuming any ongoing project, always start with:

text
"What do you remember about [Project Name]?"
09

Quick Reference Card

Everything you need, at a glance. Bookmark this page.

Daemon Control

openclaw startStart daemon
openclaw stopStop daemon
openclaw restartStop + start
openclaw statusRunning state + channels
openclaw healthSystem health check
openclaw logs --tail 50Last 50 log lines

Config

openclaw config get [key]Read a config value
openclaw config set [key] [val]Write a config value
openclaw config validateValidate openclaw.json syntax

Skills

openclaw skills listList installed skills
openclaw skills install [name]Install from catalog
openclaw skills updateSync from GitHub

Tasks & Discord

openclaw task "text"Send a task to the agent
openclaw discord pairPair Discord bot
openclaw guild create --name "X"Create Discord workspace
openclaw onboardRe-run onboarding wizard

🚨 Something Broke? Run These in Order

bash
openclaw health              # Overall health check
openclaw status              # Running services + active channels
openclaw logs --tail 50      # Last 50 lines of logs
openclaw config validate     # Check openclaw.json syntax
openclaw gateway status      # Gateway port and connections

Common Errors

❌ Discord bot silent
→ Discord Dev Portal → Bot → Enable MESSAGE_CONTENT_INTENT → re-save
❌ API key invalid
→ echo $ANTHROPIC_API_KEY — if empty, run: source ~/.zshrc
❌ Node version wrong
→ brew install node@24 && brew link node@24 --force --overwrite
❌ High API costs
→ Switch low-priority tasks from Opus to claude-haiku-4-5
❌ GitHub auth fails
→ gh auth refresh OR gh auth login
❌ Gateway not starting
→ lsof -i :18789 → kill that process OR change port in config