Summary
terminal-pilot create-session appears to start sessions from the workspace root/default directory instead of the current working directory of the invoking process when --cwd is omitted. This is easy to miss because normal CLI tools inherit cwd by default.
Repro
Run this from /Users/kjopek/Workspace/ashby-mcp/wire_ts, where the npm workspace @kamilio/wire exists:
terminal-pilot --version
terminal-pilot create-session --session tp-cwd-repro --observe -- zsh -lc 'pwd; npm publish --workspace @kamilio/wire --dry-run --access public --auth-type=web'\nterminal-pilot wait-for-exit --session tp-cwd-repro --timeout 60000\nterminal-pilot read-history --session tp-cwd-repro --last 80\n```\n\n## Observed\n\n```text\n0.0.39\n/Users/kjopek/Workspace/ashby-mcp\nnpm error No workspaces found:\nnpm error --workspace=@kamilio/wire\n```\n\n## Expected\n\nWithout `--cwd`, the PTY should inherit the current working directory of the `terminal-pilot create-session` invocation, matching normal shell command behavior. In this repro, `pwd` should print:\n\n```text\n/Users/kjopek/Workspace/ashby-mcp/wire_ts\n```\n\n## Workaround\n\nPassing `--cwd /Users/kjopek/Workspace/ashby-mcp/wire_ts` works and lets npm find the workspace.\n\n## Why this mattered\n\nDuring an npm publish flow, this produced a misleading workspace failure before auth:\n\n```text\nnpm error No workspaces found:\nnpm error --workspace=@kamilio/wire\n```\n\nThe publish worked up to the passkey auth prompt after rerunning with explicit `--cwd`.\n
Summary
terminal-pilot create-sessionappears to start sessions from the workspace root/default directory instead of the current working directory of the invoking process when--cwdis omitted. This is easy to miss because normal CLI tools inherit cwd by default.Repro
Run this from
/Users/kjopek/Workspace/ashby-mcp/wire_ts, where the npm workspace@kamilio/wireexists: