How to Use Claude Code to Run a Business, Not Just Write Code

If you have installed Claude Code and watched it build a small app, you have seen about a tenth of what it is for. Most guides stop at “type claude and ask it for an app.” This one hands you the setup I actually run eight products on: the install, a CLAUDE.md you can copy, free skills you can add with one command, the connectors I use and the exact page to get each one, my real job schedule, and the runner script that stops unattended jobs from failing quietly.

You use Claude Code by describing a goal in plain English, making it plan before it edits, and checking what it did. Then you teach it your rules once, give it skills and connectors so it can reach your real work, and move your recurring tasks onto a schedule. The highest-leverage way to use Claude Code is unattended scheduled jobs, not interactive coding.

Set it up and learn the loop in ten minutes

  1. Install it. On macOS or Linux run curl -fsSL https://claude.ai/install.sh | bash. On Windows PowerShell run irm https://claude.ai/install.ps1 | iex. Homebrew, WinGet and npm also work; every option is on Anthropic’s setup page.
  2. Sign in. Run claude inside a project folder and it opens a browser to log in. You need a Pro, Max, Team or Enterprise plan, or Console API credits. The free claude.ai plan does not include Claude Code.
  3. Run /init. It reads the project and writes a starter CLAUDE.md with the build commands and conventions it found. You will replace most of it with your own rules below.
  4. Describe the outcome, not the steps. Say what done looks like and how you will check it.
  5. Plan first. Press Shift+Tab until the mode reads plan, or type /plan. It writes out what it intends to change before it touches a file, so you catch a bad approach before it happens.
  6. Verify. Read the diff, run the app, or have it run the tests. Never merge on trust.

A prompt shaped the way I write them, which you can reuse with your own sites:

Pull last month's Search Console data for these three sites and list the
10 posts that lost the most clicks, with the query that lost the most for
each one. Plan first. Do not edit any file. End with the 3 posts you would
fix first and why.

No code involved: a clear input, a checkable output, and a stated finish line.

Three commands carry most of the day. /clear starts a fresh conversation so an unrelated task does not drag stale context behind it. /compact summarizes a long session to free up room. @ followed by a file path points it at exactly the files that matter, which beats letting it wander the whole repo. The full list is in the commands reference.

Learn it in the terminal, even if you start in the VS Code or JetBrains extension. Every unattended job I run lives in the CLI, and it is the only surface that scripts cleanly. If you want the editor-first alternative, I compared the two in Cursor vs Claude Code after paying for both.

Teach it once: a CLAUDE.md you can copy, then skills

CLAUDE.md is a plain markdown file that Claude Code reads at the start of every session. Put project rules in ./CLAUDE.md in the repo and personal rules that apply everywhere in ~/.claude/CLAUDE.md. The old # shortcut for adding a memory is gone; now you just tell it “add this to CLAUDE.md,” or open the file with /memory. Anthropic’s memory docs cover the load order.

This is a trimmed copy of the global file every session of mine starts with. Take it and swap in your own tools. The secrets line assumes an injector like the one described further down, so delete it if you do not run one yet:

# How I work

- Be concise. Lead with the answer or the recommendation. Skip option
  surveys and step-by-step walkthroughs unless I ask for them.
- Before writing code that reads a database or an API, confirm the exact
  field names exist in the collection or the response. Never guess a field.
- Hand file exploration and long reads to a subagent, so this conversation
  keeps its context.
- Never read or print the secrets file. Run commands through the injector:
  secret-env <product> -- <command>
- Before any substantive task, check my notes for decisions and opinions I
  already have on the subject.
- Never use em dashes in anything you write. Use periods, commas or colons.

If you want a second opinion on your own file, paste it into the free CLAUDE.md analyzer I built. It scores the file out of 100 and suggests fixes line by line, and it runs in your browser, so nothing gets uploaded.

Skills are the next layer. A skill is a folder with a SKILL.md file of instructions that Claude loads only when a task matches its description, or when you call it by name with /skill-name. Personal skills live in ~/.claude/skills/<name>/SKILL.md and project skills live in .claude/skills/. The skills docs have the format.

