claude-code - 💡(How to fix) Fix [Bug] scheduled_tasks.lock not following *.local.* ignore convention, leaks into git status

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Root Cause

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.

Code Example

[]
RAW_BUFFERClick to expand / collapse

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

[]

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix [Bug] scheduled_tasks.lock not following *.local.* ignore convention, leaks into git status