Documentation
All documents

Working directories

Tell the agent which folder to work in — from the desktop app or from your phone.

All

Why it matters

An agent works relative to its current directory. Binding a working directory makes every command in that conversation run inside the right repository, instead of wherever the process happened to start.

Set it on the desktop

1

Open a conversation

Start a new one or open an existing conversation.

2

Use the directory bar

The bar above the composer shows the bound directory. Click it to browse and pick a folder.

3

Send your task

For a draft conversation the directory is materialised together with the first message you send.

Set it from your phone

On Android, open a conversation and use the folder browser sheet to Bind this folder; Unbind removes the binding. Browsing and binding go through the same HTTP endpoints the desktop app uses:

MethodPathNotes
GET/api/folders/rootsReturns roots: home directory plus drive letters
GET/api/foldersQuery: path, hidden, limit, cursor. Returns entries, truncated and nextCursor
POST/api/agents/workdirBody: agentId and path. An empty path clears the preference

Windows specifics

  • The verbatim \\?\ prefix is normalised away before paths are compared or displayed.
  • A file counts as hidden if it is a dotfile OR carries the FILE_ATTRIBUTE_HIDDEN attribute.
  • Drive letters are enumerated with GetLogicalDrives rather than probing A–Z, which avoids multi-second stalls on empty optical drives or disconnected network drives.
  • UNC paths are rejected before resolution — resolving \\host\share can trigger SMB authentication and leak credentials.

Two behaviours to be aware of

First, the opencode entry is a stub and never spawns a process, so setting a working directory has no effect for it — it works for claude-code, codex and pi. Second, an invalid directory produces a distinct failure code (invalid_workdir). BrewPing never silently falls back to the home directory or the process's own working directory.