OkayStudy
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.

Tools

Tool Master

, , , , and agy all run the same agent loop and share the same habits — AGENTS.md, slash commands, plan mode, approvals and . Learn the common parts once and you can use any of them.

A student holds one glowing skill cartridge whose cables plug into six different terminal robots, and all six light up the same way
Words first

What are a tool, an agent and a harness?

A like or is one program, but it goes by three names depending on how you look at it: , and . Learn these three words first and the rest of this page reads easily.

Claude CodeCodexHermes Agent One program, three names

  • A person holds an open toolbox; a terminal window rises from it and connects to a small glowing AI orb

    Tool

    Seen as something a person uses

    A tool is something you use. Claude Code and Codex are tools that let a person use a computer and . Such a tool is also called an agent coding tool (agentic coding tool).

    You → Tool → Computer + AI

  • A robot at work: a glowing model orb sits inside a harness body with tools, and the two parts walk a loop together

    Agent

    Seen as a model plus a harness

    An agent is an AI that works through many steps on its own. In the broad sense, an agent is a and a harness put together — writes it as "Agent = Model + Harness". So when a model runs inside Claude Code, together they are an agent.

    Agent = Model + Harness

  • An empty harness frame with tools and an empty socket in its chest, next to a model orb waiting to be plugged in

    Harness

    Seen as everything except the model

    In the broad sense, a harness is everything except the AI model: any AI tool that wraps a model and puts it to work. The harness reads files, runs commands, asks for and hands the results back to the model. That makes Claude Code, Codex and all harnesses.

    Harness = Agent − Model

These days a tool is also called a harness or an agent

At first people simply called these programs tools. Now they say harness when they mean the part wrapped around the model, and agent when they mean the whole thing at work with the model inside. All three names are right, and they point to the same program.

See Agent = Model + Harness in detail

The six tools on this page

The big idea

Agent = Model + Harness

LangChain puts it in one line:

Agent = Model + Harness. If you're not the model, you're the harness.

LangChain — The Anatomy of an Agent Harness (new window)

Every piece of , setting and that is not the model belongs to the harness. A model alone only predicts text. The harness turns it into an agent that can read files, run commands and stop when the work is done.

Agent

What you talk to in the terminal

Model

Thinks — reads everything it is given and predicts the next words or a

Harness

Everything else — builds the input, runs the tools and keeps the loop going

  • Loads AGENTS.md
  • Tools — files, , web,
  • Permissions and approval
  • Sandbox
  • The loop
  • and compaction
  • Sessions and
A glowing brain orb plus a robot frame full of tools — a notebook, a wrench, a screen, a shield, a lock and a loop arrow — equals a small robot working on a laptop with the orb inside its chest

Six harnesses, many models

Claude Code, Codex, , , and agy are all harnesses. Each wraps a different model — Claude, , , Grok, Kimi, or with OpenCode almost any model — but every harness does the same jobs. That is why the habits on this page carry from one tool to the next.

Harness — three views
From prompt to report

The agent loop, step by step

Follow one real request through a — "Fix the signup button that does nothing and add a test". The model and the harness take turns until the work is checked.

Who does it You — ask and approve Model — thinks and decides Harness — builds the input, runs tools, checks permissions
The agent loop
  1. You Your prompt The request you type
  2. Harness Build the input Instructions, tools, AGENTS.md, history
  3. Model Model inference Answers with a tool call or with text
  4. Harness Run the tool Permission check, sandbox, approval
  5. Harness Add the result Back to the model with the new output
  6. Model Final report Text with no tool call ends the turn

