All articles
Tonis Tiganik--10 min read

Claude Code Automation: From First Job to Fully Unattended Agents

A step-by-step guide to automating Claude Code with ClawTab. Install, create your first cron job, enable auto-yes, inject secrets, and monitor everything from your phone.

Claude Code Automation: From First Job to Fully Unattended Agents

Introduction

This guide walks you through automating Claude Code from scratch. By the end you'll have agents running on a cron schedule, auto-accepting permission prompts, using secrets from your Keychain, and reporting to your phone. Everything runs locally on your Mac via ClawTab - a free, open-source menu bar app.

Why Automate Claude Code?

The default Claude Code workflow is: open a terminal, type a prompt, wait, approve permissions, wait, read the output. It works. But it's a manual loop that requires you at the keyboard the entire time.

Automation removes you from the loop. You define what agents should do, when they should run, and how they should handle permissions - then walk away. The agents run, the results show up on your phone or in Telegram, and you review the output when it's convenient.

Common automation scenarios:

  • Daily code review. An agent reviews open PRs every morning at 9am, posts summaries, and flags issues.
  • Nightly test runs. An agent runs the full test suite, opens issues for failures, and sends a Telegram summary.
  • Dependency updates. An agent checks for outdated packages weekly, updates them, runs tests, and opens a PR.
  • Documentation sync. An agent reads code changes from the last 24 hours and updates relevant docs.
  • Data pipeline monitoring. An agent checks dashboard metrics on a schedule and sends alerts when anomalies appear.

Each of these would take 10-30 minutes of manual interaction. Automated, they run while you sleep.

Step 1: Install ClawTab

ClawTab is a macOS menu bar app that manages Claude Code agents. Install it via Homebrew:

brew install --cask tonisives/tap/clawtab

Open ClawTab from your Applications folder. You'll see a small claw icon in your menu bar. Click it to open the jobs panel.

ClawTab runs as a background daemon via macOS launchd. It starts automatically on login, survives reboots, and stays out of your way until an agent needs attention. You can also install it from the GitHub repo if you prefer building from source.

Verify the installation:

cwtctl ping
# should print "pong"

Step 2: Create Your First Job

Click the "+" button in the ClawTab panel to create a new job. Fill in:

  • Name: Something descriptive like "morning-review" or "test-runner"
  • Job type: Claude Code
  • Prompt: The instruction for the agent. Keep it specific: "Review all open PRs in this repo and post a summary comment on each one" is better than "do code review."
  • Working directory: The folder where the agent should run. Usually your project root.

Leave the cron field empty for now - we'll add scheduling in the next step. Click "Save" and then "Run" to test your job.

ClawTab creates a tmux session, launches Claude Code with your prompt inside it, and starts monitoring. You'll see the job appear in the jobs list with a "Running" indicator. Click on it to see live logs.

Jobs are stored centrally at ~/.config/clawtab/jobs/. For project-based workflows, you can write a shared context.md at the project level in central storage with project conventions and architecture notes that every job in that project will read.

ClawTab desktop app showing the new job creation form with job name, folder path, and prompt fields
Creating a new job in ClawTab - set the name, working directory, and prompt

Step 3: Add a Cron Schedule

Edit your job and add a cron expression. ClawTab uses standard 5-field cron syntax:

# Every weekday at 9:00 AM
0 9 * * 1-5

# Every 6 hours
0 */6 * * *

# Monday and Thursday at 2:00 PM
0 14 * * 1,4

# Every 30 minutes (for monitoring jobs)
*/30 * * * *

ClawTab polls every 30 seconds and fires the job when the cron matches. If a job is already running when its cron fires again, it skips that run - no duplicate agents.

The cron schedule is optional. You can always run jobs manually from the UI or via cwtctl run job-name. Some jobs work better as manual triggers (one-off refactoring) while others benefit from a schedule (daily reviews, monitoring).

For a deeper dive into scheduling patterns and edge cases, see Claude Code Cron Jobs.

Step 4: Enable Auto-Yes

Claude Code asks permission before writing files, running commands, and installing packages. In an automated setup, these prompts stall the agent until someone responds.

You have two options:

  • Auto-yes mode - ClawTab watches for permission prompts and automatically accepts them. Enabled per-pane, so different agents can have different policies. Prefers session-scoped permissions over permanent ones.
  • Manual from your phone - Get a push notification when the agent asks a question, tap the answer on your phone. Takes 5 seconds but keeps you in the loop.

For fully unattended automation, enable auto-yes on the job. You can do this from the desktop app or from your phone when the first permission prompt arrives (tap "Yes all").

