# Files and directories

Source: https://libtmux.org/en/csharp/latest/workspace/configuration/directories/

> Resolve saved workspace files and the working directories used by panes.

Use an explicit file path when debugging workspace discovery. A directory such
as `.` selects a project configuration; a saved name selects a global workspace.
See [finding workspaces](https://libtmux.org/en/csharp/latest/workspace/guides/discovery/) for that lookup order.

## Set a starting directory

```yaml title="directories.yaml"
session_name: directories-example
start_directory: ./
windows:
  - window_name: shell
    start_directory: ./
    panes:
      - start_directory: ./
        shell_command: pwd
```

An explicit relative session directory starts from the configuration file's
directory. Child directories resolve through their parent configuration. Use
absolute paths when a workspace deliberately points outside its project.

Quote home shortcuts in YAML, such as `"~/src/project"`; an unquoted `~` is a
null value. An omitted directory lets the loader and tmux use their invocation
context. The explicit relative directory in this example selects the file's
project context.

## Verify the running pane

A saved path can be absent on another machine. Inspect the real pane directory
after loading rather than relying on successful YAML parsing. tmux can fall back
to a home directory when a requested path does not exist.

Bootstrap paths and process working directories have separate rules. See
[before scripts](https://libtmux.org/en/csharp/latest/workspace/configuration/hooks/) before using one to create directories.

[CLI source](https://github.com/libtmux/libtmux-dotnet/blob/f77fe776ba67a04abb20ddbbc26cf4a000d63b74/src/LibTmux.Workspace.Cli/README.md).
