Feature request: --cwd CLI flag to set working directory at launch

Resolved 💬 4 comments Opened Apr 12, 2026 by ahl-gram Closed May 23, 2026

Feature Request

Add a --cwd <path> CLI flag so the working directory can be set at launch time.

Proposed flag

  • --cwd <path> — set the primary working directory (equivalent to cd <path> && claude)

Use case

When launching multiple Claude Code sessions (e.g., in separate terminal windows or via scripts), there's no way to set the working directory as a single command:

# desired
claude --cwd ~/projects/api

# current workaround
cd ~/projects/api && claude

The workaround changes the shell's directory and doesn't compose well in scripts, aliases, or launcher tools. A --cwd flag would make it a proper one-liner.

Notes

  • --cwd would set the primary working directory (distinct from existing --add-dir which adds supplemental directories without changing the primary)
  • --color was originally part of this request but is already covered by #40393, #35788, and #45387

View original on GitHub ↗

This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