You already know Claude can write, code, and answer questions. The real superpower is the opposite: pointing it at a task and walking away while it does the work. No chat window open, no babysitting, no approving every step. That is what “hands-off” means, and it is the difference between using an AI chatbot and running an AI agent.
This guide walks you through setting up Claude Agent (Anthropic’s terminal-based agent, formerly Claude Code) for hands-off tasks in about 10 minutes. By the end you will have a working setup that can draft posts, summarize reports, tidy files, and run scheduled jobs while you sleep. If you are new to agents entirely, you may want to read our guide to setting up an AI agent in 30 minutes first, but it is not required.
What Claude Agent Actually Is (and What Hands-Off Means)
Claude Agent is Anthropic’s command-line agent. In its normal mode you type a prompt in your terminal and watch it work through files, commands, and tools step by step. That interactive mode is great, but it still demands your attention.
Hands-off mode removes that demand. You hand Claude Agent a prompt, let it run in the background or on a schedule, and collect the result later. The same engine, the same tools, just no human in the loop. That is what makes it genuinely useful: a nightly market brief waiting for you at 7am, a blog draft folder that fills itself, an inbox triage that runs before you open your laptop.
This is not a toy workflow. People run Claude Agent for real production jobs: generating release notes, checking code for bugs before deploys, building weekly SEO reports, and drafting entire content calendars. Compared to visual workflow builders, Claude Agent is more flexible because it can use your actual files and command line. If you are comparing platforms, our best AI agent platforms comparison covers how it stacks up against OpenClaw, CrewAI, and AutoGen.
Step 1: Install and Authenticate Claude Agent
Claude Agent runs on macOS, Linux, and Windows (via WSL). The fastest path is the native installer:
Install
Open your terminal and run:
npm install -g @anthropic-ai/claude-code
If you prefer not to use npm, Anthropic ships a one-line native installer on the Claude Code download page, which bundles everything you need. Either way, verify the install with:
claude --version
Authenticate
Two options:
Option A: Claude subscription. Run claude in your terminal and follow the login link in your browser. This works with Claude Pro or Max plans and is the easiest for most people.
Option B: API key. Get a key from the Anthropic Console and set it as an environment variable:
export ANTHROPIC_API_KEY=your-key-here
API keys give you per-token billing and are better for servers and scripts. Add the export line to your shell profile (~/.zshrc or ~/.bashrc) so it persists across sessions.
Test the setup with a quick one-shot prompt:
claude -p "Reply with exactly: ready"
If you see “ready” in a few seconds, you are good to go. The -p flag is the foundation of everything hands-off, so remember it.

Step 2: Run Your First Background Task
The -p flag (print mode) runs Claude Agent without the interactive UI. You give it a prompt, it does the work, prints the result, and exits. This is your hands-off workhorse.
Try a real task. Create a folder called briefs in your home directory, then run:
claude -p "Write a 200 word summary of the file at ./notes.txt and save it to ./briefs/today.md" --output-format json > run-log.json
Claude Agent reads the file, writes the summary, and saves the run details to run-log.json. You can check on it anytime by reading that log. The & sends the process to the background so your terminal stays free, and nohup keeps it alive if you close the window:
nohup claude -p "your prompt here" --output-format text > task-output.txt 2>&1 &
For longer projects, use --continue to resume the last conversation, or --resume <session-id> to resume a specific one. Sessions keep context, so a multi-stage task can pick up exactly where it left off.
Permissions for unattended runs
By default Claude Agent asks before touching files or running commands, which defeats hands-off mode. For unattended runs you have two sane choices:
–permission-mode acceptEdits: allows file edits without asking while still prompting for risky shell commands. Good for drafting and content work.
–sandbox: runs everything in a restricted environment with no network by default, ideal for code analysis and file processing you do not want touching the internet.
Start with acceptEdits and only escalate after you have watched a few runs succeed. Never pass --dangerously-skip-permissions on a machine with production data. I use it exactly nowhere; it is a footgun with a nice name.

