anthropics / anthropics/claude-code

Scheduled tasks: expose a per-task directory-access grant (parity with local-agent-mode's userSelectedFolders)

Open
#92,357 0 comments 0 reactions 0 assignees View on GitHub
area:permissions area:routines area:security enhancement
Dominant language
Python
Stars
145k
Forks
23.1k
PR merge metrics
PR metrics pending

Description

Local-agent-mode scheduled tasks (`~/Library/Application Support/Claude/local-agent-mode-sessions//scheduled-tasks.json`) record a static `userSelectedFolders` array per task — an explicit, auditable list of which directories that task can reach.

Claude Code CLI's own scheduled-tasks feature (`mcp__scheduled-tasks__*`, registry at `~/Library/Application Support/Claude/claude-code-sessions//scheduled-tasks.json`) has no equivalent field — every task shows `userSelectedFolders: null`. Actual file access for these tasks is governed by `cwd` plus an `approvedPermissions` list, but that list only records approved **Bash** command strings; Read/Edit/Write access to paths outside `cwd` isn't recorded anywhere in the task JSON, even though it demonstrably works (granted dynamically per session).

This makes it impossible to audit "what directories can this scheduled task actually reach" from the registry alone for CLI-scheduled tasks, unlike local-agent-mode tasks. Requesting an explicit per-task directory-grant field (or at minimum, exposing accumulated Read/Edit/Write directory access the same way Bash commands are exposed via `approvedPermissions`) for parity and auditability.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the mcp__scheduled-tasks__* entry points and compare the CLI registry at ~/Library/Application Support/Claude/claude-code-sessions//scheduled-tasks.json with the local-agent-mode registry. Trace how cwd, approvedPermissions, and dynamic Read/Edit/Write access are represented. Done means each CLI-scheduled task exposes an explicit, auditable directory grant in its task JSON.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli, security
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.