/login command not registered when scheduled task fires during startup with expired auth
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
- Configure a scheduled task (via
/cron) that runs on or shortly after startup - Allow authentication credentials to expire
- 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
/loginfrom 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 runclaude /login from the terminal outside of the session.
Environment
- Platform: macOS (Darwin)
- Shell: zsh
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