Arrows go in order. The thick arrow is the loop — every tool result goes back to the model. The dashed arrow is taken only when the model answers with text and no tool call.

  1. Step 1 · You

    The prompt arrives

    You type the request and press Enter. The harness wraps your words as a user message — the last item of the input.

    What comes out
    {"type": "message", "role": "user",
     "content": [{"type": "input_text",
       "text": "Fix the signup button that does nothing and add a test"}]}
  2. Step 2 · Harness

    The harness builds the input

    Before the model sees your words, the harness gathers what it needs — its own instructions, the list of tools the model may call, a note about the sandbox and when to ask for approval, your AGENTS.md files, and the working folder and shell. In later rounds the whole conversation so far goes in too.

    What comes out
    instructions  base instructions for the model
    tools         shell · update_plan · web_search · mcp__…
    input
      developer   <permissions instructions> sandbox · approval
      user        AGENTS.md  (project root → cwd)
      user        <environment_context> cwd · shell
      user        "Fix the signup button …"
  3. Step 3 · Model

    The model thinks

    The harness sends the input to the model. The model answers in only one of two ways — a message for you, or a tool call, a small request such as "run this shell command". The model cannot touch your computer itself.

    What comes out
    {"type": "function_call", "name": "shell",
     "arguments": "{\"command\":\"rg -n signup src\"}",
     "call_id": "call_1"}
  4. Step 4 · Model Harness

    Gather context

    To fix the button the model first has to find it, so it asks for reading tools — search the code with rg, list folders, read the file. Claude Code calls this phase "gather ".

    What comes out
    $ rg -n signup src
    src/components/SignupButton.jsx:8:  <button type="button">Sign up</button>
    src/api/auth.js:21:export async function signup(email, password) {
  5. Step 5 · Harness

    The harness runs the tool

    The harness checks permissions. Allowed and inside the sandbox? It runs. Not allowed yet? It asks you first. Then it adds the call and its output to the conversation and asks the model again. This return trip is the loop, and it can turn dozens of times for one request.

    What comes out
    {"type": "function_call_output",
     "call_id": "call_1",
     "output": "src/components/SignupButton.jsx:8: …"}
  6. Step 6 · Model Harness

    Change files

    Once it understands the code, the model asks for an edit — new text for part of a file. The harness writes it and you see it as a . Claude Code saves a checkpoint before each edit so you can rewind.

    What comes out
    --- a/src/components/SignupButton.jsx
    +++ b/src/components/SignupButton.jsx
    -  <button type="button">Sign up</button>
    +  <button type="button" onClick={() => signup(email, password)}>
    +    Sign up
    +  </button>
  7. Step 7 · Model Harness

    Run commands

    Next the model asks to run the test or the build in the shell. A command that can change things outside the folder is exactly where approval and the sandbox matter.

    What comes out
    $ npm test -- SignupButton
  8. Step 8 · Model

    Verify

    The model reads the test log. If a test fails, it goes back to reading code and editing (steps 4 and 6) and runs the test again — until the test passes, or until it stops and asks you because it is stuck.

    What comes out
    FAIL  SignupButton.test.jsx
      ✕ calls signup when clicked
    … fix → run again …
    PASS  SignupButton.test.jsx
      ✓ calls signup when clicked
  9. Step 9 · Model Harness

    The final report

    When the model answers with text and no tool call, the turn ends. The harness shows the summary and gives control back to you. A good report says what changed, the test result and what was not checked.

    What comes out
    {"type": "message", "role": "assistant",
     "content": [{"type": "output_text",
       "text": "Connected the button to signup() and added SignupButton.test.jsx. npm test passes."}]}

The conversation grows every round

Each round adds the tool call and its result, and the whole list is sent again. The — the most a model can read at once — slowly fills up.

  1. New call and result Instructions, tools and AGENTS.md Round 1
  2. New call and result Earlier calls and results Instructions, tools and AGENTS.md Round 2
  3. New call and result Earlier calls and results Earlier calls and results Instructions, tools and AGENTS.md Round 3
  4. Summary Instructions, tools and AGENTS.md After compaction
  • Instructions, tools and AGENTS.md
  • Earlier calls and results
  • New call and result
  • Summary
More in the Tool context tab — what fills the context and how to compact it
  • Prompt caching

    In Codex the old input is an exact prefix of the new one, so the can reuse earlier work. Changing the tools, the model, the sandbox, the approval mode or the working folder in the middle of a conversation breaks that prefix and makes the next request slower.

  • Compaction

    When the conversation gets too long, the harness replaces it with a shorter summary and keeps going. Codex does it automatically once a limit is passed. Claude Code does it automatically too, and you can run /compact with a focus. Rules from early in a chat can get lost — keep lasting rules in AGENTS.md.

  • Approval and the sandbox belong to the harness

    The model only asks. Whether a command runs, waits for your approval or is blocked is decided by the harness. In Codex the sandbox covers its own shell tool — MCP tools must enforce their own limits.

Codex and Claude Code — same loop, different details

How Codex and Claude Code describe the loop
TopicCodexClaude Code
Name The agent loop — and tool calls repeat until an assistant message ends the turn. Source (new window) The loop — gather context, take action, verify results, and the phases blend together. Source (new window)
Conversation Every request sends the whole history again, so each request stands on its own. Source (new window) Every message, tool use and result is saved in a file under ~/.claude/projects, so you can resume or fork. Source (new window)
Compaction Automatic once auto_compact_limit is passed, through a special compact . Source (new window) Automatic near the limit. /compact with a focus keeps what you need. Source (new window)
Safety The sandbox and approval rules are told to the model and enforced on the shell tool. Source (new window) Permission modes (Shift+Tab) plus checkpoints that undo file edits. Source (new window)

Codex details come from the OpenAI article and Claude Code details from Anthropic's docs. The other tools run the same loop but have not published the same level of detail.

Compare

What each tool supports

Every cell links to where we checked it — an official page, or the tool's own output on 2026-10-26.

Legend Yes No Yes, different name Not confirmed
Shared features of six coding agent CLIs
Feature Claude Code Codex CLI OpenCode Grok Build Kimi Code Antigravity CLI
Reads AGENTS.md Yes, different name CLAUDE.md AGENTS.md only when there is no CLAUDE.md, or add @AGENTS.md to CLAUDE.md Yes AGENTS.md Yes AGENTS.md Yes AGENTS.md Yes AGENTS.md Yes AGENTS.md Also reads GEMINI.md
/goal — a long goal Yes /goal Yes /goal No Not built in — a feature request is open Yes /goal Yes /goal Yes /goal
Slash commands Yes /help Yes /help Yes /help Yes /help Yes /help Yes /help
Plan mode Yes /plan Yes /plan Yes, different name Plan agent Switch with Tab Yes /plan Yes /plan Yes /plan
Approval modes Yes --permission-mode Checked with claude --help Yes /permissions Yes permission Yes --permission-mode Checked with grok --help Yes --yolo · --auto Checked with kimi --help Yes --mode Checked with agy --help
Resume a session Yes claude -c Checked with claude --help Yes codex resume Checked with codex --help Yes opencode -c Checked with opencode --help Yes grok -c Checked with grok --help Yes kimi -c Checked with kimi --help Yes agy -c Checked with agy --help
Run without chat (headless) Yes claude -p Checked with claude --help Yes codex exec Checked with codex --help Yes opencode run Checked with opencode --help Yes grok -p Checked with grok --help Yes kimi -p Checked with kimi --help Yes agy -p Checked with agy --help
MCP Yes claude mcp Checked with claude --help Yes codex mcp Checked with codex --help Yes opencode mcp Checked with opencode --help Yes grok mcp Checked with grok --help Yes /mcp Yes agy mcp Checked with agy --help
Skills (SKILL.md) Yes .claude/skills Yes .agents/skills Yes .agents/skills Yes .grok/skills Yes .agents/skills Yes .agents/skills
Subagents Yes .claude/agents Yes .codex/agents Yes .opencode/agents Yes .grok/agents Yes .kimi-code/agents Yes .agents/agents
Switch model Yes /model Yes /model Yes, different name /models Yes /model Yes /model Yes /model
Compact context Yes /compact Yes /compact Yes /compact Yes /compact Yes /compact Yes /compact Checked with agy changelog
/init writes the instructions file Yes, different name /init → CLAUDE.md Yes /init → AGENTS.md Yes /init → AGENTS.md Not confirmed Yes /init → AGENTS.md Not confirmed

Commands change often. "Not confirmed" means we could not find it on an official page or in --help — not that it is missing.

One file, every tool

AGENTS.md — the rules every request needs

Three different robots lean over the same open notebook and each one nods with a check mark

AGENTS.md is a plain file in your project. The agent reads it before your first word, so you never have to repeat the rules.

What to put in it

  • How to run the project
  • How to test — and that tests must pass
  • Coding style
  • What not to touch
  • How to report
A short example
# AGENTS.md

## Run
- npm install, then npm run dev

## Test
- Run npm test before you finish. Every test must pass.

## Style
- React function components, 2-space indent.

## Do not touch
- .env, the database folder and package-lock.json

## Report
- List the changed files, the test result and anything you did not check.

Where each tool reads it

  • Claude Code

    Its own file is CLAUDE.md. It reads AGENTS.md only when there is no CLAUDE.md in the folder or above it. To keep both, put @AGENTS.md in CLAUDE.md.

    Source (new window)
  • Codex CLI

    From the down to the current folder, joined in that order, and the closer file wins. file ~/.codex/AGENTS.md. 32 by default.

    Source (new window)
  • OpenCode

    AGENTS.md in the project and ~/.config/opencode/AGENTS.md. It falls back to CLAUDE.md when there is no AGENTS.md.

    Source (new window)
  • Grok Build

    AGENTS.md (and CLAUDE.md) in every folder from the root to where you work. Deeper files win.

    Source (new window)
  • Kimi Code

    AGENTS.md or .kimi-code/AGENTS.md in the project, plus ~/.kimi-code/AGENTS.md for every project.

    Source (new window)
  • Antigravity CLI

    AGENTS.md and GEMINI.md in any folder, plus .agents/rules. Global rules live in ~/.gemini. All found rules are combined.

    Source (new window)
CLAUDE.md and AGENTS.md together
Long work

/goal — keep going until it is done

A small robot climbs a long stone staircase toward a flag at the top, passing stones with check marks, with a clock and a full battery beside it

A normal request ends as soon as the model stops calling tools. sets a instead — the agent keeps working, round after round, until the condition is met.

/goal Every test passes and the signup button calls signup(). Do not change the database.

Write a goal that can be checked

  • Make it testable — "all tests in tests/signup pass", not "make it better".
  • Set a limit, such as a budget or a time, and commit before you start.
  • Look in now and then. A long goal can still drift the wrong way.
  • YesClaude Code

    Sets a completion condition. Claude keeps working until it is met, judged impossible, or stopped by an error. Works with -p too.

    Source (new window)
  • YesCodex CLI

    A persistent target Codex tracks while a larger task runs (the goals feature, on by default).

    Source (new window)
  • NoOpenCode

    No built-in /goal yet — use custom commands instead.

    Source (new window)
  • YesGrok Build

    /goal with an objective and an optional --budget, plus status, pause, resume and clear.

    Source (new window)
  • YesKimi Code

    Starts an autonomous goal, with status, pause, resume, cancel and more.

    Source (new window)
  • YesAntigravity CLI

    When the agent tries to stop, blocks the stop and asks it to check its own work and continue.

    Source (new window)
AI Course — goals and loops
Prompt engineering

Write the request with 5W1H

A speech-bubble card in the middle, joined to six round badges — a person, a box, a clock, a map pin, a light bulb and a wrench

Most bad results come from a request that leaves out something the agent cannot guess. Six questions — who, what, when, where, why and how — catch most of those gaps.

Bad prompt

“The button is broken. Fix it.”

Which button? Broken how? How will we know it is fixed? The agent has to guess, and it may change the wrong file.

Good prompt — 5W1H

  1. Who New visitors who want to sign up on our homepage.
  2. What The "Sign up" button does nothing when clicked. Make it call signup() and add a test.
  3. When It happens on every click, since yesterday's .
  4. Where src/components/SignupButton.jsx on the home page. Do not touch the files.
  5. Why We are losing new members because they cannot sign up.
  6. How Find why the click does nothing, fix it with the smallest change, run test and tell me what you changed.

5W1H does not guarantee a good result, but it covers most cases. When the agent still has to ask you something, the missing piece is usually one of the six.

AI Course — prompt engineering
Better together

AGENTS.md + a 5W1H prompt

Split the work. AGENTS.md holds what every request needs. The holds only what this one request needs.

AGENTS.md — every time

How to test, coding style, what not to touch, how to report

Prompt — this time only

Who, what, when, where, why and how of this one request

A thick rule book and a small sticky note slide into a happy robot that starts typing on a laptop The agent reads both
  • Short prompts

    You stop typing "run the tests, do not touch the database" in every message.

  • The same rules in every tool

    Move from Claude Code to Codex or Kimi and the rules come along.

  • Shared with the team

    The file lives in , so every person and every agent follows the same rules.

  • Fix it once

    When the agent repeats a mistake, add one line to AGENTS.md instead of explaining it again.

Cheat sheet

Shared commands

One keyboard-like card with five glowing keys is cabled to three different small terminal machines

The same moves work in almost every tool. The exceptions are in the comparison table.

  • Start in your project folder

    cd my-project claude · codex · opencode · grok · kimi · agy
  • Create the instructions file

    /init Claude Code writes CLAUDE.md. Not confirmed for Grok and agy.
  • Plan before editing

    /plan OpenCode — press Tab for the Plan agent.
  • Switch model

    /model OpenCode — /models.
  • Free up context

    /compact
  • Set a long goal

    /goal Not in OpenCode.
  • Continue the last session

    claude -c · opencode -c · grok -c · kimi -c · agy -c codex resume --last
  • Run once without chat

    claude -p · grok -p · kimi -p · agy -p codex exec · opencode run
  • Manage MCP servers

    claude mcp · codex mcp · opencode mcp · grok mcp · agy mcp Kimi — /mcp inside the chat.

Learn more on SONUB

Official sources

Checked on 2026-10-26 against the official docs and the installed CLIs (--help). Commands change, so read the official docs too.

Each tool's docs

Choose a pending booking to cancel. Each cancellation requires confirmation.

Your :

Close