ailinks:

Claude Code/open-directory

Open a session in a directory

Opens Claude Code at an absolute path, with a prompt pre-filled.

macos · linux · windows · updated 2026-07-12

Format

claude-cli://open?cwd={cwd}&q={prompt}

Try it

claude-cli://open?cwd=/srv/web-gateway&q=review%20open%20PRsOpen

What you supply

{cwd}

Absolute path to open the session in.

Network and UNC paths are rejected, as are paths containing invisible or bidirectional control characters.

{prompt}optional

Text to pre-fill in the prompt box. Sent only when the reader presses Enter.

URL-encode it. Use %0A for line breaks. Maximum 5,000 characters.

Use this only when everyone clicking the link has the project at the same absolute path — a standardised devcontainer, a VM image, your own machine. For a link you are sharing with other people, open-repo is almost always the right one, since it resolves to wherever they happen to keep the code.

If you pass both cwd and repo, cwd wins and repo is ignored — even when the cwd path does not exist.

Omit both and the session opens in the home directory with an empty prompt, which makes bare claude-cli://open a valid link in its own right.