[FEATURE] Auto-archive (auto-close tab) for scheduled task / routine run sessions after completion
Feature request
An opt-in way for scheduled task (routine) run sessions to auto-archive — i.e. close their own tab — once the run completes.
Use case
I run an hourly monitoring routine in the desktop app (cron 0 0,4,8-23 * * * ≈ 18 runs/day). Every run opens a session tab that stays open forever, so the tab bar fills up with identical completed-run tabs and I have to close them by hand every day. Any high-frequency routine has this problem.
What I tried (all dead ends, seemingly by design)
Adding a final step to the task prompt that calls mcp__ccd_session_mgmt__archive_session with session_id: "self":
- The tool always requires a manual confirmation click, even though scheduled runs execute with
permissionMode: bypassPermissions(andchromePermissionMode: skip_all_permission_checks). - Clicking Allow is never persisted: the session's
alwaysAllowedReasons/sessionPermissionUpdatesstay empty and noapprovedPermissionsentry is written to the task inscheduled-tasks.json— so the next unattended run prompts again. - Pre-seeding
{"toolName": "mcp__ccd_session_mgmt__archive_session"}into the task'sapprovedPermissions(verified loaded after app restart and preserved across store flushes) still prompts — the confirmation sits outside the task-approval layer that works fine for e.g. Chrome MCP tools.
Worse, an unattended run stalls indefinitely on that dialog (observed 30+ min), holding the per-task scheduler slot, so the next hourly fire is skipped with per_task_limit. So today the safe options are: leave the tabs, or close them manually.
Suggested shape (any of these would work)
- A per-task option — task config / SKILL.md frontmatter or the task edit UI: "Archive session when run completes" (default off), or
- a Settings preference next to Auto-archive on PR close: "Auto-archive completed scheduled-task runs (after N hours)", or
- honor a task-level
approvedPermissionsentry forarchive_session(self)in scheduled runs only.
Session state already carries an autoArchiveExempt flag (set when the user interacts with a session), which suggests part of the infrastructure exists.
Related
- #69639 (bulk archive for sessions — complementary, this request is about not needing the bulk cleanup in the first place)
- #67615 (same hard-confirm-in-bypass-mode behavior family, for
send_message)
Environment
- Claude desktop app 1.18286.0, macOS (Darwin 25.5.0)
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