기본 콘텐츠로 건너뛰기

Codex CLI Not Working? Fixes for Login, Sandbox and Limits

Summary: Most Codex CLI problems fall into four buckets: the browser sign-in can't reach your terminal, the sandbox blocks a command (or can't start at all on Linux), an old config value stops the CLI from launching, or you've hit your plan's usage window. This guide walks through each one with the exact commands and settings from OpenAI's current Codex docs, so you can find the cause in a few minutes instead of reinstalling. Everything below was checked against the official documentation on the date at the bottom.

Before you start: three quick checks

A surprising number of "Codex is broken" reports turn out to be version or account mix-ups. Run these first:

  1. Check the version. Run codex --version. OpenAI's troubleshooting page notes that the ChatGPT desktop app and the CLI can ship different Codex versions, so a feature you saw in the app may not have reached your CLI yet (or the other way round). Update with the same method you installed with: the standalone installer (curl -fsSL https://chatgpt.com/codex/install.sh | sh on macOS/Linux), npm install -g @openai/codex, or brew upgrade --cask codex.
  2. Check who you're signed in as. Run codex login status. It tells you whether the CLI is using a ChatGPT sign-in or an API key, which changes both billing and which models you can pick.
  3. Check your remaining usage. Inside a session, type /status. If you're out of your five-hour or weekly allowance, nothing else on this list will help until it resets.

Problem 1: "Sign in with ChatGPT" never finishes

When you run codex login (or start codex for the first time), the CLI opens a browser, you sign in, and the browser hands a token back to a small local callback server on localhost:1455. If the browser can't reach that port, the login hangs or fails. The docs name two typical causes: you're on a remote or headless machine (SSH box, dev container, cloud VM), or local network settings block the localhost callback.

Fix A: use device code sign-in

  1. Turn on device code login first. For a personal account it's in your ChatGPT security settings; in a workspace, an admin enables it in workspace permissions. This step is easy to miss, and it's the usual reason the option seems not to work.
  2. In the terminal, run codex login --device-auth, or choose Sign in with Device Code in the interactive login screen.
  3. Open the printed link on any device with a browser, sign in, and type the one-time code.

OpenAI still labels device code sign-in as beta, so keep the fallbacks below in mind.

Fix B: forward the callback port over SSH

If you connect to the remote machine over SSH, tunnel the callback port from your laptop with ssh -L 1455:localhost:1455 user@remote, run codex login inside that session, and open the printed address in your local browser. The token travels back through the tunnel.

Fix C: copy the login cache

Sign in on a machine that has a browser, confirm that ~/.codex/auth.json exists, and copy it to the same path on the headless machine (for example with scp). This only works when Codex stores credentials in that file rather than in your OS keychain; the cli_auth_credentials_store setting controls that (file, keyring, auto or ephemeral). Treat auth.json like a password, because it contains access tokens.

Corporate network or TLS proxy?

If your company inspects HTTPS traffic with its own root certificate, point Codex at it before logging in: export CODEX_CA_CERTIFICATE=/path/to/corporate-root-ca.pem, then codex login. When that variable is unset, Codex falls back to SSL_CERT_FILE. For anything still unclear, each direct codex login run writes a codex-login.log file in your log directory, which is the file support will ask for.

Using an API key instead

For CI or shared machines, an API key is often simpler: printenv OPENAI_API_KEY | codex login --with-api-key. Just know the trade-off. API-key sessions are billed at standard API rates through your OpenAI Platform account and don't include cloud features such as GitHub code review or the Slack integration.

Problem 2: the CLI won't start after an update

If Codex suddenly refuses to launch, check your config for approval_policy = "untrusted". OpenAI has retired that value, and the docs warn it "can prevent either client from starting." Look for it in ~/.codex/config.toml, any project .codex/config.toml, profile files and startup scripts.

The documented replacement for cautious, read-only use is:

sandbox_mode = "read-only"
approval_policy = "on-request"

If you liked the old behaviour where every command needed approval, remove the explicit approval_policy and add a project entry with trust_level = "untrusted" under [projects."/path/to/project"] in your user-level config. Note that this also disables project-local configuration for that folder.

Another settings surprise: Codex reads config from several layers, and the closest one wins. In order of priority it's command-line overrides, then trusted project .codex/config.toml files (closest folder first), then a profile chosen with --profile, then ~/.codex/config.toml, then cloud-managed defaults, then /etc/codex/config.toml. If a setting "doesn't stick," a higher layer is usually overriding it. Project layers load only after you trust the project.

Problem 3: sandbox errors on Linux and WSL

