HarnessesWorking Directories
Working Directories
How Coven handles --cwd for harness sessions and why working directories cannot escape the project boundary.
1 min read
A working directory is the directory where the harness process starts. Coven lets you choose one with --cwd, but it must resolve inside the project root.
cd /path/to/project
coven run codex "audit the API package" --cwd packages/apiValidation rule
The effective working directory must canonicalize inside the session's project root.
| Input | Expected result |
|---|---|
--cwd packages/api | Allowed when packages/api is inside the project root. |
--cwd . | Allowed; starts from the project root/current project context. |
--cwd ../other-project | Rejected if it escapes the project root. |
| Symlink escape | Rejected after canonicalization if it resolves outside the root. |
Why clients should still send cwd
Good clients know the user's active pane or package folder. They should pass that as a convenience. But clients are not the trust boundary, so the daemon revalidates.
Troubleshooting
If a launch fails with a cwd error:
- Run
pwdand confirm you are inside the expected project. - Run
coven doctorto confirm project detection. - Use a relative
--cwdthat exists inside the project. - Avoid symlinks when testing the boundary.
See CLI run reference for full command syntax.
Was this page helpful?No
Last updated on