Schedule view in sidebar: list and manage Windows scheduled tasks (0.2.0)#8
Merged
Conversation
…2.0) New sidebar section that lists every scheduled task via schtasks /Query /FO CSV /V and classifies each as ClaudePortable-managed (green), foreign-but-Claude-related (orange), or unrelated (gray). Per-row buttons run / disable / enable / delete / show XML; destructive actions gate behind a confirmation dialog. CLI parity: schedule list [--all|--managed|--relevant] [--json], plus schedule disable|enable|run <name>. Existing install / show / remove / emit subcommands unchanged. TaskSchedulerInstaller gains EnumerateAsync / DisableAsync / EnableAsync / RunNowAsync / GetTaskXmlAsync and routes all calls through an internal Func<> seam so unit tests can assert exact schtasks argv without invoking the executable. ScheduledTaskClassifier is a pure static function over a stable marker list so it stays testable. Motivating use case: legacy hand-written backup PowerShell tasks that write loose-file Claude backups into a long-path OneDrive folder silently outcompete ClaudePortable's ZIP output and break sync. The new view surfaces them so the user can disable or delete them from inside the app. Tests: 37 new xUnit cases (CSV parser with German schtasks fixture, relevance classifier, installer command shapes). 61 -> 98 cases total.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
A hand-written Windows scheduled task running
2026-04-22_backup-claude-workstation.ps1writes loose-file Claude AppData snapshots into an OneDrive-synced folder. The nestedlocal-agent-mode-sessions\<UUID>\<UUID>\local_<UUID>\...paths blow past the 260-character limit when combined with the OneDrive root and OneDrive refuses to sync them. ClaudePortable solves this by writing a single ZIP, but until now had no way to see that the legacy task even exists.schedule showcould only query one named task at a time.What
A 6th sidebar section "Schedule" that enumerates every Windows scheduled task on this machine via
schtasks.exe /Query /FO CSV /V, parses the German + English locale CSV output, and classifies each entry as:ClaudePortable-or Author containsClaudePortable.claude,Claude_pzs8sxrjxfjjc,Cowork,CoWork\Backup,local-agent-mode-sessions,claude-desktop,anthropicPer-row Run / Disable / Enable / Delete / View XML buttons, gated by
MessageBoxconfirmation for destructive actions. View XML copies the rawschtasks /Query /XMLoutput to the clipboard.CLI parity:
Existing
install/show/remove/emitsubcommands are untouched.How it stays small
AsyncRelayCommandreused.Microsoft.VisualBasic.FileIO.TextFieldParser.TaskSchedulerInstallerkeeps its public surface and just adds 5 methods, all routed through one new internalFunc<>seam so tests can record exactschtasksargv without invoking the executable.ScheduledTaskClassifieris a pure static function over a stable, testable marker list.Tests
61 -> 98 xUnit cases. New:
ScheduledTaskCsvParserTests- feeds a canned German-localeschtasks /Query /FO CSV /Vfixture covering\Claude-Desktop-Backup,\ClaudePortable-Daily, an Adobe task, an Office task in a subfolder, and a disabled task. Asserts row count, executable / args split for quoted and unquoted paths, FolderPath/Name split, State on disabled rows, and ManagedBy classification.ScheduledTaskClassifierTests- table-driven coverage including case-insensitivity, marker-in-working-directory-only, and the legacy backup PS1.TaskSchedulerInstallerCommandShapeTests- per-method argv assertions for Install / Delete / Disable / Enable / RunNow / GetTaskXml / Enumerate.Out of scope
Release
CHANGELOG.md added under
[0.2.0].scripts/build-exe.ps1andsrc/ClaudePortable.Installer/build-msi.ps1default version bumped to 0.2.0. Tagv0.2.0on main will trigger the existingrelease.ymlworkflow.Test plan
dotnet build ClaudePortable.slnx -c Releasecleandotnet test ClaudePortable.slnx -c Release98/98 passclaudeportable schedule list --alllists all tasks on this Windows 11 machine and classifies themclaudeportable schedule list --all --jsonemits camelCase JSONv0.2.0-> verify release.yml builds MSI + portable exe artifacts