Can a scheduled local Claude Code run use your connectors, or does it need the cloud?
Last updated 2026-08-17 · Confidence: documented — Claude Code’s headless, MCP, and scheduled-task docs; the cron-keychain caveat is inferred.
Local works: a scheduled claude -p run inherits your MCP servers, connector logins, and saved permissions — the cloud is only required when your machine may be off, or for Event triggers like API calls and GitHub events.
What a headless run inherits
Section titled “What a headless run inherits”Without the --bare flag, claude -p loads the same context an interactive session would: settings, hooks, CLAUDE.md, and every MCP server configured in ~/.claude.json or the project’s .mcp.json. Connectors added on claude.ai appear in Claude Code automatically once you’re logged in with that account. --bare skips all of it and never reads OAuth credentials or the system keychain — so a “bare” scripted run is the one that genuinely has no connector access.
Authenticate and approve first, interactively
Section titled “Authenticate and approve first, interactively”A headless run can’t show OAuth or permission prompts, so front-load both:
- Sign in to remote servers once from an interactive session (
/mcporclaude mcp login <name>); stored tokens refresh automatically on a 401. A few Anthropic-hosted connectors (Gmail, Google Calendar, Microsoft 365) can only be connected from claude.ai settings, then flow through. - Pre-approve tools with
--allowedTools, a permission mode, orpermissions.allowrules — otherwise calls fail instead of waiting.
Three schedulers, one cloud
Section titled “Three schedulers, one cloud”Claude Code’s comparison of scheduling options: your own cron job wrapping claude -p is the DIY version of the Desktop app’s local scheduled tasks — Routines → New routine → Local, 1-minute minimum interval, per-task permission mode with “always allow” choices that persist across runs, one catch-up run after sleep. Both need the machine awake (Desktop tasks also need the app open). Cloud routines run with the machine off but get a fresh clone, not your local files, with connectors configured per task and an hourly minimum.
One cron caveat: a non-bare run reads credentials from the system keychain, which cron’s environment may not unlock.
Sources
Section titled “Sources”- Run Claude Code programmatically — code.claude.com
- Connect Claude Code to tools via MCP — code.claude.com
- Run prompts on a schedule — code.claude.com
- Schedule recurring tasks in Claude Code Desktop — code.claude.com