Skip to content

Codex App: allow configuring default directory for projectless thread workspaces #22875

Open

Description

@ksbalas

What version of the Codex App are you using (From "About Codex" dialog)?

26.513.20950 (2816)

What subscription do you have?

ChatGPT user, default service tier shown as fast

What platform is your computer?

Darwin 25.4.0 arm64 arm

What issue are you seeing?

Codex App creates new projectless thread workspaces under a fixed ~/Documents/Codex/<date>/<slug> directory. I want projectless/generated local workspaces to default to a user-chosen directory, for example ~/projects, but I could not find a documented ~/.codex/config.toml setting or app setting for this.

Observed local state for a projectless thread points at:

"thread-workspace-root-hints": {
  "<thread-id>": "/Users/<user>/Documents/Codex"
}

The generated workspace for a new projectless thread was:

/Users/<user>/Documents/Codex/2026-05-15/<thread-slug>

I also checked the documented Codex configuration reference and found settings for trusted projects, sandbox writable roots, project root markers, etc., but no documented option for the projectless workspace root/default generated project directory.

What steps can reproduce the bug?

  1. Open Codex App on macOS.
  2. Start a new projectless chat/thread rather than opening an existing project folder.
  3. Ask Codex to create or inspect local files.
  4. Observe that the current working directory is created under ~/Documents/Codex/<date>/<thread-slug>.
  5. Check ~/.codex/config.toml and the Codex configuration docs for a setting to change this default to another root such as ~/projects.

What is the expected behavior?

Codex App should provide a documented setting to choose the default root directory for projectless/generated local workspaces.

For example, either a UI setting or a documented config key such as:

projectless_workspace_root = "/Users/<user>/projects"

With that configured, new projectless threads would be created under:

/Users/<user>/projects/Codex/<date>/<thread-slug>

or another documented structure under the chosen root.

Additional information

Related but distinct issue: #10599 covers configuring Git worktree location under ~/.codex/worktrees. This report is about the Codex App's projectless thread workspace location under ~/Documents/Codex.

