Programmatically open a new GUI session with an initial prompt
Resolved 💬 3 comments Opened May 10, 2026 by apfeiff-agts Closed May 14, 2026
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.SessionStarthook: 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:
- A documented
claude://new?prompt=…URL scheme that opens the Desktop app with the prompt prefilled (or sent automatically). macOS / Linux / Windows. - A CLI flag like
claude --gui --initial-prompt-file kickoff.mdthat opens the Desktop app session and either pastes or sends the prompt as the first user turn. - 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!
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