Repository navigation
insights: a Claude Code scheduled task and its runs are read as a schedule of theirs - #49
Open
AlexJov996 wants to merge 1 commit into
Open
AlexJov996 wants to merge 1 commit into
AlexJov996 wants to merge 1 commit into
Conversation
…edule of theirs The scan read Claude Code's scheduled tasks from a scheduled_tasks.json only. The app now keeps one folder per task under ~/.claude/scheduled-tasks/<name>/SKILL.md (the name and description up top, the prompt below), and each run of one is a session with the person's own entrypoint (claude-desktop), promptSource "system", turnOrigin "scheduled" and a first message that is a <scheduled-task name=...> block. Such a task was no schedule, and its runs were sessions the person typed in: the "Agents that start themselves" row read "no schedule of yours", with no run while away. The file inventory lists each task folder in claude_scheduled_tasks (one per count, never a skill). The session reader keeps the task's name on the record, and a session that names one is an unattended run a scheduler started, wherever the code tells a headless run apart (one helper, unattended(r)). A test per side: the folder shape and the old JSON shape; a scheduled run against a typed desktop session. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
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.
Before and after: The scan read Claude Code's scheduled tasks from a
scheduled_tasks.jsononly. The app now keeps one folder per task,~/.claude/scheduled-tasks/<name>/SKILL.md(name and description in the frontmatter, the prompt below), and each run of one is a session written with the person's own entrypoint (claude-desktop),promptSource"system",turnOrigin"scheduled" and a first message that is a<scheduled-task name="…" file="…">block. Such a task was no schedule, and its runs counted as sessions the person typed in: with three tasks and six runs on a laptop, the "Agents that start themselves" row read "no schedule of yours that starts an agent, and no unattended run". Now it reads "3 schedules of yours start an agent; 6 runs began while you were away", state built and used, and theruns-start-without-youpractice has its evidence (the digest lists the tasks and their runs by template).What changed: the file inventory (
scan_claude_dir) lists each task folder inclaude_scheduled_tasks, one percount, with the task's name and description; it is never read as a skill (onlyskills/is). The session reader keeps the task's name on the record (scheduled_task, from the first message, only when the record says a scheduled trigger started the turn), and one helper,unattended(r), now tells a headless run apart everywhere the code did it by entrypoint alone: such a session is an unattended run,SchedulerStarts.startednames the task as its parent, and its template is the task's name rather than "(no prompt)". The board row and the Built tab needed no change; their wording already said "Claude Code's scheduled tasks".Test: from
plugins/insights/scripts/setup-snapshot/experiments:cd 2026-10-27-anatomy && python3 -I test_scheduled_tasks.py(a task folder is one schedule with its name; two folders count twice; a task folder is not a skill; a folder withoutSKILL.mdis nothing; the JSON shape still counts) andcd 2026-11-02-evidence && python3 -I test_scheduled_runs.py(the record names the task that started it; a typed desktop session names none; a scheduled run is an unattended run that a schedule started even when the person typed elsewhere a minute before, and not a typed session; a typed desktop session stays typed). The existing suites (test_mcp_built, setup-read, engine, views) pass as on main, wheretest_findalready fails to import a missingtest_frame_member. A full run on a laptop with three such tasks and six runs read the row as above and listed no skill under the tasks folder.CHANGELOG.md,marketplace.jsonorkit.json.