OkayTeacher
EN English 한국어 日本語 中文 हिन्दी বাংলা اردو Español Português Français Deutsch Русский العربية Bahasa Indonesia Tiếng Việt ไทย Türkçe

How to enable notifications

Notifications are unavailable in this browser or on this address. Try a supported browser on the secure SONUB site.

If notifications are blocked, allow them in your browser settings.

  1. Open the site controls beside the address bar, or your browser’s site settings. Set Notifications for this site to Allow.
  2. In your device settings, allow notifications for your browser and check Do Not Disturb or Focus.
  3. Return to SONUB, reload the page, and use the bell to enable notifications.

On iPhone or iPad, add SONUB to your Home Screen, open it there, then allow notifications.

OpenAI

Codex — OpenAI’s coding agent

Install Codex, run your first task in a project folder, then level up in four tabs. Start by checking what you need and copying your install command.

Models and reasoning effort — which to use (recommended: GPT-6.1 Sol, High)

As of November 2026, use GPT-6.1 Sol at High effort for development — set it as below or pick it with /. Every model and , and when to go lower or higher, is in Recommended use on Tool Master.

~/.codex/config.toml
model = "gpt-6.1-sol"
model_reasoning_effort = "high"
codex -m gpt-6.1-sol
codex -m gpt-6.1-sol -c model_reasoning_effort=high
codex exec -m gpt-6.1-sol "Review the current changes"

# inside Codex
/model    # model → effort (Max · Ultra: More reasoning…)

Writing AGENTS.md well

reads when it starts work. It first reads your file (~/.codex/AGENTS.md), then walks from the top of the project (usually the top of the ) down to the , finds one file per folder and joins them in order. Files closer to the current folder come later, so they win.

  • ~/.codex/AGENTS.md — your personal instructions for every project
  • AGENTS.md at the top of the project — instructions the team shares ( it)
  • AGENTS.md in a — instructions added only when working in that folder
  • — if it is in the same folder, it is read instead of AGENTS.md (for trying a change for a while).
  • Only up to 32 in total is read by default (project_doc_max_bytes). To use files with other names, list them in project_doc_fallback_filenames.
AGENTS.md
# AGENTS.md

## Setup
- Install: pnpm install
- Test: pnpm test
- Lint: pnpm lint

## Code style
- TypeScript strict mode, single quotes.
- Keep functions small. Add a test for every bug fix.

## Don't
- Don't edit generated files in dist/.
- Don't commit .env files.
Order
~/.codex/AGENTS.md          ← you, every project (read first)
my-project/AGENTS.md        ← team rules (commit it)
my-project/web/AGENTS.md    ← only for web/ (read last, so it wins)

reads the project and writes a first AGENTS.md. AGENTS.md is read once per run, so restart Codex after editing it.

Using it with Claude Code — instructions in one place, AGENTS.md

If one project uses other AIs such as , or alongside Codex, separate instruction files for each tool soon drift apart. AGENTS.md is an open format that many read, so write the rules once in AGENTS.md and every works from the same instructions.

When you use it with Claude Code, the best way is to keep no CLAUDE.md in the project and use only AGENTS.md. Without a CLAUDE.md, Claude Code reads AGENTS.md, and it still reads your global ~/./CLAUDE.md. The reasons and steps are explained in Claude Code Intermediate.

  1. Write the shared rules only in AGENTS.md.
  2. Keep no CLAUDE.md in the project. If you use CLAUDE.md in even one folder, put a CLAUDE.md in every folder, each with just one line: @AGENTS.md.
  3. To change a rule, edit only AGENTS.md. Both AIs follow the changed rule.
my-project/
~/.claude/CLAUDE.md   ← personal rules for Claude Code (still loaded)
~/.codex/AGENTS.md    ← personal rules for Codex

my-project/
└── AGENTS.md         ← the rules — Codex and Claude Code both read this
                        (no CLAUDE.md in the project)

Approvals and the sandbox — how much to hand over

Codex keeps things safe in two ways. The sandbox sets what it can technically do (writing files, ), and the sets when it asks you. Choose both together.

  • — it only reads and changes nothing. Use it to look around a project you do not know.
  • — it edits and runs only inside the working folder. In a Git repository the default is "Auto", which pairs this with on-request. The network is off by default and .git, .codex and .agents cannot be written.
  • — no sandbox, it can do anything. Use it only in an .
  • Approval policy (-a): on-request asks when it needs to go outside the sandbox, never does not ask (it works only inside the sandbox).
  • /permissions switches modes during a conversation, and /status shows the current settings.
