awml / platforms / claude-code-laptop
Claude Code on a laptop
Claude Code on a person's own laptop, started on a schedule by Claude Desktop's local scheduled tasks, or by cron or launchd running `claude -p`. This describes a kind of platform, not anyone's machine. To describe your own laptop, copy this file and add what else runs there, such as other coding agents, and the folders you keep. Checked against Anthropic's documentation on 22 October 2026.
Install a workflow on Claude Code on a laptop
Each run is a Claude Code session on the laptop, which carries out the workflow's steps by following written instructions. Claude can read every folder it is given and use every tool you allow, so put only what the workflow's scopes allow on this laptop.
Run awml fit with the workflow's security view and this description first. If it reports code steps, Claude will carry them out by following instructions here, so write each one as an exact procedure, or as a script the instructions tell Claude to run.
What to create
- A working folder under
notes, holding every context the security view names withat, at the same paths. - A skill holding the instructions, at
.claude/skills/<workflow>/SKILL.mdin the working folder. Give one section to each step, in the order the drawing lists them, saying what the step reads, what it writes and what its operation must not do. A draft step writes a draft and never sends it. An outside action marked Ask ends in a draft, or a message asking the person for a yes, never in the action itself. - Scripts for any code steps, in the working folder, which the skill tells Claude to run.
- Allow rules for exactly the tools a run needs, in
.claude/settings.jsonin the working folder, so an unattended run does not stall on a permission prompt.
Where secrets go
Claude Code keeps its own sign in in the macOS Keychain, or on Linux in ~/.claude/.credentials.json with mode 0600. A run started by launchd or cron needs a token of its own: run claude setup-token, then keep the token in the keychain or in a file only you can read, and load it into CLAUDE_CODE_OAUTH_TOKEN in the job's environment. Keys for other services go the same way, or into the service's own connector. Never write a key into the skill, the scripts or the notes.
How to schedule the triggers
Use Claude Desktop's local scheduled tasks, or launchd or cron.
In Claude Desktop, open the Code tab, choose Scheduled, then New task. Under Advanced settings turn on Only on this computer and pick the working folder. Choose Hourly, Daily, Weekdays or Weekly, or open the task's Edit form afterwards for Custom, a cron expression in local time. Choose the permission mode and model. Desktop starts each task a few minutes after its time, and only while the app is open and the laptop awake. After sleep it runs one catch up for the latest run missed in the last seven days.
With launchd on a Mac, a job with StartCalendarInterval that was due while the laptop slept runs when it wakes; cron on a Mac skips it. The job runs, in the working folder:
claude -p "Use the <workflow> skill for this run." --allowedTools "Read,Edit,Bash(./scripts/*)"
Give the job's output a log file of its own.
How to check it is running
In Claude Desktop, the task's page lists every run under History, including skipped ones with the reason, such as the laptop being asleep. Open a run to read its session. For launchd or cron, read the job's log, and add --output-format json to the command to log each run's result. Click Run now, or run the command by hand, once after setting it up, and confirm the files the workflow should change have changed.
Sources
- https://code.claude.com/docs/en/desktop-scheduled-tasks
- https://code.claude.com/docs/en/headless
- https://code.claude.com/docs/en/authentication
- https://code.claude.com/docs/en/permissions
- https://developer.apple.com/library/archive/documentation/MacOSX/Conceptual/BPSystemStartup/Chapters/ScheduledJobs.html