How Do You Track Codex CLI Token Usage? Codex v0.140 Adds /usage, Claude Code Import, and Session Deletion
Codex CLI v0.140.0 shipped June 15, 2026 with six developer-requested features: /usage to track token spend across daily, weekly, and cumulative views; /import to migrate from Claude Code in one command; permanent session deletion with subagent cleanup; encrypted credentials and managed Bedrock auth; unified @mentions menu; and LaTeX rendering in plans.
2026年6月18日 · 阅读约 5 分钟
核心结论
如果你在搜「Codex CLI 怎么查 token 用量」,简短结论是:升级到 v0.140.0,运行 /usage 即可看每日、每周和累计的 token 消耗。这次更新还加入了 Claude Code 一键导入(/import)、永久会话删除、加密凭证存储和 Bedrock 托管认证——六项功能都直接解决了开发者长期抱怨的问题。
What Is Codex CLI v0.140.0?
OpenAI shipped Codex CLI v0.140.0 as a stable release on June 15, 2026, landing six practitioner-facing features five days after the alpha builds first surfaced. Unlike the v0.138 release that focused on architectural changes (multi-agent v2, /app handoff), v0.140 is a quality-of-life release — every feature addresses a specific developer pain point that the community has been vocal about.
If you're already using Codex CLI, run codex update to pull the latest version. If you're new, install via npm install -g @openai/codex or pip install openai-codex.
Feature 1: /usage — Token Tracking Without Guesswork
The most-requested feature by far. Until v0.140, Codex CLI users had no way to see how many tokens they were burning. You'd code for hours, get a bill at the end of the month, and wonder where it all went.
/usage now gives you three views:
- Daily: Tokens consumed in the current 24-hour window
- Weekly: Rolling 7-day aggregate
- Cumulative: Total token activity since account creation
The command also surfaces cost estimates so you can map token counts to actual dollars. This matters because Codex uses different models for different tasks — GPT-5.2 for heavy reasoning, GPT-5-Codex-Mini for lighter edits — and each has its own rate. /usage breaks them down separately.
Quick tip: Add /usage to your end-of-session routine. It takes two seconds and prevents bill shock.
Feature 2: /import — Migrate From Claude Code in One Command
Switching AI coding tools usually means abandoning your prompt history, custom instructions, and workflow configuration. Codex v0.140 removes that friction with /import.
Run /import and Codex will pull in:
- Chat history and conversation context from Claude Code sessions
- Custom instructions (CLAUDE.md equivalents)
- Project-level configuration files
The import is selective — you choose which sessions and configs to bring over, not a blind bulk transfer. This is smart because not every Claude Code conversation is worth keeping. The feature also handles path remapping so imported configs work in Codex's directory structure without manual editing.
Why does this matter? Claude Code has a massive installed base, and many developers have been hesitant to try Codex because they'd lose months of accumulated context. /import lowers that switching cost to essentially zero.
Feature 3: Permanent Session Deletion
Prior versions let you close sessions, but old conversation data lingered in the background — eating disk space and, in some cases, appearing in search results or agent recall. v0.140 introduces true permanent deletion through three pathways:
codex delete— CLI command/delete— in-session slash command- App-server
thread/delete— for remote sessions
All three paths include confirmation safeguards (you have to explicitly confirm) and automatic subagent cleanup — spawned sub-agents are deleted alongside the parent session so nothing is orphaned.
This is also a privacy win. If you've been debugging sensitive code or working with proprietary data, you can now guarantee that session data is gone — not just hidden.
Feature 4: Encrypted Credentials & Managed Bedrock Auth
Codex CLI can now store credentials with local encryption rather than plaintext. For teams using AWS Bedrock as their model backend, v0.140 introduces managed Bedrock authentication — no more manually juggling IAM roles and temporary tokens.
The encrypted credential store uses OS-level keychains where available (macOS Keychain, Windows Credential Manager, Linux Secret Service API). This brings Codex in line with Claude Code's credential handling and closes a security gap that enterprise teams had flagged.
Feature 5: Unified @Mentions Menu
The @ mentions system — used to reference files, agents, tools, and context — now has a unified dropdown menu instead of separate popups for different entity types. Type @ and you'll see files, agents, and tools in one ranked list. The ranking is context-aware: frequently referenced files float to the top, and agents relevant to your current task get priority.
This sounds small, but for heavy Codex users who type @ dozens of times per session, the UX improvement is meaningful.
Feature 6: LaTeX Rendering & Richer /goal Input
Two smaller but noteworthy additions:
LaTeX rendering: Codex messages and plans now render LaTeX math expressions inline. If you're working on ML papers, quantitative finance, or any math-heavy codebase, equations now appear as formatted math instead of raw TeX strings.
Richer /goal input: The /goal command (used to set a session objective) now preserves oversized text, large pasted blocks, and image attachments — including in remote app-server sessions. Previously, long goal descriptions or screenshots would get truncated, forcing you to re-explain context after setting the goal.
What Didn't Change
Codex v0.140 does not change pricing, model availability, or the core agent architecture. If you're on v0.138, the agent behavior, multi-agent orchestration, and tool-use patterns remain identical. This is purely a UX and infrastructure release.
Should You Upgrade?
Yes, immediately. The update is backward-compatible and non-breaking. The three standout reasons:
/usagealone is worth the upgrade — if you've ever been surprised by a Codex bill, this fixes that permanently/importremoves the Claude Code lock-in argument — you can switch without losing your context- Encrypted credentials close a real security gap — especially relevant if you share a machine or work with sensitive codebases
Update with codex update or reinstall via your package manager.
The Bigger Picture
Codex CLI is now on a roughly bi-weekly release cadence — v0.138 shipped around June 9, v0.140 landed June 15. Each release adds 5-8 features that directly respond to GitHub issues and community feedback. This rhythm suggests OpenAI is treating Codex CLI as a fast-moving product, not a side-project.
The Claude Code import feature is especially telling. It signals that OpenAI views Codex as a direct Claude Code competitor — not just a Copilot alternative — and is willing to build migration bridges to capture that user base. Combined with the recent Codex Plugins and Sites launch (June 2), the tool is evolving from "AI code autocomplete" into a full development environment.
For developers still deciding which AI coding agent to standardize on, v0.140 makes Codex harder to ignore.
主题中心
2026 AI 编程工具全景指南
从 Copilot 改版到 Claude Code / DeepSeek 低成本方案——把分散资讯收成可搜索、可对比的工具矩阵。
进入「2026 AI 编程工具全景指南」 →赚钱视角
这个趋势怎么赚钱?
WayToClawEarn 的差异在可验证的赚钱案例,而不只是资讯。从这些复盘开始:
浏览全部案例 →相关教程
相关资讯
- Can Claude Design Replace Your Design Tool? Anthropic Adds Code Round-Trips, Figma Imports, and 2x Tokens
- Will Claude Require ID Verification? Anthropic's New Privacy Policy Explained
- Did Anthropic Cancel the Claude Agent SDK Credit Split? June 15 Pause Explained
- How Do Claude Code Tool(param:value) Permission Rules Work? v2.1.178 Guide