Background session silently starts with zero plugin skills (~1 in 44), permanent for that session

Status Open
Reported on v2.1.241
Maintainer reply None cached
Activity 1 comment · opened Aug 24, 2026

What happened

A background session (claude --bg / agent view) started with zero plugin skills. All three enabled plugins were affected identically — none of their skills appeared in the session's skill list, and Skill() returned Unknown skill for every one. The session never recovered: it failed again 10.5 hours later, in the same session.

Nothing announced the gap. From inside the session the plugins simply did not exist.

Environment

  • Claude Code 2.1.241, macOS 15 (Darwin 25.6.0), installed via homebrew npm global
  • Plugins enabled in ~/.claude/settings.json: compound-engineering@compound-engineering-plugin, vercel@claude-plugins-official, frontend-design@claude-plugins-official
  • Failing session: sessionKind: "bg", cliVersion: 2.1.241, created 2026-08-24T06:45:30Z
  • Daemon log: [2026-08-24T06:45:06.507Z] [bg] bg claimed-spare fb8acd27 (spare)

What I ruled out

  • Not the plugins or their files. All three install paths were present and complete on disk before, during and after the failure (32, 30 and 1 skill directories). claude plugin list reports all three enabled, 6/6 runs.
  • Not settings. enabledPlugins was present and correct throughout; the session verified this itself mid-run.
  • Not background sessions as a class. Other sessionKind: "bg" sessions on the same machine, same version, same cwd, same settings, loaded all plugin skills fine — including one started 2 hours earlier (692e8dca, 04:41Z) and one started 20 minutes later.
  • Not a version change, worktree, or resume. Identical cliVersion; the failure occurred in the main checkout before any worktree existed.

Frequency

Across every session transcript on this machine since 2026-07-24 (44 sessions that invoked Skill()), 43 loaded plugin skills successfully and exactly 1 loaded none. So roughly 1 in 44, silent, and permanent for the affected session's lifetime.

Suspected mechanism (not confirmed)

Background sessions claim a pre-warmed spare host process from a pool (bg claimed-spare … (spare) in ~/.claude/daemon.log). Those spares are long-lived — I observed one still pooled and unclaimed after 14 hours. If a spare's plugin discovery fails or completes empty at spawn, every job that later claims that spare would inherit an empty skill registry with no error surfaced.

I could not confirm this locally: daemon.log never logs plugin loading at all, and nothing records which spare pid a given session claimed.

Suggested fixes

  1. Log plugin discovery outcome (count per plugin, or the failure) at session start, so an empty registry is visible rather than silent.
  2. Record the claimed spare's id/pid alongside bg claimed-spare in daemon.log, so a failing session can be traced to its spare.
  3. Consider validating a spare's plugin registry at claim time, and discarding/respawning a spare whose registry is empty while plugins are enabled on disk.

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