On macOS the sandbox uses the built-in Seatbelt framework and needs no setup. On Linux and WSL2, Codex expects bubblewrap:

  • Ubuntu/Debian: sudo apt install bubblewrap
  • Fedora: sudo dnf install bubblewrap

Without a bwrap on your PATH, Codex falls back to a bundled helper that needs unprivileged user namespaces, and you'll see a startup warning if it can't create one. On Ubuntu 24.04 the warning can persist even after installing bubblewrap because of AppArmor. The documented fix is to install apparmor-profiles and apparmor-utils, copy /usr/share/apparmor/extra-profiles/bwrap-userns-restrict into /etc/apparmor.d/, and load it with sudo apparmor_parser -r /etc/apparmor.d/bwrap-userns-restrict. That keeps the system-wide restriction in place; disabling it with sysctl is the last resort the docs mention, not the first.

WSL1 users: WSL1 was supported through Codex 0.114. From 0.115 the Linux sandbox moved to bubblewrap and WSL1 is no longer supported, so convert the distro to WSL2. On native Windows (PowerShell), Codex uses its own Windows sandbox instead.

Problem 4: commands are blocked or keep asking for approval

This is usually the sandbox working as designed. In the default Auto preset (--sandbox workspace-write --ask-for-approval on-request), Codex can read, edit and run commands inside your working folder, but it asks before touching files outside it or using the network. A few details that trip people up:

  • No internet for commands. In workspace-write, network access is off unless you add network_access = true under [sandbox_workspace_write]. That's why npm install or pip install run by the agent may fail even though your own shell is online.
  • Some folders stay read-only. Inside writable roots, .git, .codex, .agents and .aws are protected. If Codex can't commit or edit its own config, that's why.
  • Starts in read-only. In a folder you haven't trusted yet, or one that isn't under version control, Codex may start read-only. Use /permissions to check and change the mode.
  • Fewer prompts, same boundary. If the prompts slow you down, Auto-review mode (approvals_reviewer = "auto_review") keeps the same sandbox but lets a reviewer model handle eligible approvals. It uses extra model calls, so it adds to usage.

The nuclear option, --dangerously-bypass-approvals-and-sandbox (alias --yolo), removes both the sandbox and approvals. OpenAI marks it "not recommended"; reserve it for throwaway containers.

Problem 5: limits, missing models and "it stopped mid-week"

Codex with ChatGPT sign-in shares one allowance with ChatGPT Work. Plus and Standard Business get a five-hour window plus possible weekly limits; Pro plans currently have no five-hour limit. Usage varies a lot with model, context and tool use, so long sessions in a big repo burn through faster than short ones. If you run out mid-turn, the current turn is allowed to finish. After that, Plus and Pro users can buy credits, or anyone can continue local chats with an API key at API rates.

If a model you used to select has disappeared, check the date: GPT-5.5 retired from Codex for ChatGPT sign-ins on October 14, 2026. The docs suggest GPT-6.1 Sol on Plus and higher plans and GPT-6 Luna on Free and Go. Replace gpt-5.5 anywhere you pinned it: config files, custom agents, scheduled tasks and scripts. API-key sessions weren't affected.

Codex plans at a glance

Option Price Where Codex runs Worth knowing
Free $0/month Desktop app (GPT-6 Luna, subject to rollout) No image generation; the pricing card doesn't list the CLI
Go $8/month Desktop app (GPT-6 Luna, subject to rollout) Aimed at lightweight coding tasks
Plus $20/month Web, CLI, IDE extension, iOS GPT-6.1 Sol and GPT-6 Luna; five-hour window; can add credits
Pro From $100/month ($100, $200 or $500 tiers) Everything in Plus No five-hour limit currently; Ultrafast mode on the $500 tier
API key Standard API rates CLI, SDK, IDE extension No cloud features (GitHub review, Slack); good for CI

Prices are in USD as listed on OpenAI's Codex pricing page. Business is $20 per user per month billed annually for 2+ users ($25 monthly).

Editor's note

Who this is for: developers who run Codex in a terminal, especially over SSH, in containers, on Ubuntu or in WSL. Less useful for: people who only use the ChatGPT desktop app, where most of these knobs live behind the permissions menu instead.

Gotchas I'd watch for: device code sign-in must be switched on in your ChatGPT security settings before the flag works; auth.json copying fails silently if your OS keychain holds the credentials; and an old "untrusted" approval value left in a profile file is the sneakiest cause of a CLI that won't start.

Common errors and fixes: login hangs on a server, so use --device-auth or an SSH tunnel on port 1455. Bubblewrap or user-namespace warnings on Ubuntu 24.04 need the AppArmor profile. Package installs fail inside the agent because network access is off by default in workspace-write. If a model is missing, replace pinned gpt-5.5 values.

