AX notes · How-to

Schedule Claude Code with Windows Task Scheduler

One register-job.ps1 line makes Windows Task Scheduler run Claude Code's hello job at 09:05 every day. Each morning, the status table shows the last result, the next run and whether you need to log in again.

By Stephen Working with agents 9 min read Last updated

Windows harness series, part 7 of 11 Previous Download the kit and run a first job Next A morning GA4 report job

This part puts the hello job from part 6 into Windows Task Scheduler, the scheduling tool built into Windows. Once it is registered, hello runs by itself at the same time every day, as long as the PC is on and you are logged on.

You keep using the $HOME\harness folder from part 6. You do not need an administrator window. The kit's console lines and the status table are in Korean, and this page translates them; to get English answers from Claude, point a job card at the English prompts in prompts/en as shown in part 6, step 3.

When you finish this part

  • Result: hello runs by itself at 09:05 every day (while the PC is on and you are logged on).
  • You need: a PC that has finished part 6 (hello ran by hand).
  • Cost: none. Scheduled runs use the Claude plan you logged in with in part 4.
Contents (7)
  1. Step 1: Register hello for 09:05 every day
  2. Step 2: Start it once now
  3. Step 3: Check the status table each morning
  4. Step 4: Schedule other jobs, and remove one
  5. If you get stuck
  6. In the real harness
  7. FAQ

Step 1: Register hello for 09:05 every day

  1. Open a new PowerShell window and go to the kit folder.

    cd $HOME\harness
  2. Paste the execution policy line from part 6, step 4. register-job.ps1 is a script too, so this window has to allow it.

    Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass -Force
  3. Register hello. After -At, give the time as hours:minutes.

    .\register-job.ps1 -Name hello -At 09:05

You are done when

You see TaskName : hello and a NextRunTime line with the next run time. On our Korean-language PC it read 2026-11-12 오전 9:05:00 (오전 means AM); your date and format will differ.

register-job.ps1 registers the job with these settings. The values below were read back from Task Scheduler after registering.

SettingKit valueIn plain words
TimeDaily at 09:05Starts at the same time every day.
Missed runs (StartWhenAvailable)OnIf the PC was off or asleep at that time, the job runs once after it is back on.
BatteryStarts on battery, keeps runningBy Windows default, a task does not start on battery and stops if the PC switches to battery. The kit lets it run on a laptop battery.
Overlap (MultipleInstances)IgnoreNewIf the previous run is still going, the new one is dropped.
Run limit (ExecutionTimeLimit)Job card limit + 10 minutes, at least 1 hourThe job card (the job definition file in the jobs folder) sets a time limit; the kit adds 10 minutes. Past this, Task Scheduler stops the job. The Windows default is 72 hours. In our test a 300-second job got 1 hour and a 5,400-second job got 1 hour 40 minutes.
Logon (LogonType)InteractiveRuns only while you are logged on. No password is stored.
Rights (RunLevel)LimitedRuns with normal rights, not as administrator.

At run time, Task Scheduler starts PowerShell with a hidden window (-WindowStyle Hidden) and with the same Bypass execution policy as part 6 (-ExecutionPolicy Bypass), then runs run-job.ps1. That is why scheduled runs do not need the line from part 6. Even with the window hidden, a window may flash briefly as the run starts.

Registering the same name again replaces the earlier schedule, so to change the time, run the same command with the new time. The schedule goes into a folder named \my-harness\ inside Task Scheduler.

Step 2: Start it once now

Instead of waiting for 09:05, start the scheduled job right away.

  1. Start the job now. This command only starts it and returns at once.

    Start-ScheduledTask -TaskPath '\my-harness\' -TaskName hello
  2. Wait about 15 seconds, then look at the last-run information. In our test it started at 2:22:05 AM, and the status table's finished-at time was 02:22:13.

    Get-ScheduledTaskInfo -TaskPath '\my-harness\' -TaskName hello
  3. Check that new start and end lines were added to the log.

    Get-Content .\logs\hello.log

You are done when

LastRunTime shows the time you just started it, and the last log line shows status=ok exit=0.

LastTaskResult is the result the last run returned. It was 0 in our test, and the state file said ok at the same time. Microsoft's docs do not list what each number means, so judge a run by the log and the state file.

Step 3: Check the status table each morning

The status table is what status.ps1 shows: one row per job with its last result, finish time, next run and a sign-in warning. There are two ways to open it.

Way 1: double-click status.cmd in File Explorer

  1. In File Explorer, open the harness folder inside your user folder. If a PowerShell window is open, this line opens it too.

    explorer $HOME\harness
  2. Double-click status.cmd. A black window shows the status table, and the last line reads Press any key to continue . . ..

  3. Read the table, then press any key to close the window.

status.cmd calls status.ps1 with the Bypass execution policy, so it needs no execution policy line. We ran it through cmd on our PC and saw the table and that last line.

