--cwd was defined as a Click option but also parsed manually from ctx.args, which caused conflicts when --cwd was followed by another flag (like --dangerously-skip-permissions). Now --cwd is parsed entirely manually, allowing: --cwd alone -> use current directory --cwd /path -> use specified path (none) -> use myclaude project root (default)