claude-code - 💡(How to fix) Fix Feature request: --name flag for claude --bg [1 comments, 2 participants]

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…
GitHub stats
anthropics/claude-code#58764Fetched 2026-05-14 03:40:05
View on GitHub
Comments
1
Participants
2
Timeline
3
Reactions
0
Timeline (top)
labeled ×2commented ×1

Fix Action

Fix / Workaround

Problem

Currently when using claude --bg to start background sessions, sessions are auto-named (e.g., "agent-view", "session-12345"). Renaming sessions requires manual interaction via Ctrl+R search and select. This creates friction when running multiple background sessions, especially in automation workflows like dispatch-ticket.sh.

Use Case: dispatch-ticket.sh Integration

The dispatch-ticket.sh script starts background sessions for processing tickets. A --name flag would allow the script to automatically name sessions with meaningful identifiers like "TICKET-123: Feature Request", making session management more intuitive and reducing manual overhead.

Current Workaround

# Current: Manual renaming required
claude --bg "analyze user request"
# Then use Ctrl+R to search and rename the session

Code Example

# Current: Manual renaming required
claude --bg "analyze user request"
# Then use Ctrl+R to search and rename the session

---

# Proposed: Direct naming
claude --bg --name "TICKET-123: Feature Request"
# Results in session named "TICKET-123: Feature Request"
RAW_BUFFERClick to expand / collapse

Feature request: --name flag for claude --bg

Problem

Currently when using claude --bg to start background sessions, sessions are auto-named (e.g., "agent-view", "session-12345"). Renaming sessions requires manual interaction via Ctrl+R search and select. This creates friction when running multiple background sessions, especially in automation workflows like dispatch-ticket.sh.

Use Case: dispatch-ticket.sh Integration

The dispatch-ticket.sh script starts background sessions for processing tickets. A --name flag would allow the script to automatically name sessions with meaningful identifiers like "TICKET-123: Feature Request", making session management more intuitive and reducing manual overhead.

Current Workaround

# Current: Manual renaming required
claude --bg "analyze user request"
# Then use Ctrl+R to search and rename the session

Proposed Solution

Add a --name flag to claude --bg:

# Proposed: Direct naming
claude --bg --name "TICKET-123: Feature Request"
# Results in session named "TICKET-123: Feature Request"

Requirements

  • Accept a string argument for session name
  • Apply the name immediately when starting the background session
  • Persist the name across session lifecycle
  • Support names with spaces and special characters
  • Maintain existing behavior when flag is not provided (auto-generated names)

Benefits

  1. Automation-friendly: Scripts can set meaningful session names automatically
  2. Reduced manual interaction: No need for Ctrl+R renaming
  3. Better session tracking: Easy to identify sessions by purpose/ticket ID
  4. Improved UX: Clear session organization in agent view

Implementation Considerations

  • Flag should be positional or named (e.g., --name or -n)
  • Session names should be visible in claude --list
  • Consider validation for session name format (max length, reserved chars)
  • Ensure compatibility with existing session management features

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

claude-code - 💡(How to fix) Fix Feature request: --name flag for claude --bg [1 comments, 2 participants]