Skip to content

CLI always uses home directory as root in v0.131.0 #23508

@iamkd

Description

@iamkd

What version of Codex CLI is running?

codex-cli 0.131.0

What subscription do you have?

API key

Which model were you using?

No response

What platform is your computer?

Darwin 25.5.0 arm64 arm

What terminal emulator and version are you using (if applicable)?

Terminal/iTerm2/Ghostty

Codex doctor report

{
  "schemaVersion": 1,
  "generatedAt": "1779212357s since unix epoch",
  "overallStatus": "ok",
  "codexVersion": "0.131.0",
  "checks": {
    "app_server.status": {
      "id": "app_server.status",
      "category": "app-server",
      "status": "ok",
      "summary": "background server is running",
      "details": {
        "control socket": "/Users/daniel.karuna/.codex/app-server-control/app-server-control.sock",
        "daemon state dir": "/Users/daniel.karuna/.codex/app-server-daemon",
        "mode": "ephemeral",
        "pid file": "/Users/daniel.karuna/.codex/app-server-daemon/app-server.pid (missing)",
        "settings": "/Users/daniel.karuna/.codex/app-server-daemon/settings.json (missing)",
        "status": "running",
        "update-loop pid file": "/Users/daniel.karuna/.codex/app-server-daemon/app-server-updater.pid (missing)"
      },
      "remediation": null,
      "durationMs": 0
    },
    "auth.credentials": {
      "id": "auth.credentials",
      "category": "auth",
      "status": "ok",
      "summary": "auth is configured",
      "details": {
        "auth file": "/Users/daniel.karuna/.codex/auth.json",
        "auth storage mode": "File",
        "stored API key": "true",
        "stored ChatGPT tokens": "false",
        "stored agent identity": "false",
        "stored auth mode": "api_key"
      },
      "remediation": null,
      "durationMs": 0
    },
    "config.load": {
      "id": "config.load",
      "category": "config",
      "status": "ok",
      "summary": "config loaded",
      "details": {
        "CODEX_HOME": "/Users/daniel.karuna/.codex",
        "config.toml": "/Users/daniel.karuna/.codex/config.toml",
        "config.toml parse": "ok",
        "cwd": "/Users/daniel.karuna/dev/whatnot_web",
        "enabled feature flags": "shell_tool, unified_exec, shell_snapshot, terminal_resize_reflow, sqlite, hooks, enable_request_compression, multi_agent, apps, tool_search, tool_suggest, plugins, plugin_hooks, in_app_browser, browser_use, browser_use_external, computer_use, plugin_sharing, image_generation, skill_mcp_dependency_install, steer, guardian_approval, goals, collaboration_modes, tool_call_mcp_elicitation, personality, fast_mode, tui_app_server, prevent_idle_sleep, workspace_dependencies",
        "feature flag overrides": "goals=true, prevent_idle_sleep=true",
        "feature flags enabled": "30",
        "log dir": "/Users/daniel.karuna/.codex/log",
        "mcp servers": "0",
        "model": "gpt-5.5",
        "model provider": "openai",
        "sqlite home": "/Users/daniel.karuna/.codex"
      },
      "remediation": null,
      "durationMs": 0
    },
    "installation": {
      "id": "installation",
      "category": "install",
      "status": "ok",
      "summary": "installation looks consistent",
      "details": {
        "PATH codex #1": "/Users/daniel.karuna/.bun/bin/codex",
        "current executable": "/Users/daniel.karuna/.bun/install/global/node_modules/@openai/codex-darwin-arm64/vendor/aarch64-apple-darwin/codex/codex",
        "install context": "bun",
        "managed by bun": "true",
        "managed by npm": "false",
        "managed package root": "/Users/daniel.karuna/.bun/install/global/node_modules/@openai/codex"
      },
      "remediation": null,
      "durationMs": 6
    },
    "mcp.config": {
      "id": "mcp.config",
      "category": "mcp",
      "status": "ok",
      "summary": "no MCP servers configured",
      "details": {},
      "remediation": null,
      "durationMs": 0
    },
    "network.env": {
      "id": "network.env",
      "category": "network",
      "status": "ok",
      "summary": "network-related environment looks readable",
      "details": {
        "proxy env vars": "none"
      },
      "remediation": null,
      "durationMs": 0
    },
    "network.provider_reachability": {
      "id": "network.provider_reachability",
      "category": "reachability",
      "status": "ok",
      "summary": "active provider endpoints are reachable over HTTP",
      "details": {
        "openai API base URL": "https://api.openai.com/v1 reachable (HTTP 404)",
        "openai API route probe": "https://api.openai.com/v1/<redacted> route exists (HTTP 401)",
        "reachability mode": "API key auth"
      },
      "remediation": null,
      "durationMs": 387
    },
    "network.websocket_reachability": {
      "id": "network.websocket_reachability",
      "category": "websocket",
      "status": "ok",
      "summary": "Responses WebSocket handshake succeeded",
      "details": {
        "DNS": "2 IPv4, 0 IPv6, first IPv4",
        "auth mode": "api_key",
        "connect timeout": "15000 ms",
        "endpoint": "wss://api.openai.com/v1/<redacted>",
        "handshake result": "HTTP 101 Switching Protocols",
        "model provider": "openai",
        "models etag present": "false",
        "provider name": "OpenAI",
        "proxy env vars": "none",
        "reasoning header": "false",
        "server model present": "false",
        "supports websockets": "true",
        "wire API": "responses"
      },
      "remediation": null,
      "durationMs": 621
    },
    "runtime.provenance": {
      "id": "runtime.provenance",
      "category": "runtime",
      "status": "ok",
      "summary": "running bun on macos-aarch64",
      "details": {
        "commit": "unknown",
        "current executable": "/Users/daniel.karuna/.bun/install/global/node_modules/@openai/codex-darwin-arm64/vendor/aarch64-apple-darwin/codex/codex",
        "install method": "bun",
        "platform": "macos-aarch64",
        "version": "0.131.0"
      },
      "remediation": null,
      "durationMs": 0
    },
    "runtime.search": {
      "id": "runtime.search",
      "category": "search",
      "status": "ok",
      "summary": "search is OK (system)",
      "details": {
        "search command": "rg",
        "search command readiness": "ripgrep 15.1.0 (rev af60c2de9d)",
        "search provider": "system"
      },
      "remediation": null,
      "durationMs": 8
    },
    "sandbox.helpers": {
      "id": "sandbox.helpers",
      "category": "sandbox",
      "status": "ok",
      "summary": "sandbox configuration is readable",
      "details": {
        "approval policy": "OnRequest",
        "codex-linux-sandbox helper": "none",
        "execve wrapper helper": "/Users/daniel.karuna/.codex/tmp/arg0/codex-arg0djd8XG/codex-execve-wrapper",
        "filesystem sandbox": "restricted",
        "network sandbox": "enabled"
      },
      "remediation": null,
      "durationMs": 0
    },
    "state.paths": {
      "id": "state.paths",
      "category": "state",
      "status": "ok",
      "summary": "state paths and databases are inspectable",
      "details": {
        "CODEX_HOME": "/Users/daniel.karuna/.codex (dir)",
        "active rollout files": "146 files, 125448807 total bytes, 859238 average bytes",
        "archived rollout files": "0 files, 0 total bytes, 0 average bytes",
        "log DB": "/Users/daniel.karuna/.codex/logs_2.sqlite (file)",
        "log DB integrity": "ok",
        "log dir": "/Users/daniel.karuna/.codex/log (dir)",
        "sqlite home": "/Users/daniel.karuna/.codex (dir)",
        "state DB": "/Users/daniel.karuna/.codex/state_5.sqlite (file)",
        "state DB integrity": "ok"
      },
      "remediation": null,
      "durationMs": 461
    },
    "terminal.env": {
      "id": "terminal.env",
      "category": "terminal",
      "status": "ok",
      "summary": "terminal metadata was detected",
      "details": {
        "COLORTERM": "truecolor",
        "TERMINFO": "/Applications/Ghostty.app/Contents/Resources/terminfo (dir)",
        "TERM_PROGRAM": "ghostty",
        "color output": "enabled",
        "effective locale": "en_US.UTF-8",
        "stderr is terminal": "true",
        "stdin is terminal": "true",
        "stdout is terminal": "true",
        "terminal": "Ghostty",
        "terminal size": "196x47",
        "terminal version": "1.3.1"
      },
      "remediation": null,
      "durationMs": 0
    },
    "updates.status": {
      "id": "updates.status",
      "category": "updates",
      "status": "ok",
      "summary": "update configuration is locally consistent",
      "details": {
        "cached latest version": "0.130.0",
        "check for update on startup": "true",
        "last checked at": "2026-05-19T16:53:02.721771Z",
        "latest version": "0.131.0",
        "latest version status": "current version is not older",
        "update action": "bun install -g @openai/codex",
        "version cache": "/Users/daniel.karuna/.codex/version.json"
      },
      "remediation": null,
      "durationMs": 297
    }
  }
}

What issue are you seeing?

After upgrading to v0.131.0, running codex from the terminal does not account for the current working directory and always opens in ~. Downgrading to v0.130.0 fixes the issue. The workaround I found was to use the --cd param to explicitly specify the path.

What steps can reproduce the bug?

  1. Upgrade to v0.131.0
  2. Open terminal and run codex from your project directory or any other directory that is not ~
  3. Codex will still use ~ as the base directory

What is the expected behavior?

Codex should use the current working directory as the base directory

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    CLIIssues related to the Codex CLIbugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions