Agent view: use the opened PR's title as the session name

Open 💬 0 comments Opened Jun 18, 2026 by dylanTesouro

What

In agent view (claude agents), each session's row name is auto-generated by a Haiku-class model from the prompt. But for any session whose purpose is to land a PR, a far more accurate, human-meaningful label already exists: the title of the PR the session opened. Agent view already tracks that PR (it renders a PR #1234 label on the row), so the title is right there.

Please add the ability to use the opened PR's title as the session name.

Why

When you run many parallel/background sessions, the Haiku-generated names ("embedded systems integration", "webhook payload integration", and occasionally literal failures like "i need more context to provide a label") don't tell you which session is which at a glance. The PR title is concrete, stable, and is usually exactly what the session is working on — a much stronger signal than a summary of the opening prompt.

Suggested behavior

  • Opt-in setting (e.g. agentView.nameFromPRTitle: true), or make it the default once a session has an open PR.
  • Apply only while nameSource is still auto — never overwrite a name the user set via --name / Ctrl+R. (This is the recurring complaint in #68493 / #69188.)
  • Update the name when a PR is opened mid-session or its title changes.
  • Multi-PR sessions: first PR's title + a (+N) suffix.

Related

  • #67858 — "let the model set the session name" (same pain, different mechanism)
  • #68493, #69188 — don't clobber manually-set names (the constraint above)
  • #25870 — --session-name flag (manual counterpart)

Note

This is very doable in userland today as a stopgap, which is partly why it feels like a natural built-in: the opened PR is recorded in ~/.claude/jobs/<id>/state.json under children ([{ href: ".../pull/N", kind: "pr" }]), and writing name + nameSource: "user" there (what Ctrl+R does) pins it. A small script that reads children, runs gh pr view --json title, and writes the name produces rows like (PROJ-1234) add endpoint to list applications instead of a vague summary.

View original on GitHub ↗