# Reduce token usage in Codex

> Codex already does 3 of the fixes for you, and 7 settings cut more. Agent type: using a coding agent. From Use Fewer Tokens, by StackOne.

Last checked: 30 Nov 2026, against the vendor's own pages.

## What Codex already does
- **Load tools when needed**: Models with tool search defer MCP tools and find them with BM25. ([source](https://github.com/openai/codex/blob/6ff1e1ca3b30fc8b914720681fcf5fe62e95f856/codex-rs/core/src/tools/handlers/tool_search.rs#L171), read 30 Nov 2026)
- **Clear old tool results**: Automatic compaction at the model's default threshold; model_auto_compact_token_limit moves it. ([source](https://learn.chatgpt.com/docs/config-file/config-reference), read 30 Nov 2026)
- **Prompt caching**: Codex caches the stable part of the prompt itself.

## Settings that cut more in Codex
- **Turn off tools you don't use**: enabled_tools or disabled_tools per MCP server; tool_input_schema_max_bytes trims long schemas (default 5,000). ([source](https://learn.chatgpt.com/docs/config-file/config-reference), read 30 Nov 2026)
- **Let the agent run code over results** (experimental): [features.code_mode] enabled = true in config.toml. ([source](https://learn.chatgpt.com/docs/config-file/config-reference), read 30 Nov 2026)
- **Cap tool output**: tool_output_token_limit. ([source](https://learn.chatgpt.com/docs/config-file/config-reference), read 30 Nov 2026)
- **Read web pages as text**: npm i -g agent-browser, then add "run agent-browser skills get core and follow it" to AGENTS.md. ([source](https://github.com/vercel-labs/agent-browser), read 30 Nov 2026)
- **Keep instruction files short**: project_doc_max_bytes. ([source](https://learn.chatgpt.com/docs/config-file/config-reference), read 30 Nov 2026)
- **Run side tasks on a smaller model**: agents.default_subagent_model and agents.default_subagent_reasoning_effort in config.toml. ([source](https://learn.chatgpt.com/docs/config-file/config-reference), read 30 Nov 2026)
- **Lower the effort setting**: model_reasoning_effort = "low" and model_verbosity = "low". ([source](https://learn.chatgpt.com/docs/config-file/config-reference), read 30 Nov 2026)

## With StackOne
- **Deep Query**: Add https://mcp.stackone.com/mcp, then ask in plain words
- **Load tools when needed**: Add https://mcp.stackone.com/mcp; Advanced Tool Search is on by default
- **Ask for fewer fields**: source on any _s1query call
- **Keep live questions live**: Keep the live action next to the _s1query tool
- **Tool Policies**: Tool Policies on the project

## Other techniques for coding agents
- [Measure what fills the window](https://usefewertokens.com/techniques/audit-commands/): fits. /context, /usage, /skill-doctor in Claude Code.
- [Prompt caching](https://usefewertokens.com/techniques/prompt-caching/): partly. The harness caches for you.
- [Batch scheduled jobs](https://usefewertokens.com/techniques/batch/): not available. Interactive.

## Links
- Optimizer set to Codex: https://usefewertokens.com/harnesses/codex/
- Codex on the MCP clients scorecard: https://mcpclients.dev/clients/codex/
- Connect Codex to StackOne: https://www.stackone.com/platform/mcp/ai-agent/codex/
- How to reduce AI agent token usage: https://www.stackone.com/blog/reduce-ai-agent-token-usage/
