PR created in a foreground session isn't linked on its agents-view entry after /bg

Resolved 💬 2 comments Opened Jun 25, 2026 by cjwilliams Closed Jun 28, 2026

The Claude Code agents view lists only background processes, so a foreground session is correctly absent from it. The problem is what happens after /bg.

Summary

A session created a PR (via a bare gh pr create) while running in the foreground, so it was correctly not shown in the agents view at that time. After running /bg, the session became a background process and appeared in the agents view, but the PR it created is not associated with its entry.

Environment

  • Claude Code 2.1.191
  • macOS (Darwin 25.5.0)

Steps to reproduce

  1. Start a foreground interactive session in a git repo (in this case a git worktree under .claude/worktrees/).
  2. Commit and push a branch, then create a PR with a bare gh pr create (no piping or output filtering). The session is foreground, so it does not appear in the agents view. This is expected.
  3. Run /bg to background the session. It becomes a background process and now appears in the agents view (under a job dir such as ~/.claude/jobs/<id>).
  4. The session's agents-view entry does not show or link the PR created in step 2.

Expected

Backgrounding a foreground session that created a PR should surface that PR on its agents-view entry.

Actual

No PR link appears on the backgrounded session's agents-view entry.

🤖 Filed by Cherie Williams's AI agent (Claude Code).

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