Still stuck? Where the logs are

Session transcripts live in ~/.codex/sessions (or $CODEX_HOME/sessions), archived ones in archived_sessions. If a session looks frozen, OpenAI's own checklist is: see whether Codex is waiting for an approval, run a basic command such as git status, then start a new chat with a smaller, focused prompt. Bugs go to the openai/codex GitHub issues; read your logs before sharing them, since they can contain sensitive data. You'll find screenshots of the official docs pages I used at the end of this post.

FAQ

Can I use Codex CLI with the free ChatGPT plan?

The current pricing page lists the CLI under Plus and above. The Free and Go cards mention only GPT-6 Luna in the desktop app. If you want the CLI without a subscription, sign in with an API key and pay standard API rates.

Why does Codex say I'm out of usage when I barely used it?

Allowance depends on model, context size, reasoning and tool use, not just message count, and Codex shares it with ChatGPT Work. Check /status or the usage dashboard, and try a smaller model for routine tasks.

Is it safe to run with --yolo?

Only somewhere you're happy to lose. It turns off both the sandbox and approvals. For hands-off runs, the docs suggest --sandbox read-only --ask-for-approval never for read-only CI, or Auto-review mode when you need edits.

Related on lightmind24: Aider Not Working? Fixes for Edit, Token and API Key Errors, Cline Tutorial: Plan, Act and Roll Back Safely in VS Code, and Antigravity CLI Setup: Move From Gemini CLI Step by Step.

Fix the login and the sandbox first, and almost everything else in Codex becomes a settings question.

Images: screenshots of OpenAI's public Codex documentation (learn.chatgpt.com), captured by lightmind24.

Last verified: 2026-11-01

Sources: Codex CLI, Authentication, Sandbox, Agent approvals & security, Config basics, WSL, Pricing, Models, Troubleshooting.

Uploaded Image Uploaded Image Uploaded Image Uploaded Image

댓글

이 블로그의 인기 게시물

브루(Vrew) 요금제 정리: 무료 200크레딧으로 어디까지 쓸 수 있나

요약: 영상 자막 편집기 브루(Vrew)는 2026년 4월 22일부터 기능별 사용량 대신 '통합 크레딧' 하나로 요금을 매겨요. 무료 플랜은 매달 200크레딧이 들어오는데, 음성 분석(자동 자막)만 쓰면 최대 200분 분량이라 짧은 영상 몇 편은 충분하지만, 영상 초반의 Vrew 마크를 지우려면 유료 플랜이 필요해요. 이 글은 브루 공식 가격 페이지와 고객센터 공지를 2026년 10월 23일에 다시 확인해, 크레딧 계산법과 플랜 고르는 기준을 정리했어요. 목차 브루 요금 구조: 통합 크레딧이란 1크레딧으로 할 수 있는 일 무료 플랜으로 되는 것과 안 되는 것 유료 플랜 4종 비교표 월 구독·연 구독·기간 이용권, 무엇이 이득일까 상황별 추천: 학생·직장인·유튜버 크레딧이 모자랄 때: 사용 기록 지우개 업그레이드·환불 전에 알아둘 규칙 운영자 메모, 자주 묻는 질문 1. 브루 요금 구조: 통합 크레딧이란 예전 브루는 플랜마다 음성 분석 몇 분, AI 목소리 몇 자, 번역 몇 자처럼 기능별 한도를 따로 줬어요. 그런데 보이저엑스(브루 운영사)가 실제 이용 데이터를 보니 한두 가지 기능만 집중해서 쓰는 사람이 훨씬 많았다고 해요. 그래서 2026년 4월 22일 업데이트부터는 플랜마다 정해진 크레딧을 받고, 어떤 기능에 쓸지는 내가 정하는 방식으로 바뀌었어요. 플랜별 매달 지급량은 Free 200 · Light 2,000 · Standard 10,000 · Business 12,000크레딧 이에요. 공식 공지에 따르면 무료 사용자는 매달 1일에, 유료 사용자는 매월 결제일에 충전되고, 남은 크레딧은 다음 달로 넘어가지 않아요. 바뀐 뒤 무엇이 좋아졌나 공지에 나온 예시가 이해하기 쉬워요. Standard 플랜에서 AI 목소리만 쓰면 예전에는 최대 50만 자였지만, 지금은 1만 크레딧을 모두 AI 목소리에 몰아 쓸 수 있어 최대 100만 자가 돼요. 반대로 여러 기능을 골고루 쓰는 사람은 크레딧이 기능끼리 ...

에이닷 전화 vs 익시오: 통화 녹음·AI 요약, 내 통신사·폰에 맞는 앱 고르기