You do not have to write your first ones from scratch. I publish 23 free skills on locul.ai/skills, and the whole directory is also a Claude Code plugin marketplace. Two commands inside Claude Code:

/plugin marketplace add mkhalid1/locul-skills
/plugin install locul-seo@locul

Swap locul-seo for locul-linkedin, locul-paid-ads, locul-resume or locul-growth-launch, or run /plugin and browse. A few worth starting with:

Every skill page also carries the raw SKILL.md, so you can copy a single file instead of installing anything. The source is public on GitHub.

Subagents are the third piece. I keep one agent file per blog in ~/.claude/agents/, each holding that site’s voice, rules and IDs, so a publishing run never mixes up two sites. The subagents docs show the file format, and nine of my general-purpose ones, rewritten to work on any machine, are in my Claude Code subagents and skills library.

Connect it to your real tools

Claude Code reaches your data through MCP servers, which Anthropic calls connectors. There are two ways to add one:

  • From claude.ai. Add it once under Settings, then Connectors. If you log into Claude Code with the same claude.ai account, those connectors are available in Claude Code automatically. The official list is the connector directory.
  • From the terminal. For a remote server: claude mcp add --transport http <name> <url>. For a local one: claude mcp add <name> -- <command>. Add --scope user to have it in every project, or --scope project to commit it with the repo. The MCP docs cover authentication.

Here is what my jobs actually connect to, and where to get each one:

