# Working directories and configuration

> Control where Codex works and how the child CLI process is configured.

Codex runs in the current working directory by default. Set `workingDirectory` per thread when embedding it:

```ts
const thread = codex.startThread({
  workingDirectory: "/path/to/repository",
  skipGitRepoCheck: false,
});
```

Use `config` for structured CLI configuration and `configOverrides` for raw TOML values. Raw overrides are applied after structured values and take precedence; SDK-managed settings and thread-specific options are applied afterward.

```ts
const codex = new Codex({
  env: { PATH: "/usr/local/bin" },
  config: { show_raw_agent_reasoning: true },
  configOverrides: ["permissions.audit.filesystem={\"/path/to/repo\"=\"read\"}"],
});
```

Use `skipGitRepoCheck` only when the host has deliberately chosen a non-repository working directory.
