Learning resourcesReviewed · Anthropic

Claude Code: Launch sessions from links

This guide shows Claude Code users how to open local coding sessions from links, but each computer needs setup before the links work. Links can choose a project folder and fill in a prompt, which remains unsent until the user presses Enter.

Researched 25 Nov 2026

In short.

This guide helps developers and incident responders launch Claude Code from shared links, but it needs setup on each computer and does not send the prepared prompt automatically. It explains URL parameters, local repository selection, operating-system registration, terminal preferences and common failures. It provides concrete integration instructions; compatibility with particular installations, operational reliability and costs are not established by the supplied evidence.

Researched and written by an AI model and checked by a second AI model. How it works

The scope is the entire documentation page at [https://code.claude.com/docs/en/deep-links.md], including URL construction, repository resolution, external-prompt notices, platform registration, examples, opt-out settings and troubleshooting. The documentation index and every linked page are excluded. Related VS Code, Desktop, skills and non-interactive options are described only to the extent stated on this page. No commands, links, sessions or platform behavior were executed or tested.

The overview

Identity

Launch sessions from links is a Claude Code documentation guide at [https://code.claude.com/docs/en/deep-links.md]. It teaches the claude-cli URL scheme, which opens a local Claude Code terminal session with an optional working directory and prepared prompt.

Assessment

The guide is useful for adding consistent investigation or onboarding starting points to runbooks, dashboards and notifications. Its strength is practical detail: it explains both link construction and the machine setup that makes links work. It provides no measurements of reliability, time savings or the quality of Claude Code's subsequent work.

Users

Likely users include on-call engineers preparing incident runbooks, developers investigating CI failures, and maintainers writing project onboarding instructions. Beginners get an explanation of how a link reaches a local terminal; experienced developers get parameter rules, repository-resolution behavior and platform-specific registration details.

Capabilities

The minimal URL, [claude-cli://open], opens Claude Code in the user's home directory with an empty prompt. The q parameter supplies prompt text, cwd supplies an absolute working-directory path, and repo supplies a GitHub owner/name identifier.

The q value must be URL-encoded, with %0A representing line breaks, and has a documented maximum of 5,000 characters. Links can appear in documents, alerts or dashboards that permit custom URL schemes, and operating-system URL-opening commands can launch them from a shell.

Using it

Requirements

The receiving computer needs Claude Code, a registered claude-cli handler and a usable terminal environment. The documented operating systems are macOS, Linux and Windows. The app displaying the link must allow custom URL schemes.

Repository links require a local clone or worktree whose location Claude Code has previously recorded. Linux shell launching also needs xdg-open, normally supplied by xdg-utils, and a desktop environment capable of dispatching the URL. The page does not specify minimum Claude Code versions or account-plan requirements.

Mechanism

The browser or other app passes the URL to the operating system, which invokes the registered handler and opens Claude Code in a new local terminal window. The prepared prompt is editable and reaches the model only after Enter. A warning identifies its external origin until it is sent or cleared; prompts longer than 1,000 characters also receive a character count and review reminder. Existing permission rules, CLAUDE.md instructions and directory trust prompts still apply.

For repo, Claude Code selects the matching clone or worktree where claude was most recently run. It records clones and worktrees separately, preserves the directory's current branch, and shows the chosen path in the welcome header. An unknown repository opens in the home directory.

Setup

The documented registration step is to start an interactive claude session and send a message or /help; starting a session without sending anything is insufficient. Starting agent view in a trusted folder also registers the handler. Registration writes only to user-level locations.

macOS remembers the terminal used for the most recent interactive session. Linux tries $TERMINAL, then x-terminal-emulator, then common emulators. Windows prefers Windows Terminal, then PowerShell, then cmd.exe. Shell launchers are open on macOS, xdg-open on Linux and Start-Process in PowerShell; cmd.exe requires an empty window-title argument before the quoted URL.

To prevent registration, set disableDeepLinkRegistration to "disable" in settings.json. Managed settings can enforce this across an organization. This setting covers claude-cli links only.

Example

A supplied example is [claude-cli://open?repo=acme/payments&q=review%20open%20PRs]. With registration complete and the repository previously recorded, it is intended to open a local Claude Code terminal session and fill the prompt with review open PRs. Replace acme/payments with your repository identifier, confirm the chosen directory and review the prompt before pressing Enter. This example was not executed.

Assessment & evidence

Limitations

Sessions open on the computer where the link is clicked. A repo link depends on previously recorded local paths and leaves the existing branch unchanged. If both cwd and repo are supplied, cwd takes precedence even when its path does not exist; the page does not explain the resulting behavior for that nonexistent directory. Network and UNC paths, paths containing parent-directory segments, and paths containing invisible or bidirectional control characters are rejected.

GitHub removes custom-scheme links from rendered READMEs, issues, pull requests and wikis. The documented workaround is to display the URL in a code block for readers to copy into their browser. On Linux, installing xdg-utils may supply xdg-open, but a missing desktop environment can still prevent a terminal from opening.

Fit considerations

For shared runbooks, repo is the practical choice described by the guide because different users can keep clones in different locations. The cwd option suits standardized machines where everyone uses the same absolute path. The documented behavior makes these links prepared starting points for sessions that a person reviews and submits; the links alone do not carry out an investigation.

Related options

The page identifies [vscode://anthropic.claude-code/open] as the VS Code extension's separate route for opening a Claude Code editor tab. It also points to Claude Desktop links for SSH sessions and non-interactive mode for scripts that capture output without opening a terminal.

For long runbook prompts, it suggests storing the instructions as a repository skill and using q to name that skill. The linked instructions for these options are outside scope, so their detailed setup, parameters and limitations are not assessed.

Evidence

The source is the complete Claude Code documentation page at [https://code.claude.com/docs/en/deep-links.md]. Its explanations and examples establish documented behavior. No software, commands, links or sessions were executed, so runtime reliability, platform compatibility and the results of subsequent AI work were not tested.

Access & freshness

Costs

The page states no price for deep linking, Claude Code access or model usage. Subscription requirements, plan restrictions and total cost are unknown from this source.

Rights

The supplied page contains no licence or reuse notice establishing rights to redistribute its text or examples. Claude Code's software licence and commercial terms are also not established here.

Freshness

The source snapshot was captured on 25 November 2026 at 11:37:33.935 UTC, with source revision sha256:4d64afda0bac880b9e8f6f2d9568aaa5b221ce22c00fe1606dfbdc0c03c35f06. The page supplies no last-updated date or minimum compatible release. Support in a particular installed version and changes after capture are unknown.

Getting started

Register the handler on each target computer and run claude in each repository that shared repo links should recognize. Choose repo for varying local paths or cwd for a standardized absolute path, then URL-encode the prompt. Confirm that the hosting app supports custom schemes; for GitHub, display the URL in a code block for copying. On first use, check the welcome header's path, the current branch and the full prompt before submitting it.

Evidence for this report

selected-page.txtselected · checked 2026-11-25