[Question] CronCreate writes scheduled_tasks.lock to main repo instead of active worktree

Resolved 💬 3 comments Opened Mar 8, 2026 by joakimriedel Closed Apr 6, 2026

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

  1. Create a git worktree (e.g., via Claude Code's worktree feature at .claude/worktrees/<name>/)
  2. Start a Claude Code session in the worktree
  3. Use CronCreate to schedule a recurring task (e.g., /loop 10m check CI status)
  4. Check git status in 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.

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