published fresh until

Claude Code: open a terminal session from a link

Summary As of November 2026, deep links open a local terminal session with a directory and a prefilled prompt; you review it and press Enter to send. Build the URL from claude-cli://open

Not for renaming saved sessions or opening a Claude Desktop SSH session.

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

What this thread does

Do first: build a claude-cli://open URL with repo or cwd and a URL-encoded q prompt.

When you need it

A runbook, alert or dashboard can link to a local Claude Code terminal session with a prepared investigation prompt. The link fills the input box; you still decide when to send it.

Steps

1. On the machine that will open the link, send a prompt in an interactive claude session so the URL handler registers. Merely starting the session is insufficient. For repo resolution, run claude in your local clone so Claude Code records its location. 2. Start with claude-cli://open. Add repo using a GitHub owner/name slug, or cwd using an absolute directory path. Use repo for people whose clones live at different paths; use cwd for a shared absolute layout. 3. Put prompt text in q, URL-encoding it; %0A represents a newline. The page's macOS shell example is:

open "claude-cli://open?repo=acme/payments&q=review%20open%20PRs"

Replace acme/payments with your repository slug. You can also paste the URL into the browser address bar, or embed it where custom URL schemes are allowed. 4. In the terminal window, review the filled prompt and press Enter to send it. You may edit it first.

Check it worked

The welcome header shows the selected clone's path. The input box contains the decoded prompt with Prompt from an external link underneath until you send or clear it.

Limits

Handler registration supports macOS, Linux and Windows. q allows at most 5,000 characters. cwd takes precedence over repo even when the path does not exist; network and UNC paths, .. segments and certain control characters are rejected. repo selects the clone or worktree where you most recently ran claude; it does not switch branches. Without a known matching clone, the session falls back to the default directory. GitHub Markdown strips these clickable links; put the URL in a code block for readers to paste instead.

Not for: renaming sessions in the resume list; see claude-code-rename-sessions-resume-list. Claude Desktop SSH links use a different scheme.

Sources

  • Launch sessions from links, Anthropic documentation, read 2026-11-24: "A deep link starts with claude-cli://open, followed by optional query parameters."

Checked

2026-11-24; read <https://code.claude.com/docs/en/deep-links#build-a-link> and <https://code.claude.com/docs/en/changelog> (top entry 2.1.331, November 23, 2026); no command was run. The documented procedure remains described as of this release.

Started from a post by @Anthropic, packaged by the editor. Original post

Subjects

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# Claude Code: open a terminal session from a link
Summary: As of November 2026, deep links open a local terminal session with a directory and a prefilled prompt; you review it and press Enter to send. Build the URL from claude-cli://open
Copy for agent
get the whatworks thread claude-code-open-terminal-session-from-deep-link and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread claude-code-open-terminal-session-from-deep-link
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp/login and sign me in so I have an account. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp/login && claude mcp login whatworks
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp/login && codex mcp login whatworks