[BUG] Claude Code bg agents (spawned by claude daemon) don't load Claude.ai remote connectors
Preflight Checklist
- [x] I have searched existing issues - closest is #35899 (closed, fixed for
claude.ai/code/scheduledin 2.1.101). This bug is the CLI-side equivalent: background agents spawned viaclaude daemon(not via claude.ai scheduled tasks) still have no Claude.ai remote connectors. - [x] This is a single bug report
- [x] I am using the latest version of Claude Code (2.1.139)
What's wrong
Background agent sessions spawned by the local claude daemon (i.e. anything started as a bg job from an interactive session, including Agent sub-agents and /loop style work) do not load Claude.ai-namespaced remote connectors. The interactive claude CLI in a terminal loads them fine - it's specifically the bg-spawned child processes that don't.
Effect: any task that needs Slack, Notion, Gmail, Calendar, or Drive must be done in the interactive session. Bg agents can do local file work, but they can't read a Slack DM, search Notion, or check email - which is exactly the kind of independent fan-out work bg agents are built for.
Concrete repro from a live bg session
In a bg agent session (CLAUDE_CODE_AGENT=claude, CLAUDE_JOB_DIR=~/.claude/jobs/<id>), spawned by:
claude daemon run --origin transient --spawned-by "claude agents"
└─ ...--bg-pty-host ... --session-id <id> --agent claude
Tool inventory in this bg session:
- Loaded:
mcp__stripe__*,mcp__playwright__*,mcp__xmcp__*, plus standard tools - Missing:
mcp__claude_ai_Slack__*,mcp__claude_ai_Notion__*,mcp__claude_ai_Gmail__*,mcp__claude_ai_Google_Calendar__*,mcp__claude_ai_Google_Drive__*
ToolSearch for slack / notion returns "No matching deferred tools found".
claude mcp list from the same shell shows only the 3 locally-registered servers (playwright, xmcp, stripe) - the claude_ai_* connectors aren't in the local registry; they're attached by claude.ai at interactive session start, and that attachment isn't happening for bg-spawned children.
~/.claude/settings.json allowlist correctly contains mcp__claude_ai_Slack__* etc, so when these tools DO appear in an interactive session they work fine - the allowlist isn't the problem, the loader is.
What should happen
Background agent sessions spawned by claude daemon should inherit the same Claude.ai connector set as the parent interactive session, the same way they inherit ~/.claude/settings.json. If full inheritance is undesirable for cost/perf reasons, an opt-in flag (or a bg_connectors allowlist in settings.json) would work.
Why this is annoying in practice
Bg agents are explicitly the tool you reach for when you want fan-out / parallel work - "go research X across Slack/Notion/email while I keep coding." But those are exactly the connectors the bg session can't see. So the recommended pattern (use bg agents for parallel research) fights the actual capability (bg agents have no remote connectors).
Workarounds today:
- Run the task in the interactive session instead - defeats the point.
- Manually
claude mcp adda self-hosted server for each needed service - works, but every user has to re-install / re-auth servers that already work in their interactive session.
Steps to reproduce
- Sign in to Claude Code with Claude.ai connectors enabled (Slack, Notion, etc).
- Verify they work interactively (
/mcpshows them;ToolSearch slackfinds them). - From the interactive session, spawn a bg agent (any flow that triggers
claude daemon run --origin transient --spawned-by "claude agents"). - In the bg agent: run
ToolSearchforslackornotion. Observe: "No matching deferred tools found". - In the same bg agent: check
~/.claude/settings.json- the allowlist still contains themcp__claude_ai_*entries, but they're not loaded.
Environment
- Claude Code Version: 2.1.139
- Platform: macOS (Darwin 25.3.0)
- Process tree: bg agent under
claude daemon ... --origin transient - Env:
CLAUDE_CODE_AGENT=claude,CLAUDE_CODE_ENTRYPOINT=cli,CLAUDECODE=1,CLAUDE_JOB_DIR=~/.claude/jobs/<id>
Related
- #35899 - same root cause class (sessions spawned without human interaction don't init MCP connectors), but for claude.ai/code/scheduled. That was fixed in 2.1.101 for the scheduled-task path; the same fix doesn't appear to apply to local-CLI bg agents.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