Connector What my jobs use it for Where to get it
DataForSEO Keyword volume and live SERPs. No volume, no article. DataForSEO’s Claude Code install guide
Canva The featured image on every post, filled in from one brand template Canva connector
Search Console, GA4 and Bing Clicks, queries and traffic drops across all my sites Murkuz connector setup (paste https://murkuz.com/mcp as a custom connector)
Locul, my notes and past decisions So it does not ask me something I already decided Locul connects to Claude on install; how a memory MCP works

If you are starting from zero, the official Gmail, Google Calendar, Google Drive and Notion connectors are the quickest wins: one click each, and they turn “summarize my week” into a real task.

Search Console has no official Claude connector. I pull it through Murkuz, which I built, and community servers such as mcp-gsc are the free route if you are happy to set up a Google Cloud project. I wrote up what I learned doing this in connecting Search Console to Claude. Whatever you connect, start read-only and add write access only once a job has earned it.

Put it on a schedule: my real job list

This is the part tutorials skip. Across my products more than thirty jobs run on schedules, all built with Claude Code. These are the ones on my own Mac, times in Pakistan time:

When Job Calls the model?
03:10 daily PrepClubs article upkeep: revises five live articles, republishes them, emails me the links Yes, Opus
06:00 daily Blog article run: keyword and SERP gates, writes, publishes, curls the live URL, emails me the link Yes, Opus
08:00 daily Infrastructure health check: stuck queues, publishing heartbeat, anything exposed that should not be No
08:30 Mondays Bing guard rail: alerts if PrepClubs Bing clicks fall 10 percent below a frozen baseline No
09:00 daily Founder digest across all nine products No
09:00 Mondays Weekly digest and weekly SEO report No
09:00 on the 1st Monthly SEO report No
04:17 on the 1st Blog corpus reconcile against the live sites No
20:30 on the 1st and 15th SEO audit: a script runs seven checks in about six seconds, Sonnet writes the report Yes, Sonnet
Every 20 minutes Supervisor: reruns any job the Mac missed while it was off, three tries at most No

Look at the last column. Three of these ten jobs call the model. The rest are plain Python that Claude Code wrote and still maintains. Put the model only where a job needs judgment, like writing or revising, and let a script do everything that has one right answer. My SEO audit used to fan out into thirty Opus subagents to do checks a script now finishes in six seconds.

One thing to know before you schedule anything heavy: Claude plans meter usage in rolling five-hour windows, and every job on an account draws from the same window as your own interactive work. I run two daily Opus jobs alongside my own work on a Max plan. On Pro, start with one job on Sonnet. I wrote a companion piece on the best practices for running Claude Code unattended on schedules.

You have three ways to schedule a job:

Option Machine has to be on? Use it for
Cloud routines, made with /schedule No Jobs whose inputs are a repo and your connectors. Hourly at most.
Desktop scheduled tasks Yes, and the app must be open Light recurring prompts while you work
launchd or cron running claude -p Yes. launchd catches up on wake. Anything that needs local files, local tools or local secrets

Mine use the third option because they need files and a secrets store that only exist on my laptop. On a Mac, use launchd, not cron: cron has no Full Disk Access, so reads fail with “Operation not permitted,” and it will not find claude on its PATH. A launchd job that was due while the Mac slept runs as soon as it wakes. The headless docs cover claude -p itself.

This is the runner every job of mine goes through, cut down to what you need. Save it as run-job.sh and make it executable:

#!/bin/bash
# run-job.sh <prompt.md>: one unattended Claude Code run that fails loudly.
set -uo pipefail
PROMPT="$1"
JOB="$(basename "$PROMPT" .md)"
LOG="$HOME/claude-jobs/logs/$JOB-$(date +%F).log"
mkdir -p "$(dirname "$LOG")"

# 1. One run at a time. Two overlapping runs share one usage window and both die.
LOCK="/tmp/$JOB.lock"
if ! mkdir "$LOCK" 2>/dev/null; then
  kill -0 "$(cat "$LOCK/pid" 2>/dev/null)" 2>/dev/null && exit 0  # still running
  rm -rf "$LOCK"; mkdir "$LOCK"                                    # stale lock
fi
echo $$ > "$LOCK/pid"
trap 'rm -rf "$LOCK"' EXIT

# 2. A -p run ends when the model ends its turn, so no background waiting.
export CLAUDE_CODE_DISABLE_BACKGROUND_TASKS=1

# 3. Pin the session id, so a dropped connection resumes instead of restarting.
SID="$(uuidgen | tr 'A-Z' 'a-z')"
MODE=(--permission-mode acceptEdits)  # widen with --allowedTools as trust grows

claude -p "$(cat "$PROMPT")" --session-id "$SID" "${MODE[@]}" >> "$LOG" 2>&1
RC=$?
for WAIT in 120 300 600; do
  [ "$RC" -eq 0 ] && break
  tail -n 3 "$LOG" | grep -qE 'socket connection was closed|ECONNRESET|overloaded|API Error: (429|5[0-9]{2})' || break
  sleep "$WAIT"
  claude -p "The API connection dropped. Continue this run exactly where it stopped. Check what is already done and do not repeat it." 
    --resume "$SID" "${MODE[@]}" >> "$LOG" 2>&1
  RC=$?
done

# 4. Tell a human. A silent failure is the expensive kind.
# macOS notification; swap in mail or a Slack webhook anywhere else.
[ "$RC" -ne 0 ] && osascript -e "display notification "$JOB failed. Session $SID" with title "Claude job""
exit $RC

Then schedule it with a launchd agent. Save this as ~/Library/LaunchAgents/com.you.daily-report.plist, change the paths and the hour, and load it with launchctl load ~/Library/LaunchAgents/com.you.daily-report.plist:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
  <key>Label</key><string>com.you.daily-report</string>
  <key>ProgramArguments</key>
  <array>
    <string>/Users/you/claude-jobs/run-job.sh</string>
    <string>/Users/you/claude-jobs/daily-report.md</string>
  </array>
  <key>WorkingDirectory</key><string>/Users/you/claude-jobs</string>
  <key>EnvironmentVariables</key>
  <dict>
    <key>PATH</key><string>/Users/you/.local/bin:/opt/homebrew/bin:/usr/bin:/bin</string>
  </dict>
  <key>StartCalendarInterval</key>
  <dict><key>Hour</key><integer>6</integer><key>Minute</key><integer>0</integer></dict>
</dict>
</plist>

Test it without waiting for 06:00: run launchctl start com.you.daily-report, then read the newest file in ~/claude-jobs/logs/. launchctl list | grep com.you shows the last exit code, where 0 means it worked.

On Linux the cron line is 0 6 * * * $HOME/claude-jobs/run-job.sh $HOME/claude-jobs/daily-report.md, with claude on cron’s PATH. The prompt file itself should read like a brief to a contractor who cannot ask you anything: the goal, the steps, what done looks like, and the rule to finish the whole job or write down exactly why it could not.

What broke when I ran it unattended, and the fix for each

The first objection everyone raises: are you not terrified it deletes your database? Honestly, no. In heavy daily use no agent of mine has destroyed anything. What goes wrong is quieter: jobs that fail silently or run twice. Every row below happened this month, and most of the fixes are in the script above:

Date What happened The fix
Sep 10 to 12 The 03:10 job and the supervisor’s catch-up started a second full run on top of the first. Two runs drained the shared five-hour usage window and neither finished. A lock, so only one run at a time
Sep 14 An alert job exited with an error on purpose after sending its alert. The supervisor read that as a crash and reran it 23 times in 8 hours: 46 emails. A job that has alerted exits 0, and retries stop at three
Sep 15 The SEO audit fanned out into 30 Opus subagents and used up the window in about 15 minutes. The 06:00 job died five minutes in. A script does the checks, the model only writes the report, and the job moved to the evening on Sonnet
Sep 15 A run edited two live articles, started a background check, said “it will notify me,” and the process exited. No log, no commit, and the email said zero articles. Background tasks off, and a prompt rule never to end a turn waiting
Sep 18 A run published and verified its article, then the API connection dropped. Nothing retried, and the failure email claimed nothing was published. Pin the session and resume it. The resumed run finished in about five minutes.

Two guardrails sit on top of that:

  • Permissions. Start a new job on a narrow allowlist and widen it only once you have watched it behave. My publishing jobs run with permission prompts skipped, which is only sane because of the next point. Rules live in settings.json as allow and deny lists, for example allowing Bash(npm run *) and denying Bash(git push *). The permissions docs have the syntax.
  • A secrets injector. My credentials live in one local file of names and descriptions. A small script finds the right record and loads the value into the process at run time, so the key never enters the model’s context. This is the one guardrail I deliberately built, so that the AI can run on auto without ever seeing a key. Models refuse to paste API keys into chat, which used to break every multi-step automation I tried.

FAQ

Do you have to be a coder to use Claude Code?

No. If you can organize files in folders and describe a task in plain English, you can use it. Most of my scheduled work, the reports, digests, triage and inbox cleanup, is not coding at all. You need to describe a task clearly and check the result.

What does Claude Code cost?

Pro is about $20 a month and Max is about $100 or $200, per Anthropic’s pricing page. I run roughly 15 to 20 billion tokens a month across a personal Max seat and two team seats, and my total AI spend sits around five to six hundred dollars. At raw API rates that usage would cost fifteen to twenty thousand. The plan-by-plan numbers are in what I actually pay for Claude Code. When I hit a usage limit I switch to Codex for the rest of the task, which I compared in Codex vs Claude Code.

Where do I get Claude skills?

Anthropic’s plugin marketplaces are listed in the plugin docs. My 23 free ones are at locul.ai/skills: add them with /plugin marketplace add mkhalid1/locul-skills, or copy any single SKILL.md from its page.

It burns through context or wanders off. How do you control that?

Plan first, point it at files with @, run /clear between unrelated tasks, and hand long reads to a subagent so the main conversation stays small. Runaway behavior is almost always a scoping problem, not the model being reckless.

Can Claude Code run while my laptop is closed?

Yes, as a cloud routine. Create one with /schedule or from claude.ai/code/routines. It runs on Anthropic’s servers against your repo and connectors, at most once an hour. Anything that needs files or secrets on your own machine has to run locally, which is why mine use launchd.

Where this comes from

I build and run eight products on my own, and more than thirty scheduled jobs keep their back office running: publishing, SEO reporting, digests, triage and monitoring. The schedule, runner and incident table above come straight from my own setup and logs this month, not from a demo. The CLAUDE.md is a trimmed copy of the one every session of mine starts with, and the secrets injector is the reason those jobs can run on auto. The free skills and the CLAUDE.md analyzer are part of Locul, and my SEO data comes through Murkuz, both built to plug into this exact setup. Pick one report you pull by hand every week, write it up as a prompt file, and put it on the runner above tonight.