[Bug] scheduled_tasks.lock not following *.local.* ignore convention, leaks into git status

Resolved 💬 3 comments Opened May 24, 2026 by cjthom03 Closed Jun 24, 2026

Bug Description
.claude/scheduled_tasks.lock doesn't follow the documented .local. ignore convention, leaks into every repo's git status.

Claude Code writes a runtime scheduler lock to <project>/.claude/scheduled_tasks.lock containing session/PID metadata that changes every time a new session acquires the lock. Confirmed: the string scheduled_tasks.lock lives inside the Claude Code binary itself (verified against ~/.local/share/claude/versions/2.1.150), and the PID in the lock points at the Claude Code --bg-spare background daemon. This is a Claude Code creation, not anything in the host project.

The file is project-scoped, which is reasonable — the scheduler instance is per-project, so the lock belongs alongside it.

The problem is the filename. Anthropic's own documented convention for local-only files inside .claude/ is the .local. infix — that's what settings.local.json follows, and that's the pattern most projects already gitignore (e.g. **/.claude/.local.). The scheduler lock doesn't follow this convention, so it slips past existing ignore rules and shows up in git status on every repo where someone has used /schedule or any cron-mode tooling.

In our repo this file was accidentally committed by Claude in an unrelated PR because it was sitting in git status next to legitimate changes. Every developer using Claude Code in a git-tracked project will hit the same trap unless they add a one-off .gitignore line.

Suggested fixes (any one would solve it):

  1. Rename to scheduled_tasks.local.lock so it matches the existing .local. convention.
  2. Move the lock to ~/.claude/ keyed by project path (consistent with how ~/.claude/daemon.lock is handled for the global daemon).
  3. Ship a default .claude/.gitignore that ignores runtime artifacts so users don't each have to re-derive this.

Option 1 is the smallest change and fixes it retroactively for any project that already ignores .local..

Environment Info

  • Platform: darwin
  • Terminal: iTerm.app
  • Version: 2.1.150
  • Feedback ID: b5427062-9519-43d3-b2bd-7632d2f6a25c

Errors

[]

View original on GitHub ↗

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