# Build & Sell Claude Code Operating Systems (2+ Hour Course)
<!--
ref: @content/youtube/nate-herk/2026-05-01-build-claude-code-ai-operating-system
version: 3
updated_at: 2026-10-31T19:13:24.670Z
-->

Nate Herk (2026-05-01): Nate Herk's argument is that an AI operating system is not a tool choice but a durable layer beneath tool choices — he moved his own AIOS to Codex in about two minutes to prove it.

*Synthesized from Nate Herk on Nate Herk AI Automation, 2026-05-01.*

Nate Herk scaled an AI automation agency past $100,000 a month before selling it and now runs a 350,000-member AI community; this course walks through building a personal AI operating system inside Claude Code from empty folder to scheduled autonomy.

## Core Thesis

Nate Herk's argument is that an AI operating system is not a tool choice but a durable layer beneath tool choices — he moved his own AIOS to Codex in about two minutes to prove it. The build order is fixed and cumulative: context, then connections, then capabilities, then cadence. You cannot have capability without context or cadence without connections, and the payoff arrives only if you commit to doing the work inside the system rather than reverting to browser tabs.

## Key Insights

- **The 4 C's.** Context is what the AI knows about you, your team, tools, voice, and money. Connections are what data it can reach. Capabilities are what it can produce. Cadence is when it acts on its own with your laptop closed. The test for context: open a fresh session, ask a question, and judge whether it answers like a teammate or like a stranger who met you five seconds ago.
- **Seven tier-one domains** to map before touching Claude Code: revenue, customer, calendar, comms, tasks, meetings, and knowledge. His own mapping was School/Stripe/QuickBooks for revenue, School/YouTube for customer, Google Workspace for calendar, Google Workspace plus ClickUp plus Slack for comms, ClickUp plus Notion for tasks, Fireflies for meetings, and YouTube transcripts plus Drive plus local files for knowledge.
- **The 3 M's — mindset, method, machine.** Three habits carry the mindset: the default shift (ask how AI could do 30% of this before starting anything), the function breakdown (your role is a tree of reusable chunks; automate one at a time), and the curiosity rule (never accept output without asking why — "dark code" is code you shipped without understanding).
- **Productivity drops before it climbs.** Any change costs roughly 20% productivity up front; the AIOS upside is roughly 50%, so the net is positive but only after the dip. Learning is exponential, not linear — his framing is that you break even around day three and pull well ahead by days four and five. That dip is where people quit.
- **Prefer API endpoints over MCP servers.** An MCP server exposes every function and endpoint whether you need them or not, and multiple loaded servers consume more tokens. His pattern: have Claude research the vendor's API docs once, write a reference markdown file of all endpoints into the project, then hit endpoints directly. After running a skill, ask which endpoints it used and hardcode just those into the skill file so it never re-reads the full reference.
- **Use a service account, not your own.** He created a separate ClickUp account ("UpAI") and gave Claude that API key rather than his personal one, so permissions can be scoped — read-only where appropriate. Separate keys per agent also let you attribute spend per automation.
- **Keys go in `.env`, which is gitignored** — never pasted into chat history. Have Claude create the file with placeholders and fill them yourself.
- **Permission modes:** plan mode for building skills and brainstorming; auto mode uses an AI to judge each action's safety (slightly more tokens, stops for deletes and pushes); bypass permissions grants full autonomy and must be unlocked via the "allow dangerously skip permissions" setting.
- **Skills are SOPs for agents** — a folder with a `skill.md` containing YAML front matter (name, description) plus step-by-step instructions. Anthropic's docs advise keeping `skill.md` under 500 lines and moving detail into separate reference files.
- **Progressive context loading, three levels:** the initial search reads only the YAML front matter across all skills (roughly 100 tokens each); a matched skill loads the full `skill.md` (one to a few thousand tokens); references, scripts, and templates load only if that specific request needs them.
- **Skills can live globally** in the home directory (tilde path) rather than in `.claude/skills` inside a project, which is where he puts things like a front-end design skill that should apply everywhere.
- **The six-step skill framework:** name and trigger, one-sentence goal and output, step-by-step process, reference files, guardrail rules, then a self-improvement loop. Debug by symptom — wrong steps means edit instructions; missing tone means add reference files; repeated mistakes means add a rule; repeated searching means create a reference doc; not triggering means make the YAML description more specific; triggering too often means disable model invocation.
- **Optimize skills by watching them run.** His pulse-check skill was re-querying ClickUp lists every invocation, so he hardcoded the list IDs; searching ClickUp was still expensive, so he delegated it to a dedicated ClickUp-searcher sub-agent to keep it out of the main context window.
- **Routines (remote) versus scheduled tasks (local) versus `/loop`.** Routines run on Anthropic's cloud with your machine off, require a GitHub repo, are fully autonomous, have no local file access, and have a one-hour minimum interval. Daily included routine runs: 5 on Pro, 15 on Max, 25 on team/enterprise, with metered overage where enabled. Each cloud run gets 4 vCPUs, 16 GB RAM, and 30 GB disk.
- **Routine environments** hold your API keys as environment variables, since `.env` never reaches the repo — and prompts must say explicitly to read from the environment rather than a `.env`, which is exactly what broke his YouTube API routine on first run. Network access defaults to trusted (Anthropic-vetted domains only); ClickUp required switching to full. The risk of full: malicious content read mid-run could theoretically exfiltrate to an external server, which trusted would block.
- **Remote runs are stateless** — the clone is destroyed afterward, so browser automations relying on local cookies do not survive the move. Anything Claude cannot reach through the repo or an API will not work remotely.
- **`/loop` is different:** it creates cron jobs inside the current session via cron create / cron list / cron delete, expires after 3 days, dies when the terminal or tab closes, does not catch up on missed runs, and can go down to minute-level intervals. It suits "help me today" work — polling for an urgent email, watching a deploy, a three-day sprint check-in — while scheduled tasks handle daily, weekly, and monthly work indefinitely.
- **The GWS CLI** (open-source, from Google, explicitly not an officially supported product and pre-1.0) gives one tool covering Drive, Gmail, Calendar, Docs, Sheets, Slides, and admin, JSON-first, with over 100 built-in multi-step workflow recipes. Setup: create a Google Cloud project, configure the OAuth consent screen, create a desktop-app OAuth client ID, download the JSON to the global GWS config path, run `gws auth login`, and enable the APIs you need. Because it drives Google through bash commands rather than raw API calls, generated Docs come out properly formatted instead of raw markdown.
- **Claude cannot see what it builds programmatically.** When his Google Slides output had spacing problems, Claude explained it only knows how to build slides, not view them — so he wired in Chrome DevTools so the skill screenshots each slide and self-corrects visually.
- **The Karpathy LLM-wiki pattern** replaces RAG at personal scale: a vault with a `raw/` folder, a `wiki/` folder, an index, and a log — plain markdown, no embeddings, no vector DB, no chunking pipeline. Retrieval works by reading indexes and following links rather than similarity search, so relationships are explicit. His 36 YouTube transcripts ingested in about 14 minutes; a single article (AI 2027) produced 23 wiki pages in about 10 minutes. One X user compacted 383 scattered files and 100+ meeting transcripts this way and cut query token usage by 95%.
- **A "hot cache"** — roughly 500 characters of the most recent context — sits in his personal-brain wiki so the assistant often avoids crawling wiki pages at all. His YouTube wiki has none, because it doesn't need one.
- **Scale limits of the wiki approach:** hundreds of pages with good indexes work fine; millions of documents still call for a traditional RAG pipeline. Karpathy's own scale is around 100 articles and half a million words.
- **Two skills ship in his template to keep you unstuck:** `/audit` scores the four C's out of 100 (his day-one demo scored 54.5, with context 18/25 and connections 16/25) and `/level-up` asks five diagnostic questions — what did you do 3+ times this week, what felt manual or copy-paste, what could a smart intern have handled, what would break if 500 new members showed up Monday, and what growth lever would pay off on autopilot.
- **Start with Claude artifacts before custom dashboards.** He runs Fireflies, weekly-commitments, and QuickBooks dashboards as live artifacts that call the source on open. Build the custom unified dashboard only after an artifact proves you actually check it.
- **Deterministic workflows beat AI agents nine times out of ten.** Most business processes his agency automated barely used AI at all — and that becomes obvious once you break a process into individual chunks.
- **Success criteria** (deliberately subjective, not KPIs): your team could message the AIOS instead of you; you stop opening new tabs; knowledge leaves your head. Two of three inside the first month means it took.

