[BUG] Agent view daemon respawns background workers into "Not logged in" while foreground auth remains valid
Preflight Checklist
- [x] I have searched existing issues. Related but not exact: #73631, #72719, #71757, #70355.
- [x] This is a single bug report.
- [x] I am using the latest version available to me.
What's wrong?
Claude Code agent-view background workers can get stuck with:
Not logged in · Please run /login
while the foreground CLI is still authenticated and can make successful requests.
This appears isolated to the daemon / background-agent path, not the account credential itself. In this state, running /login is misleading because claude auth status still reports a valid Claude.ai OAuth login and foreground claude -p works.
Environment
- Claude Code:
2.1.201 - macOS:
26.2, arm64 - Auth: Claude.ai OAuth subscription
- Machine RAM: 34 GB
- Usage pattern: heavy
claude agents/ agent-view usage - Multiple
claude agentsclients were holding the same transient daemon open
Evidence
Foreground auth works:
claude auth status
# loggedIn: true
# authMethod: claude.ai
# subscriptionType: max
claude -p 'Reply exactly: OK'
# OK
Daemon status showed multiple agent-view clients holding the same daemon open:
holding this daemon open:
6 bg workers running (daemon waits for them to settle)
`claude agents` (pid ...)
`claude agents` (pid ...)
Daemon log around the failure:
[2026-07-04T15:19:43.744Z] [bg] bg: low memory (100MB free) — retiring settled workers before spawning 759425b4
[2026-07-04T15:19:43.745Z] [bg] bg spawned 759425b4 (fleet)
[2026-07-04T15:20:07.619Z] [bg] bg: low memory (121MB free) — retiring settled workers before spawning b4a22daf
[2026-07-04T15:20:07.621Z] [bg] bg spawned b4a22daf (fleet)
[2026-07-04T15:20:44.185Z] [bg] bg: low memory persists after shedding non-pinned — retiring pinned settled workers as a last resort
The affected job state showed a login block even though foreground auth was valid:
{
"state": "blocked",
"needs": "login required — run /login",
"respawnFlags": ["bypassPermissions"]
}
So permission mode was not the cause.
Expected behavior
If claude auth status is valid and foreground claude -p works, respawned background workers should also inherit or re-read the valid auth credential.
Low-memory worker retirement should not leave agent-view jobs in a false /login state.
If daemon auth is stale, claude daemon should re-read Keychain / credential state or surface a daemon-specific recovery message instead of telling the user to run /login in a session where the account is already logged in.
Actual behavior
Foreground CLI remains usable, but agent-view workers become blocked with /login.
The practical workaround is to restart the daemon, not to re-login:
claude daemon stop --any
claude agents --permission-mode bypassPermissions
After the daemon restart, the new daemon reads the valid credential and agent-view usage can continue.
Why this is confusing
The log line says low memory (100MB free), but on macOS this does not necessarily mean the machine is out of usable memory. At the time of investigation, the machine had 34 GB RAM and memory_pressure reported high system-wide available/free percentage, while raw free pages were low. The daemon appears to react to macOS pressure / raw free-memory signals and then respawn or retire workers. That may be reasonable, but the auth state after respawn becomes inconsistent with the foreground CLI.
Related issues
- #73631: low-memory retirement of settled agent-view workers / stale done sessions
- #72719: background workers fail under memory pressure without surfacing root cause
- #71757: daemon/keychain auth invalidation and
/loginstate - #70355: agent view sessions failing with
Not logged in