claude-code - 💡(How to fix) Fix Programmatically open a new GUI session with an initial prompt [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#57887Fetched 2026-05-11 03:22:47
View on GitHub
Comments
1
Participants
2
Timeline
4
Reactions
0
Timeline (top)
labeled ×3commented ×1
  • Use case is part of an internal sprint-closing automation that already handles git tag/push, review-HTML generation, cross-team handoff briefs, and clipboard via pbcopy. Tier 1 ("clipboard + Telegram nudge, user opens session manually and ⌘V") works fine but the last 5 seconds are still manual.
  • This isn't time-critical, but a documented path would let me close the loop completely. Happy to test betas.

Thanks for considering!

Root Cause

  • Use case is part of an internal sprint-closing automation that already handles git tag/push, review-HTML generation, cross-team handoff briefs, and clipboard via pbcopy. Tier 1 ("clipboard + Telegram nudge, user opens session manually and ⌘V") works fine but the last 5 seconds are still manual.
  • This isn't time-critical, but a documented path would let me close the loop completely. Happy to test betas.

Thanks for considering!

RAW_BUFFERClick to expand / collapse

Use case

I'm running a multi-sprint workflow across several repos. At the end of each sprint, I auto-generate a "next-sprint kickoff" markdown file (sprint plan, open ADRs, trigger phrase). Today the only way to start the new session with that prompt inside the Claude Code Desktop app is to manually open a new session, paste, and hit enter.

I'd like to do that programmatically — ideally so that an automation on my Mac (or on a remote VPS sending me a Telegram nudge) can hand off the kickoff prompt directly into a GUI session that shows up in the Desktop app's session history.

What I tried (and why it didn't work)

  • claude "$(cat kickoff.md)" from the terminal: works, returns a session ID, but the session does not appear in the Desktop app's session list. Verified on Claude Code CLI v2.1.138.
  • SessionStart hook: the hook fires, but it can't inject the kickoff content as a user turn — only as system context. So the assistant doesn't actually act on the prompt the way it would after a manual paste.
  • No documented URL scheme (claude://...) and no public IPC to instantiate a Desktop-app session from outside.

What would unblock this

Any of the following, in order of preference:

  1. A documented claude://new?prompt=… URL scheme that opens the Desktop app with the prompt prefilled (or sent automatically). macOS / Linux / Windows.
  2. A CLI flag like claude --gui --initial-prompt-file kickoff.md that opens the Desktop app session and either pastes or sends the prompt as the first user turn.
  3. A hook (SessionStart-like) that can submit the initial prompt as a user turn, not just as system context.

Context

  • Use case is part of an internal sprint-closing automation that already handles git tag/push, review-HTML generation, cross-team handoff briefs, and clipboard via pbcopy. Tier 1 ("clipboard + Telegram nudge, user opens session manually and ⌘V") works fine but the last 5 seconds are still manual.
  • This isn't time-critical, but a documented path would let me close the loop completely. Happy to test betas.

Thanks for considering!

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 Programmatically open a new GUI session with an initial prompt [1 comments, 2 participants]