Terminal
codex --sandbox read-only                      # look only, change nothing
codex --sandbox workspace-write                # edit inside this folder ("Auto" in a Git repo)
codex -a never --sandbox workspace-write       # never ask, but stay inside the sandbox
~/.codex/config.toml
approval_policy = "on-request"
sandbox_mode = "workspace-write"

[sandbox_workspace_write]
network_access = false

The --full-auto in older articles no longer exists. Use --sandbox workspace-write for the same thing. --yolo (--dangerously-bypass-approvals-and-sandbox) turns off both the sandbox and approvals, so use it only somewhere isolated.

Commands in the chat screen

Type / in the Codex chat screen and the list of commands appears. Learn the ones you use every day first.

  • /model — choose the model and how hard it thinks (reasoning effort).
  • /diff — see the files changed in this session. /review — have it review the changed .
  • /compact — summarize the conversation to free up room. /new — start a new conversation.
  • — pick an earlier conversation to continue. In the terminal, codex resume or codex resume --last.
  • /status — see the current settings such as model, and working folder. /mcp — see the connected .
  • @ — find a file and attach it to the request. $ — call a . ! — run a command right away (!git status).
  • -i picture.png — start with a attached (during a conversation, paste it). --search — turn on live web search.
  • /init — create AGENTS.md. /plan — have it make a plan first.
  • <> — keeps working until it is met. /goal alone shows it; /goal pause, resume and clear pause, continue and remove it (Codex 0.128.0 and later).

Coming from Claude Code? /import brings in Claude Code's setup and recent conversations.

Save context — SONUB rule: auto compact at about 400k, base context at 6% or less

Codex also rereads the whole current every time you ask for something, so use the same rule as Claude Code — to work with about 400k instead of the full 1M, and keep the base context (the default , skills, MCP and so on) at 6% or less. Doing this cuts your usage a lot. About 400k and 6% are SONUB’s own rule of thumb, not official recommendations — the official docs only describe the settings.

  • Put model_context_window = 500000 and model_auto_compact_token_limit = 475000 in ~/.codex/config.toml (example below): Codex treats the as 500k tokens and compacts automatically when the context reaches 475k.
  • /compact compacts by hand at any time, and /new opens a fresh conversation when the job changes.
  • Run /status right after opening a new conversation to see context usage. What is already taken before you ask anything (system prompt, AGENTS.md, skills, MCP tools) is the base context, and it should be 6% or less.
  • Over 6%? Trim it — remove MCP servers you do not use from or turn them off with enabled = false, remove unused skills, and keep only the rules you really need in AGENTS.md.
~/.codex/config.toml
model_context_window = 500000
model_auto_compact_token_limit = 475000

The base context is sent with every request, so saving even a few percent adds up over the whole conversation and cuts usage a lot.

Handing over work well — where, what and how to check

A good request has three parts: where (files and folders), what (the behaviour you want) and how to check it (tests, commands, screens). The clearer the three are, the less Codex wanders and the more it checks its own results.

  • Vague request: "Fix the cart"
  • Clear request: "In @src/cart.ts the total becomes when a quantity is 0. Make it remove that item when the quantity is 0, add a test to tests/cart.test.ts and check that test passes."
  • Start a big job with "Show me only a plan first", adjust the plan, then let it go on.
  • If it changes more than you asked, stop it, undo only that file with <file> (your own unstaged edits in it are lost too) and ask again, naming the files.
  • Paste the whole error output — the original is more accurate than a summary.
  • When it is done, read the changes with /diff, run the tests yourself, then commit.

Best practices — how OpenAI recommends using Codex

In short: ask with four parts (goal, context, limits, done when), plan hard work first, let Codex check its own work, keep rules in AGENTS.md and use one chat per piece of work. The six good habits, with commands for both tools, are in Recommended use.

Common mistakes — and how to avoid them

The official guide lists eight mistakes — for example rules stuffed into the , no build or test commands, a skipped plan and full access too early. All ten mistakes from both guides, each with its fix, are in Recommended use.

Intermediate practice — try it in your own project

  1. Create AGENTS.md with /init and refine the test command and three rules.
  2. If you also use Claude Code, check that the project has no CLAUDE.md, so both AIs read the same AGENTS.md.
  3. Have it look around the project with codex --sandbox read-only, then hand over a small fix with workspace-write.
  4. Review the changes with /diff and /review.
  5. See the current settings with /status and continue the conversation with codex resume --last.

Done all five? Move on to the [Advanced] tab.

Official documentation

Checked against the official documentation on 2026-10-19. These tools change often — if a command fails, see the official docs.