Note:
cc plandoes not auto-remove its one-shot tasks after they run — oldcc-plan-*tasks may linger in Task Scheduler and are safe toUnregister-ScheduledTask.
You want Claude Code to work on something while you sleep. cc plan registers a
one-shot Windows Task Scheduler job that wakes the PC from sleep, runs
claude -p "<prompt>" in the directory you were in, saves the output, and lets
the PC go back to sleep.
Task Scheduler
one-shot task, WakeToRun
│
▼
┌─────────────────────────────────────────────┐
│ plan-daemon.ps1 │
│ │
│ 1. Read the plan JSON │
│ 2. Run claude -p in the saved directory │
│ 3. Save output to plan-<id>.output.md │
│ 4. Log result to plan-<id>.log │
└─────────────────────────────────────────────┘
- Sleep (S3): PC wakes, runs the plan, goes back to sleep. Works reliably.
- Hibernation (S4): Depends on BIOS/UEFI and drivers. May or may not work.
| File | Role |
|---|---|
modules/cc/main.ps1 |
CLI module — entry point, shared helpers |
modules/cc/plan.ps1 |
CLI module — scheduled plan tasks |
scripts/cc/plan-daemon.ps1 |
Daemon — plan executor (Task Scheduler) |
| Path | Content |
|---|---|
%APPDATA%\cc\plans\plan-*.json |
Scheduled plan definitions |
%APPDATA%\cc\plans\plan-*.output.md |
Claude output from plans |
%APPDATA%\cc\plans\plan-*.log |
Plan execution logs |
Schedule Claude to run a specific prompt in a specific directory. PC wakes from sleep to execute.
# Schedule a task (runs in current directory)
cc plan "refactor the auth module" # auto-schedule
cc plan "write tests for utils" --at 1:00 # run at 1:00 AM
cc plan "fix all TODOs" --at 3:00 --auto-edit # allow file changes
cc plan "analyze codebase" --timeout 120 # 2h timeout (default: 60m)
# Manage plans
cc plan list # List all plans (pending/running/completed/failed)
cc plan show <id> # Show details + Claude output
cc plan cancel <id> # Cancel a pending plan
cc plan clean # Remove completed plans older than 7 daysHow it works:
- You run
cc plan "prompt"from your project directory - A one-shot Task Scheduler task is created with
WakeToRun = true - At the scheduled time, PC wakes from sleep
- Daemon runs
claude -p "prompt"in the saved directory - Output is saved to
%APPDATA%\cc\plans\plan-<id>.output.md
Modes:
- Default (read-only): Claude analyzes but cannot modify files. Safe for overnight analysis.
--auto-edit: Claude can edit files (--dangerously-skip-permissions). Use for actual coding tasks.
Auto-scheduling: Without --at, cc plan tries ccusage to find when the
current usage block expires and schedules 5 minutes after. Falls back to the next
full hour.
Plan JSON schema:
{
"id": "20260414-0100",
"prompt": "refactor the auth module",
"workingDirectory": "C:\code\myproject",
"scheduledAt": "2026-04-14T01:00:00",
"status": "pending",
"autoEdit": false,
"timeoutMinutes": 60
}| Dependency | Required | Purpose |
|---|---|---|
| PowerShell 7+ | Yes | Runtime |
claude CLI |
Yes | The thing being run |
ccusage |
No | Optional auto-scheduling hint |