## Actionable Takeaways

1. Sketch the seven tier-one domains on paper and name the specific tools under each before opening Claude Code — that map becomes your connection backlog.
2. Answer the onboarding interview in paragraphs, not sentences, and paste unedited samples of your actual writing so it learns your voice. Use voice dictation to make that feasible.
3. Wire connections one at a time, starting with the tool you check most. For each: have Claude research the API docs, write an endpoints reference markdown file into the project, then create a `.env` with placeholders you fill yourself.
4. Create a dedicated service account per tool for the agent, scoped to the permissions it actually needs, rather than handing over your own full-access key.
5. Build skills from work you just did together: walk Claude through the process manually once, then say "this is something I do daily, let's turn it into a skill" and let it interview you.
6. Watch each new skill run the first several times, then fix by symptom — hardcode stable IDs, add reference files for tone, add rules for repeated mistakes, and delegate expensive searches to a sub-agent.
7. Keep `skill.md` under 500 lines; push detail into reference files that load only when needed.
8. Put the AIOS in a private GitHub repo so it syncs across machines and can be driven by remote routines or other harnesses.
9. Test every routine with "Run now" several times before letting the schedule take over, and write routine prompts to one-shot — they cannot stop and ask you questions.
10. In routine prompts, name environment variables explicitly and tell it not to look for a `.env`.
11. Consider a separate lightweight GitHub repo per routine so a large project's CLAUDE.md and context don't get cloned and paid for on every run.
12. Ask Claude to implement Karpathy's LLM-wiki idea directly ("read this idea and implement it") rather than hunting for a repo, and point your assistant's CLAUDE.md at the vault path with instructions on when *not* to read it.
13. Run `/audit` weekly and `/level-up` whenever you feel stuck for what to automate next.
14. Ask which skills you used daily this week — those are your candidates for turning into scheduled routines.

## Notable Quotes

> "Treat AI as a mentor, not a vending machine." — Nate Herk

> "The question is never will AI do this for me. The question is to what extent can I leverage AI here?" — Nate Herk

> "Think of a failure as a good thing because it gave you more data about what not to ever do again." — Nate Herk

> "Processing markdown files for your agent is so much quicker and cheaper than actually making API calls or HTTP requests." — Nate Herk

> "Workflows, deterministic workflows, beat AI agents nine times out of 10." — Nate Herk

> "You can't scale a system if you haven't lived in it yourself." — Nate Herk

---

*You're reading a protocol on [protocol.supply](https://protocol.supply) — hosted, searchable knowledge for AI agents. Think Agent Skills, as an API: bootstrap once (`curl -sL https://api.protocol.supply/bootstrap`), search (`/search?q=…`), fetch (`/@repo/slug`).*

*Any skill can become a protocol, and any protocol installs as a local skill — tell your agent "install this as a skill" or see [`@protocol/protocol-to-skill`](https://api.protocol.supply/@protocol/protocol-to-skill).*