Answer: Codex selects the environment that best matches the repository Linear suggests based on the issue context, and if the request is ambiguous it falls back to the environment you used most recently. The chat then runs against the default branch of the first repository listed in that environment's repo map. Status: Confirmed Entry: tool/codex/integrations/codex-environment-repo-selection Revision: 1 Digest: sha256:cd67f4d24097de51 (changes whenever the content changes) Timeline: Created: 2026-11-13T03:54:39Z Last changed: 2026-11-13T03:54:39Z Last verified: 2026-11-20T13:43:17Z Next check: 2026-11-21T13:43:17Z Check interval: Daily Expected change: No fixed schedule Data: Field | Value | Source | As of environment selection | Codex selects the environment that best matches that suggestion | [1] | 2026-11-20 fallback | it falls back to the environment you used most recently | [1] | 2026-11-20 repo used | the default branch of the first repository listed in that environment’s repo map | [1] | 2026-11-20 no suitable environment | Codex will reply in Linear with instructions on how to fix the issue before retrying | [1] | 2026-11-20 Sources: [1] OpenAI. "Use Codex in Linear". https://learn.chatgpt.com/docs/third-party/linear.md Role: primary. Accessed: 2026-11-20T13:43:17Z Quote: "Linear suggests a repository based on the issue context. Codex selects the environment that best matches that suggestion." (Supports: environment selection) Quote: "If the request is ambiguous, it falls back to the environment you used most recently." (Supports: fallback) Quote: "The chat runs against the default branch of the first repository listed in that environment’s repo map." (Supports: repo used) Quote: "If no suitable environment or repository is available, Codex will reply in Linear with instructions on how to fix the issue before retrying." (Supports: no suitable environment) Snapshot SHA-256: a8c693a1f59d65737b2a32437d8c5227488fe57843ee76dc41a18e02a058dda1 (captured 2026-11-13T03:54:38Z) Verification: Method: Automated extraction from [1] with deepseek-flash (JSON output, thinking disabled). Every value was checked by code to appear verbatim in a quoted passage of [1]. On this check the text of [1] was unchanged since 2026-11-13T03:54:39Z, so the values verified then were kept. Cross-check: not-available at 2026-11-20T13:43:17Z. No independent second source is configured for this entry Last successful check: 2026-11-20T13:43:17Z Last attempt: 2026-11-20T13:43:17Z Notes and limitations: Extracted automatically from a single official source (section "How Codex chooses an environment and repo"). Related: https://latestn.com/tool/codex/integrations/configure-codex-exec How do I configure `codex exec` options in the Codex GitHub Action? https://latestn.com/tool/codex/integrations/configure-mcp-tool-hook How do I configure an MCP tool hook in Codex? https://latestn.com/tool/codex/integrations/connect-cli-to-remote-app-server How do I connect the Codex CLI terminal UI to a remote Codex app-server? https://latestn.com/tool/codex/integrations/capture-outputs How do I capture outputs from the Codex GitHub Action in my workflow? https://latestn.com/tool/codex/integrations/ci-api-key-setup How do I set up the API key for Codex Security scans in CI? https://latestn.com/tool/codex/integrations/ci-integration-options Which CI integrations does Codex Security support? https://latestn.com/tool/ All entries in AI tools Change log: Time | Event | Change | Source 2026-11-13T03:54:39Z | added | Entry created | — Changes for this entry as a feed: https://latestn.com/tool/codex/integrations/codex-environment-repo-selection/latest Challenge this entry: Open challenges: None How: If a value here is wrong or out of date, send what is wrong and a link to evidence. Challenges are queued and checked against the evidence; they do not change the entry by themselves. If the entry changes as a result, the change log says so. Form: https://latestn.com/dispute/tool/codex/integrations/codex-environment-repo-selection POST: https://latestn.com/dispute/tool/codex/integrations/codex-environment-repo-selection with claim, evidence_url, and optionally field and contact (form-encoded or JSON) GET: https://latestn.com/dispute/tool/codex/integrations/codex-environment-repo-selection?claim={what is wrong}&evidence_url={link} How to cite: LatestN. (2026). How does Codex choose which environment and repo to use for a Linear issue? Revision 1, last verified 2026-11-20T13:43:17Z. https://latestn.com/tool/codex/integrations/codex-environment-repo-selection (accessed 2026-11-21T09:54:59Z). @misc{LatestN_tool_codex_integrations_codex_environment_repo_selection_r1, title = {How does Codex choose which environment and repo to use for a Linear issue?}, author = {{LatestN}}, year = {2026}, howpublished = {\url{https://latestn.com/tool/codex/integrations/codex-environment-repo-selection}}, note = {Revision 1; digest sha256:cd67f4d24097de51; last verified 2026-11-20T13:43:17Z; accessed 2026-11-21T09:54:59Z} } Reuse: License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/) Attribution: Copying and adapting are allowed, including commercially, if you credit LatestN and link to the entry you used. Each entry ends with a ready-made citation. URL: https://latestn.com/tool/codex/integrations/codex-environment-repo-selection