Auto-yes is safer than --dangerously-skip-permissions because it only accepts prompts that match "Yes" patterns, works per-pane rather than globally, and can be disabled instantly from any device.

For jobs where you want to review permissions but don't want to be at your desk, the phone notification approach works well. You get notified, tap the answer, and the agent continues. The delay is usually under 10 seconds.

Step 5: Inject Secrets

Agents often need API keys, tokens, and credentials. Hardcoding them in prompts or environment variables is risky - they end up in logs, git history, and plain text config files.

ClawTab integrates with macOS Keychain and gopass for secret management. Secrets are injected as environment variables at runtime - they're available to the agent but never stored in ClawTab's config.

# In your job config, reference secrets by name:
name: "deploy-checker"
job_type: "claude"
secret_keys: ["GITHUB_TOKEN", "SLACK_WEBHOOK_URL"]
prompt: "Check deploy status and post to Slack"

When the job starts, ClawTab reads the secrets from your Keychain (or gopass) and sets them as environment variables in the tmux session. The agent can use $GITHUB_TOKEN and $SLACK_WEBHOOK_URL as normal.

To add a secret to your Keychain for ClawTab:

# Via the desktop app: Settings > Secrets > Add
# Or via the macOS Keychain Access app:
# Create a new password item with the service name matching your secret key

See Claude Code Secrets Management for the full setup including gopass for team secrets, per-job scoping, and rotation.

ClawTab Secrets tab showing Keychain and gopass secret management with key-value pairs
The Secrets tab lets you add secrets from macOS Keychain or gopass and inject them into jobs

Step 6: Connect Your Phone

ClawTab Remote lets you monitor and control your agents from your phone. You get push notifications when agents finish, fail, or ask questions - and you can respond without being at your desk.

Setup:

  1. Open ClawTab on your Mac and go to Settings > Remote
  2. Open remote.clawtab.cc on your phone (or install the iOS app)
  3. Scan the QR code shown on your desktop

Your phone connects to your Mac through a relay server over encrypted WebSocket. You can now:

  • See all running and scheduled jobs
  • Watch live agent output as it streams
  • Answer permission prompts from push notifications
  • Enable/disable auto-yes per pane
  • Start, stop, and restart jobs
  • Share your workspace with teammates via workspace sharing

The mobile app is optional. Your agents run fine without it. But it changes the workflow from "check on my agents when I'm at my desk" to "get notified and respond from anywhere."

Step 7: Add Telegram Notifications

Telegram integration gives you a second notification channel. Useful as a fallback when push notifications are unreliable, or for teams that already use Telegram.

Setup:

  1. Create a Telegram bot via @BotFather
  2. Add the bot token and your chat ID to ClawTab's settings
  3. Enable Telegram notifications per job or globally

ClawTab sends Telegram messages when agents ask questions, complete, or fail. You can also reply to Telegram messages to answer agent questions directly from the chat.

This is particularly useful for cron jobs that run overnight. You wake up to a Telegram thread with a summary of what each agent did, any errors it hit, and whether it succeeded.

Telegram chat showing ClawTab agent notifications with job output and completion messages
Telegram notifications show agent output, completion status, and allow direct replies

Putting It All Together

Here's what a fully automated setup looks like for a team of three projects:

# Project A: daily code review
name: "projecta-review"
job_type: "claude"
cron: "0 9 * * 1-5"
prompt: "Review all open PRs and post summary comments"
auto_yes: true
secret_keys: ["GITHUB_TOKEN"]

# Project B: nightly test runner
name: "projectb-tests"
job_type: "claude"
cron: "0 2 * * *"
prompt: "Run the full test suite. If anything fails, open a GitHub issue with the failure details."
auto_yes: true
secret_keys: ["GITHUB_TOKEN"]

# Project C: weekly dependency updates
name: "projectc-deps"
job_type: "claude"
cron: "0 10 * * 1"
prompt: "Check for outdated npm packages. Update any that have minor or patch releases. Run tests. If tests pass, commit and open a PR."
auto_yes: true
secret_keys: ["GITHUB_TOKEN", "NPM_TOKEN"]

All three jobs run automatically on their schedules. Auto-yes handles permission prompts. Secrets come from your Keychain. Push notifications go to your phone. Telegram gets a copy. You review the results when it's convenient.

The total setup time for this configuration is about 10 minutes. After that, these agents run themselves indefinitely.

Tips for Reliable Automation