Step 3: Build a Recurring Hands-Off Workflow
One-off background runs are nice. Scheduled runs are where the magic happens. On macOS and Linux, cron is built in. To run a job every weekday at 7am, open your crontab:
crontab -e
Then add a line like this:
0 7 * * 1-5 cd /Users/you/projects/blog && claude -p "Check today's drafts folder. For each draft, add a short SEO title suggestion at the top. Log what you changed to ./logs/$(date +\%F).md" --permission-mode acceptEdits >> ./logs/cron.log 2>&1
That one line runs a complete editorial task every morning while you are still in bed. The log file captures every run so failures are visible and debuggable.
Two more pieces make recurring workflows reliable:
CLAUDE.md memory file. Drop a CLAUDE.md in your project folder describing your style, your tools, and your rules. Claude Agent reads it at the start of every run, so each job starts with full context instead of a blank slate. This is the single biggest quality lever in this whole guide.
Hooks. Claude Agent supports hooks that fire before or after tools run. You can use them to block risky commands, enforce file paths, or send yourself a notification when a long job finishes. A simple Stop hook that posts to a Slack webhook turns silent background jobs into visible ones.

Step 4: Keep Costs and Safety Under Control
Hands-off means the agent runs without you watching, so you need guardrails before you trust it overnight.
Pick the right model per task. Use -m sonnet for routine jobs like summaries and drafts, and reserve the top model for genuinely hard reasoning. I run a nightly digest on Sonnet and it costs pennies per run. Letting every trivial job default to the biggest model is how people get surprise bills.
Cap the work. --max-turns limits how many tool calls a run can make, which turns runaway tasks into quick failures instead of expensive ones. A normal report should finish in under 30 turns. If a job needs more, you want to know why.
Watch your usage. The Anthropic Console shows token usage per day and per API key. Check it weekly. If a recurring job spikes, your prompt or permissions probably let the agent wander.
Test before you trust. Run a new workflow interactively once, watch what it does, then schedule it. Every horror story about AI agents comes from skipping this step.
Common Mistakes
These are the mistakes I see most often when people start running Claude Agent hands-off:
Skipping CLAUDE.md. Without context, every run starts cold and produces generic output. Ten minutes of writing instructions saves you hours of editing.
Full permissions on day one. Granting everything to an agent you have not watched yet is how files get moved and commands get run that you did not intend. Start with acceptEdits and a sandbox, then relax as trust builds.
No logging. If a scheduled job fails silently at 3am, you will not know until the report is due. Always redirect output to a log file and check it occasionally.
Using the expensive model for everything. Model choice should match task difficulty. Sonnet handles the bulk of hands-off work fine, and your wallet will thank you.
Never testing the exact command. The difference between an interactive session and a one-shot -p run trips people up constantly. Run the literal command once in the foreground before scheduling it.
Check out our ChatGPT vs Claude vs Gemini comparison, which breaks down strengths, pricing, and the best use case for each so you pick the right engine for your agent.
Claude Agent requires a Claude Pro or Max subscription, or an Anthropic API key with pay-per-token billing. There is no free tier for the agent itself, but the CLI tool is free to install. If you already pay for Claude, you can use it immediately.
No. Installing it requires one command in your terminal, and the rest is plain English prompts. Writing files and running commands in the terminal is all you need. Coding knowledge helps you build fancier workflows, but a beginner can be productive on day one.
Not on your laptop, because a closed laptop sleeps. For true 24/7 hands-off work, run Claude Agent on an always-on machine like a home server, a cloud VM, or a CI runner. On a normal desktop you can schedule jobs, but the computer needs to be awake when they fire.
Claude Agent is a command-line agent from Anthropic that works directly with your files and terminal. OpenClaw is a different agent platform focused on connecting to your chat channels and running 24/7. ChatGPT is primarily a chat product, though it has agent features. The right pick depends on whether you want terminal-based automation, channel-based assistants, or simple conversation.
It is safe when you set guardrails: start with –permission-mode acceptEdits, use the sandbox for untrusted work, cap runs with –max-turns, and log everything. Never grant blanket permissions to an agent you have not tested. With those controls, unattended runs are routine for thousands of teams.
Final Thoughts
Hands-off Claude Agent takes about 10 minutes to set up and changes how you think about your to-do list. Start with one boring recurring task, a summary, a draft, a report, and let it run for a week. Once you trust the pattern, you will start finding jobs to hand over everywhere.
The formula is always the same: write a clear prompt, give it context with CLAUDE.md, cap its permissions, log its output, and check the results before you scale up. Do that and you have a reliable assistant that works while you do not.