요약: 통화 녹음과 AI 요약을 쓰고 싶다면 먼저 내 통신사와 휴대폰 종류부터 확인해야 해요. LG유플러스 고객은 무료 앱 익시오, SKT 고객은 에이닷 전화가 가장 기능이 많고, 다른 통신사의 아이폰 사용자는 iOS에 들어 있는 기본 통화 녹음·전사 기능이 현실적인 선택이에요. 이 글은 2026-10-30에 SKT·LG유플러스·Apple 공식 페이지와 도움말을 직접 확인해 세 가지를 비교했어요. 왜 '앱 기능'보다 '내 조건'을 먼저 봐야 할까요 통화 요약 앱 비교 글을 보면 기능 목록부터 나열하는 경우가 많아요. 그런데 실제로 써 보려는 사람에게 가장 먼저 걸리는 건 기능이 아니라 이용 조건 이에요. 익시오는 LG유플러스 고객 전용이고, 에이닷 전화는 누구나 설치할 수 있지만 통역콜·baro 같은 기능은 SKT 고객에게만 열려 있어요. 아이폰은 운영체제 구조상 앱이 통화를 마음대로 녹음하기 어려워서, 통신사 앱이 안 되면 iOS 기본 기능에 기대야 해요. 그래서 이 글은 "어떤 앱이 제일 좋은가"보다 "내 통신사·내 폰에서 무엇을 쓸 수 있나" 순서로 정리했어요. 기능 차이는 그다음이에요. 한눈에 비교: 에이닷 전화 vs 익시오 vs 아이폰 기본 통화 녹음 구분 에이닷 전화 (SKT) 익시오 ixi-O (LG유플러스) 아이폰 기본 통화 녹음 (Apple) 누가 쓸 수 있나 통신사 구분 없이 앱 설치 가능. 단, 통역콜·baro·그룹통화 발신 등은 SKT 고객 전용 U+ 모바일 고객. 타 통신사, 만 14세 미만, 선불요금제 고객은 제한 (공식 사이트 FAQ상 알뜰폰 중 KB리브엠은 예외) 지원 국가·언어의 iPhone 사용자. 1명과 통화할 때만 녹음 가능 지원 OS·기기 Android 10 이상, iOS 16 이상 iOS 17 이상 iPhone 12 이상 / Android...

타입캐스트 vs 클로바더빙: 수익 나는 채널에 쓸 때 무료·유료 조건 비교

요약 타입캐스트와 클로바더빙은 둘 다 글만 입력하면 한국어 AI 목소리를 만들어 주는 서비스지만, 무료로 쓸 수 있는 범위가 꽤 다릅니다. 클로바더빙 무료는 매달 15,000자까지 쓸 수 있는 대신 수익이 생기는 채널에는 쓸 수 없고, 타입캐스트 무료는 처음에 주는 약 5분 분량의 다운로드로 끝나는 체험판에 가깝습니다. 광고 수익이 붙은 유튜브나 쇼핑몰 영상에 넣을 목소리라면 처음부터 유료 플랜 조건을 보고 고르는 편이 안전합니다. 왜 이 두 서비스를 같이 비교하나 쇼츠 내레이션, 수업 자료 더빙, 상품 소개 영상처럼 "내 목소리 대신 AI 목소리"가 필요할 때 한국 사용자들이 가장 많이 찾는 곳이 네오사피엔스의 타입캐스트 와 네이버의 클로바더빙 입니다. 기능 소개만 보면 비슷해 보이지만, 실제로 문제가 되는 건 음질보다 "이 목소리를 내 채널에 써도 되나" 입니다. 그래서 이 글은 기능 나열보다 무료 사용 범위, 출처 표기 의무, 유료 플랜 가격과 다운로드 한도를 중심으로 정리했습니다. 모든 수치는 2026년 10월 25일에 두 서비스의 공식 요금 페이지와 고객센터 도움말에서 직접 다시 확인한 내용입니다. 한눈에 보는 비교표 항목 타입캐스트 무료 타입캐스트 베이직 클로바더빙 Free 클로바더빙 Standard 월 요금 0원 9,900원 (연간 결제 시 10% 할인) 0원 19,900원 (네이버 클라우드 플랫폼에서 결제) 무료·포함 사용량 음성 생성·재생 무제한, 다운로드는 최초 3,000크레딧(약 5분) 1회 지급 월 30,000크레딧(약 60분) 월 15,000자, 다운로드 월 20회, 프로젝트 누적 5개 (매월 1일 갱신) 월 30,000자, 다운로드 월 40회, 프로젝트 누적 20개 쓸 수 있...