Monitor notifications should not influence session title generation

Resolved 💬 1 comment Opened May 8, 2026 by edimuj Closed May 12, 2026

Problem

When a plugin defines a declarative monitor (via monitors.json), the monitor's initial output is emitted before the user types anything. Claude Code treats this as the first "prompt" and generates the session title from it — overwriting any terminal title the user or their tooling set.

For example, the agent-relay plugin has a monitor that registers the agent and emits connection context at session start. This causes every session to be titled something like:

"Set up Agent Relay inbox monitorin (project-name)"

…instead of reflecting the user's actual first prompt.

Expected behavior

Session title should be derived from the user's first prompt, not from background monitor/task notifications. Monitor output is plugin infrastructure — it shouldn't drive the user-facing session name.

Reproduction

  1. Install a plugin with a declarative monitor that emits output at session start
  2. Start a new Claude Code session
  3. Observe the session/terminal title is based on the monitor output, not the user's first prompt

Suggested fix

Exclude monitor events (task notifications) from the title generation input. Only use actual user prompts to generate the session title.

View original on GitHub ↗

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