A few patterns that make automated agents more reliable:

  • Write specific prompts. "Review the open PRs in this repo" is better than "do some code review." Specific prompts produce predictable results.
  • Use centralized job configs with shared project context. Write a context.md with project conventions that every job reads automatically.
  • Start with auto-yes off. Run the job manually a few times to see what permissions it asks for. Once you're confident the agent behaves predictably, enable auto-yes.
  • Use separate panes for separate concerns. Don't put "run tests AND update deps AND review PRs" in one job. Split them so each agent has a focused task and you can debug failures independently.
  • Check logs from your phone. The first time a cron job fires, watch the live logs to make sure the prompt is producing the right behavior. Adjust the prompt if needed.
  • Set up Telegram as a backup. Push notifications can be missed. Telegram gives you a persistent record of what each agent did.

Frequently Asked Questions

Install ClawTab (brew install --cask tonisives/tap/clawtab), create a job with a prompt and cron schedule, and enable auto-yes for unattended execution. ClawTab manages tmux sessions, handles permission prompts, injects secrets, and sends push notifications. Your agents run on schedule without manual intervention.

ClawTab is a free, open-source macOS menu bar app that schedules and manages Claude Code agents. It runs agents in tmux sessions on cron schedules, handles permission prompts via auto-yes, injects secrets from macOS Keychain, and lets you monitor and control everything from your phone.

Yes. ClawTab supports standard cron expressions for scheduling Claude Code agents. Set a cron like '0 9 * * 1-5' for weekday mornings and ClawTab launches the agent automatically. You can also trigger jobs manually via the UI or the cwtctl CLI.

Create a ClawTab job with a cron schedule and enable auto-yes mode. Auto-yes automatically accepts Claude Code permission prompts so the agent runs without human intervention. Inject secrets via Keychain or gopass so the agent has the credentials it needs. Connect your phone for push notifications and remote control.

ClawTab reads secrets from macOS Keychain or gopass and injects them as environment variables when the agent starts. Add secret keys to your job config (secret_keys: ['GITHUB_TOKEN']) and store the values in your Keychain. The secrets are available as environment variables but never stored in ClawTab's config files or logs.

Yes. ClawTab Remote connects your phone to your desktop through a relay server. You can see all running jobs, watch live logs, answer permission prompts, enable auto-yes, and start/stop jobs from your phone. Install the iOS app from the App Store or use remote.clawtab.cc in your browser.

ClawTab sends push notifications via the iOS app and can also send messages to Telegram. You get notified when agents ask questions, complete, or fail. Set up Telegram as a secondary channel by adding your bot token and chat ID to ClawTab's settings.

For Claude Code on macOS, ClawTab provides the most complete automation: cron scheduling, auto-yes for permission prompts, Keychain/gopass secret injection, mobile remote control, and push/Telegram notifications. It runs agents in tmux sessions that survive reboots and lets you monitor everything from your phone. Install via Homebrew: brew install --cask tonisives/tap/clawtab.

Related Articles

How to Run Claude Code in the Background Without a Terminal
-8 min read

How to Run Claude Code in the Background Without a Terminal

Claude Code is interactive by default and dies when you close the terminal. Here are four ways to run it headless - from manual tmux to auto mode to fully managed background agents with ClawTab.

headlessbackgrounddaemontmuxautomationclaude-code
Claude Code Auto-Yes: Auto-Approve Permission Prompts Per-Pane (Toggle from Your Phone)
-5 min read

Claude Code Auto-Yes: Auto-Approve Permission Prompts Per-Pane (Toggle from Your Phone)

Stop babysitting Claude Code permission prompts. ClawTab's auto-yes accepts them automatically per-pane — safer than --dangerously-skip-permissions, works with any plan, and can be toggled on or off from your phone in one tap.

auto-yesagentsremoteautomation
Claude Code Cron Jobs: Schedule Persistent AI Agents That Survive Reboots
-7 min read

Claude Code Cron Jobs: Schedule Persistent AI Agents That Survive Reboots

Set up Claude Code agents on a cron schedule that keeps running even after a reboot. ClawTab injects Keychain secrets, auto-approves permission prompts, and pushes alerts to your phone — compare with Claude Code /schedule and /loop.

cronautomationscheduling
Securely Inject API Keys into Claude Code Agents: Keychain and gopass
-5 min read

Securely Inject API Keys into Claude Code Agents: Keychain and gopass

Inject API keys, tokens, and secrets from macOS Keychain or gopass into Claude Code agents as environment variables. No plaintext credentials in prompts, .env files, or shell history. Secure secrets for scheduled and background agents.

securitysecretskeychain
Claude Code Remote Control: Monitor and Control AI Agents From Your Phone
-6 min read

Claude Code Remote Control: Monitor and Control AI Agents From Your Phone

Monitor, control, and respond to Claude Code agents from your phone or browser. Live log streaming, push notifications, and permission prompt detection. Works with iOS, Android, and any browser via ClawTab Remote.

remotemobileagents