claude-code - 💡(How to fix) Fix /login command not registered when scheduled task fires during startup with expired auth [1 participants]

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…
GitHub stats
anthropics/claude-code#47949Fetched 2026-04-15 06:37:43
View on GitHub
Comments
0
Participants
1
Timeline
3
Reactions
0
Author
Participants
Timeline (top)
labeled ×3

Fix Action

Workaround

Restart Claude Code after disabling or removing the scheduled task, or run claude /login from the terminal outside of the session.

RAW_BUFFERClick to expand / collapse

Bug Description

When a scheduled task (cron) is configured to fire on Claude Code startup and authentication has expired, the /login slash command is never registered. Claude Code tells the user to run /login, but the command is not available.

Steps to Reproduce

  1. Configure a scheduled task (via /cron) that runs on or shortly after startup
  2. Allow authentication credentials to expire
  3. Launch Claude Code

Expected Behavior

Claude Code detects expired auth, registers /login as an available command, and prompts the user to run it — regardless of whether a scheduled task is also firing.

Actual Behavior

  • The scheduled task fires during startup
  • Something in the load order prevents /login from being registered
  • Claude Code tells the user to run /login, but the command is not recognized
  • The user is stuck: told to do something that isn't available

Hypothesis

Race condition in the startup sequence: the scheduled task execution path runs before slash command registration completes, and the auth-check codepath that would normally register /login either gets skipped or conflicts with the task execution.

Workaround

Restart Claude Code after disabling or removing the scheduled task, or run claude /login from the terminal outside of the session.

Environment

  • Platform: macOS (Darwin)
  • Shell: zsh

extent analysis

TL;DR

Disabling or removing the scheduled task and restarting Claude Code may resolve the issue by avoiding the suspected race condition during startup.

Guidance

  • Verify that the scheduled task is indeed the cause by temporarily disabling it and checking if the /login command is registered as expected.
  • Check the startup sequence and load order to understand how the scheduled task execution affects the registration of slash commands like /login.
  • Consider implementing a delay or synchronization mechanism to ensure that slash command registration completes before scheduled tasks are executed.
  • If the issue persists, try running claude /login from the terminal outside of the session as a temporary workaround.

Example

No specific code snippet can be provided without more details on the internal implementation of Claude Code, but the workaround suggests that running claude /login directly can bypass the issue.

Notes

The provided hypothesis of a race condition is plausible and should be investigated further. The workaround suggests that there's an interaction between the scheduled task and the authentication check that prevents /login from being registered.

Recommendation

Apply workaround: Disabling or removing the scheduled task and restarting Claude Code is a safer approach until the root cause is fully understood and addressed, as it directly addresses the suspected race condition without introducing new code or dependencies.

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 /login command not registered when scheduled task fires during startup with expired auth [1 participants]