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

Resolved 💬 3 comments Opened May 13, 2026 by sporebattyl Closed May 17, 2026

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

View original on GitHub ↗

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