Activity

  1. added
    enhancement
    app
    on May 15, 2026
  2. TargiX commented on Jul 10, 2026

    @TargiX

    I can confirm this has a significant real-world impact when the macOS Documents directory is mirrored by a cloud-storage client.

    Environment:

    • Codex App 26.707.31428 (5059)
    • macOS 26.4.1 (25E253), Apple Silicon
    • Google Drive for desktop 127.0.1.0

    A projectless Codex workspace under:

    /Users/<user>/Documents/Codex/2026-06-06/<thread>/work/mui-x/
    

    contained a large repository with node_modules. Because Google Drive was configured to mirror the standard Documents folder, DriveFS continuously attempted to checksum and upload those generated development artifacts.

    The observed failure loop repeatedly produced errors such as:

    Checksumming .../node_modules/<package> failed with FAILED_PRECONDITION:
    Could not read 8388608 bytes from file ...: Is a directory
    
    UploadRetryMergeQueueItem: attempts=20 ... PARTIAL_RESULTS
    

    During the loop:

    • Google Drive consumed approximately 190% CPU and 2 GB RAM.
    • Its drive_fs.txt log reached approximately 128 MB and rotated every 2–3 minutes.
    • Antivirus scanning of the same filesystem churn consumed approximately another full CPU core.
    • Restarting Drive did not resolve the problem because it resumed the same upload retry queue.

    This is not merely an organizational preference: Documents is commonly selected for iCloud Drive, Google Drive, OneDrive, backup, and enterprise redirection. Putting repositories, dependency trees, symlinks, build outputs, and temporary agent workspaces there can trigger large uploads, indexing, conflict handling, and retry loops without the user realizing that a projectless chat created them.

    Suggested behavior:

    1. Provide a supported UI/config option such as projectless_workspace_root.
    2. Default projectless workspaces to an application-data/cache location such as ~/Library/Application Support/Codex/Workspaces or ~/.codex/workspaces, rather than ~/Documents.
    3. During onboarding, clearly explain if the chosen directory may contain repositories, dependencies, and build artifacts.

    Opening an existing project under ~/repos avoids the issue, but it does not address casual/projectless chats, which are precisely where users are least likely to anticipate a generated repository under a cloud-synced Documents folder.

  3. TargiX commented on Jul 10, 2026

    @TargiX

    I also traced the current public main implementation (4ba28150146e8ae8e949a07951639a929f5ddeae) to identify the smallest likely implementation seam.

    The public app-server already accepts a client-selected working directory through ThreadStartParams.cwd:

    pub struct ThreadStartParams {
    #[ts(optional = nullable)]
    pub model: Option<String>,
    #[ts(optional = nullable)]
    pub model_provider: Option<String>,
    /// Allow a provider with an authoritative static model catalog to replace an unavailable
    /// requested model with its default.
    #[experimental("thread/start.allowProviderModelFallback")]
    #[serde(default, skip_serializing_if = "std::ops::Not::not")]
    pub allow_provider_model_fallback: bool,
    #[serde(
    default,
    deserialize_with = "crate::protocol::serde_helpers::deserialize_double_option",
    serialize_with = "crate::protocol::serde_helpers::serialize_double_option",
    skip_serializing_if = "Option::is_none"
    )]
    #[ts(optional = nullable)]
    pub service_tier: Option<Option<String>>,
    #[ts(optional = nullable)]
    pub cwd: Option<String>,

    It also already persists opaque Desktop-owned settings under the [desktop] config table:

    /// Settings for app-specific controls.
    #[serde(default)]
    pub apps: Option<AppsConfigToml>,
    /// Opaque desktop settings stored alongside the rest of config.toml.
    #[serde(default)]
    pub desktop: Option<HashMap<String, JsonValue>>,

    I could not find the Documents/Codex literal or the projectless workspace path-selection logic in the public repository. This suggests the path is selected by the Desktop client before it sends thread/start, rather than by the Rust app-server.

    A minimal implementation therefore appears to be Desktop-owned:

    1. Store a setting such as desktop.projectlessWorkspaceRoot using the existing opaque Desktop config map.
    2. Add a directory picker under Desktop workspace settings.
    3. When creating a projectless thread, generate the date/slug directory under that root and pass it as the existing thread/start.cwd value.
    4. Keep existing thread paths unchanged; apply the setting only to newly created projectless threads.
    5. Validate that the selected root is absolute, creatable, and still available. If it becomes unavailable, prompt the user rather than silently reverting to a cloud-synced Documents directory.
    6. Test macOS and Windows path selection, removed/unmounted roots, permissions, and restart persistence.

    This should not require a new app-server protocol field, and may not require any Rust change at all unless the team prefers a typed config key instead of the existing Desktop settings map.

    I understand that external PRs are invitation-only. If there is a useful public-repository portion of this fix and this direction matches the intended architecture, I would be happy to prepare a focused invited PR. Otherwise, I hope this narrows the internal Desktop change enough to make it straightforward to pick up.

  4. acidrew commented on Jul 13, 2026

    @acidrew

    This default creates recurring cleanup work for me. Codex generates projectless workspaces under ~/Documents/Codex, although my actual projects live elsewhere. I repeatedly have to inspect and remove this tree manually, while moving or deleting it can break existing threads because they retain the original working directory.

    This is a bad default for generated development artifacts. Users should be able to configure the workspace root, and Codex should default to an application-data or cache directory rather than Documents.

    Please prioritize a supported projectless_workspace_root setting in the desktop UI or config.toml.

  5. AxicomBrian commented on Jul 16, 2026

    @AxicomBrian

    Adding to the chorus of this is a huge issue for corporate users. My company doesn't let me exclude any folders under Documents from OneDrive sync, so now OneDrive and related file operations are constantly pegging my CPU with "Uploading 10,000 files" - and for what it's worth, this was not an issue for me prior to the new ChatGPT Work/Codex app. Thanks for all you do, OpenAI team!

  6. oneES1 commented on Jul 28, 2026

    @oneES1

    Adding a current macOS data point because the fixed path has a more serious side effect when Documents is synced by iCloud. This is still present in Codex Desktop 26.721.41059 on macOS 26.3.1.

    I traced one write spike to a projectless workspace under ~/Documents/Codex. A dependency install created roughly 180k node_modules entries. Over that 14.5-hour boot, the SSD’s write counter increased by about 745 GB. macOS process counters reported about 503 GB from bird, fileproviderd, and cloudd, versus 3.5 GB from ChatGPT/Codex itself; resource reports also caught bird and fileproviderd each writing about 34 GB in under ten minutes. The Codex log database and WAL stayed unchanged, so this was not the separate SQLite logging bug.

    I checked for a workaround: this build constructs the projectless root as ~/Documents/Codex, rejects a symlink there, and provides no setting to move it. This means normal high-file-count development work can be placed inside iCloud without the user choosing that, then heavily amplified by FileProvider metadata processing. Making the projectless workspace root configurable would address the problem; a non-iCloud default or warning would also help.

  7. lunafuse commented on Aug 26, 2026

    @lunafuse

    Still present on 26.820.60940 (macOS 15.7.9), same structure as reported: ~/Documents/Codex//. Reported against 26.513 three months ago, so this isn't version-specific.

    My use case is writing and document work rather than code, so most of what Codex generates lands in ~/Documents next to unrelated personal files.

    Moving it out afterwards is the part that actually hurts: once a thread is bound to a generated path, moving the folder gives "Current working directory is missing" and there is no way to relink it. Re-adding the folder registers a new project and the chat history is gone.

    So the default location isn't only clutter — per thread it's effectively permanent. A documented projectless_workspace_root key would be enough on its own; a UI setting isn't required.

  8. elix1er commented on Sep 13, 2026

    @elix1er

    Adding a second real-world reproduction, this time with native iCloud Drive / macOS File Provider, which points to the same underlying problem with projectless workspaces living under ~/Documents/Codex.

    I investigated sustained high CPU on an Apple Silicon Mac while projectless Codex workspaces under ~/Documents/Codex/... contained active JavaScript projects and dependency trees.

    Observed live behavior:

    • fileproviderd repeatedly stayed around 135–156% CPU during sampling.
    • bird and cloudd were also active, so this was specifically tied to Apple's iCloud/File Provider stack rather than only a third-party sync client.
    • A process sample showed substantial work on the iCloud Drive database queue, including SQLite reads/writes.
    • Unified logs repeatedly showed .js, .cjs, and .map files receiving sync updates / content-fetch activity.
    • lsof showed File Provider touching files deep inside node_modules, including a .pnpm dependency tree, under Codex-generated/projectless workspaces in Documents.
    • Two separate development workspaces were confirmed participants in the workload; both had dependency trees under the synced Documents hierarchy.
    • One File Provider database observed during the investigation was roughly 12 GB. That does not itself prove corruption, but it illustrates how much sync metadata/state can accumulate.
    • In a later snapshot fileproviderd had fallen to about 35.7% CPU while bird was still around 85.5%, so the workload fluctuated rather than immediately clearing.
    • A short error/fault log window did not show obvious File Provider errors, which suggests this can happen even without an explicit sync failure loop: normal bookkeeping/churn over very large numbers of dependency/build files may be enough.

    The strongest evidence was not simply that Documents was cloud-enabled; it was that File Provider was demonstrably processing files inside generated development dependency trees under that location.

    Moving active repositories/workspaces to a non-synced local directory such as ~/Developer is the practical mitigation, but projectless chats can recreate the problem because their root is still fixed under ~/Documents/Codex.

    This makes the requested setting more than a preference. On macOS, Documents can transparently be managed by iCloud Drive, and placing node_modules, source maps, build output, package-manager stores/symlinks, etc. there can generate a very large File Provider workload.

    I think the best product behavior would be either:

    1. make the projectless workspace root user-configurable, or
    2. default ephemeral/projectless workspaces to a non-Documents application/workspace location such as ~/.codex/workspaces / Application Support, while leaving user-selected project folders unchanged.

    So this reproduces the same concern as the existing Google Drive report, but with Apple's own iCloud Drive + fileproviderd/bird stack, which suggests the issue is fundamentally the choice of Documents as the default workspace root rather than a quirk of one cloud provider.

  9. raymond-itsec commented on Sep 25, 2026

    @raymond-itsec

    Is there a fix for this because if you are using OneDrive (which is symlinked) the Documents folder is not reachable by Codex (even with symlinked access on). File & Folder access (on MacOS) does not expose an option to allow access to OneDrive. So I am stuck. Codex has become useless at this point.

    Any pasted logs are unreadable at this point. Any workaround ?

    ChatGPT: Version 26.917.71314
    MacOS: 26.7

  10. TyceHerrman commented on Sep 25, 2026

    @TyceHerrman

    This appears resolved for new local Desktop tasks. Settings → General → Projectless task folder lets me choose ~/Codex. after restarting, I verified a new projectless task was created there instead of under ~/Documents/Codex

  11. elix1er commented on Sep 26, 2026

    @elix1er

    This appears resolved for new local Desktop tasks. Settings → General → Projectless task folder lets me choose ~/Codex. after restarting, I verified a new projectless task was created there instead of under ~/Documents/Codex

    That would be fire. Hope the bug report helped. Checking out now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    appenhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions