claude-code - 💡(How to fix) Fix [BUG] Claude Code bg agents (spawned by claude daemon) don't load Claude.ai remote connectors

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

  • #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.

Fix Action

Fix / Workaround

Workarounds today:

Code Example

claude daemon run --origin transient --spawned-by "claude agents"
└─ ...--bg-pty-host ... --session-id <id> --agent claude
RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues - closest is #35899 (closed, fixed for claude.ai/code/scheduled in 2.1.101). This bug is the CLI-side equivalent: background agents spawned via claude daemon (not via claude.ai scheduled tasks) still have no Claude.ai remote connectors.
  • This is a single bug report
  • 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:

  1. Run the task in the interactive session instead - defeats the point.
  2. Manually claude mcp add a 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

  1. Sign in to Claude Code with Claude.ai connectors enabled (Slack, Notion, etc).
  2. Verify they work interactively (/mcp shows them; ToolSearch slack finds them).
  3. From the interactive session, spawn a bg agent (any flow that triggers claude daemon run --origin transient --spawned-by "claude agents").
  4. In the bg agent: run ToolSearch for slack or notion. Observe: "No matching deferred tools found".
  5. In the same bg agent: check ~/.claude/settings.json - the allowlist still contains the mcp__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.

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