[Question] CronCreate writes scheduled_tasks.lock to main repo instead of active worktree
Description
When using CronCreate (via the /loop skill) inside a git worktree, the scheduled_tasks.lock file is written to the main repository's .claude/ directory rather than the worktree's .claude/ directory. This causes the lock file to show up as an untracked file in the main repo's git status.
Steps to Reproduce
- Create a git worktree (e.g., via Claude Code's worktree feature at
.claude/worktrees/<name>/) - Start a Claude Code session in the worktree
- Use
CronCreateto schedule a recurring task (e.g.,/loop 10m check CI status) - Check
git statusin the main repository (not the worktree)
Expected Behavior
The scheduled_tasks.lock file should either:
- Be written to the active worktree's
.claude/directory (matching the session's working directory), or - Be stored in a location outside the git tree entirely (e.g.,
~/.claude/)
Actual Behavior
The file is written to <main-repo>/.claude/scheduled_tasks.lock, showing up as an untracked file in the main repo.
Workaround
Adding **/.claude/scheduled_tasks.lock to .gitignore prevents it from appearing in git status.
Environment
- Claude Code version: latest (as of March 2026)
- OS: macOS (Darwin 25.3.0)
- Using git worktrees via
.claude/worktrees/
This may be by design rather than a bug — just flagging in case it's unintentional. The file being session-only (docs say "not written to disk") was also slightly surprising since it does write a lock file.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