Way 2: in a PowerShell window

  1. Open a window, enter cd $HOME\harness and the execution policy line, then show the table.

    .\status.ps1
    A Windows PowerShell window. From the top: the register-job.ps1 command with TaskName hello and NextRunTime 2026-11-12 9:05 AM, then Start-ScheduledTask and Get-ScheduledTaskInfo with LastRunTime 2:22:05 AM and a green LastTaskResult 0. In the status table that follows, only the hello row is filled, in yellow: ok, finished 2026-11-12T02:22:13, next run 9:05 AM and a re-login notice; the ads-check, ga4-daily and shorts-plan rows show - for result and time and 등록 안 됨 (not registered) for the next run. At the bottom are the remove-job.ps1 command and a green Korean line saying the hello schedule was removed; the user name in the prompt path is covered by a grey box.
    Real output from a scheduling test with a freshly unzipped kit on our PC, Nov 12, 2026 at 02:22. Because it was a test we added -Folder '\my-harness-test\' to each command; you do not. Only hello was registered and run, so the other three rows are empty. This is our Korean-language Windows PC running the Korean kit: 오전 means AM, the table headings are translated below, and the last line reads hello 예약을 지웠습니다 (hello schedule removed).

The table headings are in Korean. Read them left to right:

A last result of ok only tells you the run ended without an error. Every kit prompt ends its report with a verdict line, 판정: 완료 (done) or 판정: 일부 실패(reason) (partly failed), or Verdict: done / Verdict: partial failure (reason) with the English prompts, so read that line too. Open the most recent report with this line:

notepad .\reports\latest-hello.md

Step 4: Schedule other jobs, and remove one

You register ga4-daily, ads-check and shorts-plan one at a time in parts 8 to 10. In each part you add your data and run the job once by hand, then register it with the same register-job.ps1 command, spacing the times apart (for example 09:30, 09:40 and 10:00). On the practice data, all three jobs finished within 20 seconds.

To remove a schedule, use the line below. It prints a Korean line saying the hello schedule was removed, and the kit files stay where they are. Afterwards the next-run column in the status table reads 등록 안 됨 again. Removing a schedule that does not exist ends with an error, and that line is not printed.

.\remove-job.ps1 -Name hello

If you get stuck

If you seeWhyDo this
running scripts is disabled on this systemThe new window does not have the execution policy line.Paste the line from part 6, step 4 and run again.
파일이 없습니다. 작업 이름을 확인하세요. (the file does not exist, check the job name)The name after -Name does not match a file in jobs.Use the file name from jobs without .json.
Registered, but the next-run column says 등록 안 됨You registered into another folder with -Folder.Add the same -Folder to status.ps1.
It did not run at the scheduled timeThe PC was off, or you were not logged on.A missed run fires once after the PC is back on. Stay logged on.
remove-job.ps1 prints an error starting CIM 서버 에서 Root/Microsoft/Windows/TaskScheduler/... (on our Korean-language PC)There is no such schedule: it was already removed, or the name or -Folder differs.Check the next-run column in the status table.
The login warning column says 다시 로그인 필요The last run printed the login expiry warning.Log in again in the separate settings folder, as in part 4, step 5.

In the real harness

As of Nov 11, 2026, the SugarMount harness had 14 jobs registered in one Task Scheduler folder, and that morning every LastResult in the list was 0.

A PowerShell-style window showing the -List output of the real harness's install script, with columns Task, State, Triggers, LastRun, LastResult and NextRun. Eight rows, including ax-index, ax-notes, harness-release, harness-watch, sugar-daily and three per-app social jobs, are all Ready with LastResult 0. A Korean comment in the header says six rows such as blog jobs were left out.
The real harness's registered jobs on the morning of Nov 11, 2026. We kept the 8 app and notes rows out of 14. Jobs that repeat every 15 minutes show the time the repetition started (13:55) under Triggers. The PC runs Korean-language Windows, so dates show 오전 (AM) and 오후 (PM).

The kit is a cut-down version of this harness. The real one has extra safeguards added after something went wrong; two of them came from these events.

SafeguardWhat happenedIn the kit
Separate production copyFrom the evening of Nov 4 to the morning of Nov 6, about 38 hours, every job stopped at a pre-run check. Harness code that was being edited had not been committed (recorded as final) in the repository. Since Nov 7, production runs from a separate copy, and only changes that pass checks reach it.None
Verdict lineOn Nov 10 one app's social job posted nothing because there was no video queued, yet its status was ok, and that night's daily summary said zero failures or misses. Since Nov 11 every job ends with a verdict line.Yes, in all four prompts

The way the window is hidden also differs. The real harness starts PowerShell through conhost.exe --headless, but we found no official documentation for that option, and security tools sometimes treat it as a warning sign, so the kit does not use it.

FAQ

What happens to a scheduled job if the PC is off?

It does not run at that time. The kit registers missed runs to fire once after the PC is back on, and even then you need to be logged on.

Do scheduled jobs run on a laptop battery?

With the kit, they do. By Windows default a task does not start on battery, but register-job.ps1 sets it to start on battery and keep running.

As of Nov 12, 2026. Microsoft documentation (the PowerShell ScheduledTasks module and Task Scheduler settings pages), output from a scheduling test on our PC, and the harness's registered-job list and state files (Nov 11, 2026).

This note is written from values SugarMount measured itself; an AI coding agent was used to draft it.

All AX notes