Skip to content
Browse tools

Complete practical guide Β· Claude Code & Codex

Same agent.
Three places to
put it to work.

Claude Code and Codex each run as an editor extension, a terminal process, and a standalone desktop app. Most people install one, use it like autocomplete, and never find out what the other two are for. This page fixes that. πŸ‘‡

🧩
In the editor
Extension

You watch the code change. Tight loop, small diffs, you review every line.

⌨️
In the terminal
CLI

Longer autonomous runs, scripts, CI β€” anything not tied to one open file.

πŸ–₯️
Standalone
Desktop app

Work spanning files, docs and tools rather than a repo. Runs while you do something else.

πŸ‘‹

Who this is for: a developer with VS Code or Visual Studio already open, who wants to stop guessing which tool to reach for. Every command below is one you can actually paste.

02 Β· The differences, up front

⚑ Claude Code vs Codex

They solve the same problem and they've converged hard. The differences that actually affect your day are in how you configure them, how they handle permissions, and what happens when you want to step away.

🟠 Claude Code

Anthropic

Its strength: configurability. Fine-grained per-tool permission rules, custom slash commands, named subagents, and lifecycle hooks all live as files in your repo β€” so a team can share one agent setup the way they share a lint config.

Its shape: deepest in the terminal, with the editor extension as a viewer and context source layered on top.

🟒 Codex

OpenAI

Its strength: the sandbox and the handoff. Approval modes are a single clear dial rather than a rules file, and local work can be pushed to a cloud container that keeps running and opens a PR when it's done.

Its shape: the IDE extension is the front door, with the CLI and cloud as the same session viewed from elsewhere.

πŸ“Š Side by side

What🟠 Claude Code🟒 CodexWhy it matters to you
Made byAnthropicOpenAIDetermines which subscription covers it.
How you payClaude Pro / Max / Team plan, or Anthropic API billingChatGPT Plus / Pro / Business plan, or OpenAI API billingThe single biggest decider. Use what you already pay for before comparing anything else.
TerminalclaudecodexBoth are the full-power surface. Neither is a cut-down version.
Editor supportVS Code + JetBrains extensionsVS Code and its forks (Cursor, Windsurf)If you're a JetBrains/Rider shop, that narrows it fast.
Away-from-desk modeClaude desktop app (Code tab + Cowork), plus the mobile appCodex cloud tasks β€” runs in a container, opens a PRDifferent philosophies: one gives you a workspace, the other gives you a build server.
Project memory fileCLAUDE.mdAGENTS.mdSame job. Keep both if your team is mixed.
Config file.claude/settings.json~/.codex/config.tomlClaude's is per-repo and committable; Codex's is per-machine.
Permission modelAllow/deny rules per tool and per command patternThree approval modes + an OS-level sandboxClaude = precise but you write rules. Codex = simpler, safer default.
Custom commandsMarkdown files in .claude/commands/ become slash commandsReusable prompt filesClaude's version is shared via git, which is why teams standardise on it.
Subagents & hooksYes β€” named subagents, lifecycle hooksNot in the same formOnly matters once you're automating the agent itself.
MCP serversYesYesBoth can reach your DB, Jira, Sentry, docs. No differentiator.
⏱️

This table ages fast. Both tools ship near-weekly and feature gaps close within a release or two. Treat it as a snapshot for orientation, not a purchasing decision β€” and check the docs for anything you'd actually bet on.

03 Β· The straight answer

πŸ† What a developer should actually use

If you want to skip the deliberation: pick the one your subscription already covers, install both its CLI and its editor extension, and commit a memory file to the repo. That's 90% of the value. Everything else is refinement.

πŸ₯‰ Minimum

15 minutes

  • Editor extension installed
  • Signed in
  • You use it to ask questions about code you're looking at

Real but small gains. This is where most people stop.

πŸ₯‡ The 80% setup

One afternoon

  • CLI and extension, connected
  • CLAUDE.md / AGENTS.md committed
  • Permissions set to workspace-only
  • Plan-before-code as a habit
  • Clean git status before every run

πŸš€ Power

Ongoing

  • Custom slash commands in the repo
  • MCP servers for your DB and tracker
  • Desktop app for parallel background work
  • Git worktrees so two agents can run at once

πŸ—“οΈ What that looks like on a normal day

WhenWhat you doWhere
β˜• 9:00Hand off the boring chore you've been avoiding β€” dep bumps, a mechanical refactorDesktop / CLI
πŸ’» 9:15Feature work. Ask questions, plan, edit, review each diff as it landsExtension
πŸ”€ 11:30Check the morning's delegated branch, review it properly, finish the last 10%Extension
πŸ§ͺ 14:00Big cross-cutting change β€” commit-per-package, unattendedCLI
πŸ”Ž 16:30Self-review the whole diff before opening the PRExtension
πŸ’‘

The pattern to internalise: mechanical work goes where nobody is watching; judgement work stays where you can see the diff. Almost every "the agent wrecked my codebase" story is someone who put the second kind in the first place.

04 Β· Decide per task

🧭 Pick a surface by the shape of the task

Once both are installed, the live question is "how much of this do I need to watch?" That one answer picks your surface, and it changes several times a day.

What you're doingWhere it belongsWhy
πŸ› Fixing a bug in a file that's openExtensionIt inherits your selection and the errors already on screen.
πŸ” "Why does this module exist?"ExtensionAnswers land right next to the code you're pointing at.
✏️ Rename a concept across 40 filesCLILong run, many edits, nothing gained by watching one tab.
πŸ—ƒοΈ Migration + tests + changelogCLIMulti-step, and it will want to run commands repeatedly.
πŸ“¦ Same fix across three reposDesktopParallel sessions, no single project root.
πŸ“Š Turn a spec doc into a plan and a sheetDesktopNot a repo task at all β€” files and documents, not code.
πŸ“± Kick off work from your phone at 11pmDesktopThe editor isn't open. That's the whole point.
🚨

Don't run two agents on the same files at once. Two processes editing one working tree makes conflicts that cost more to untangle than the task was worth. Give each a separate branch or git worktree.

05 Β· Before you install

πŸ“¦ Versions & requirements

Most failed installs are one of three things: Node too old, a global npm install fought with permissions, or the account doesn't actually have access. Check these first.

RequirementVersionNotes
🟩 Node.js18 or newer
20 or 22 LTS recommended
Needed for the npm install route for both tools. node --version to check.
🍎 macOS10.15+Fully supported. Homebrew install also available for Codex.
🐧 LinuxUbuntu 20.04+ / Debian 10+Equivalent distros fine.
πŸͺŸ WindowsWindows 10+Runs natively now; WSL2 still works and is sometimes smoother for POSIX-heavy repos.
🧠 RAM4 GB+The model runs remotely β€” this is just for the local process.
🌿 Git2.23+Optional but strongly recommended. Your undo button is git checkout .
🧩 VS CodeKeep it currentExtensions target recent releases; a year-old VS Code will fight you.
πŸ”‘ AccountPaid plan or API billingClaude: Pro/Max/Team. Codex: ChatGPT Plus/Pro/Business. Free tiers generally don't include agentic coding.

πŸ”§ Install, check and update

β–Έ terminal
# --- Claude Code ---
npm install -g @anthropic-ai/claude-code   # install
claude --version                           # check
claude update                              # update
claude doctor                              # diagnose a broken install

# --- Codex ---
npm install -g @openai/codex               # install (brew also available)
codex --version
npm install -g @openai/codex@latest        # update

# --- sanity check your Node ---
node --version                             # must be v18.x or higher
πŸ›‘

Never install these with sudo. A root-owned global npm directory causes permission errors on every later update and is a genuine security footgun. If npm install -g gives you EACCES, fix the npm prefix instead:

npm config set prefix ~/.npm-global then add ~/.npm-global/bin to your PATH.

πŸ’‘ Version numbers here reflect what was current in mid-2026 and requirements do get raised β€” claude doctor and the official install docs are the authority if something won't start.

06 Β· Setup

🧩 Getting both running in VS Code

Fifteen minutes, once. The install is the boring part β€” the habits at the end are where the value is.

● Claude Code

Install the CLI first β€” the extension talks to it.

β–Έ terminalClaude
# 1 Β· install the CLI
npm install -g @anthropic-ai/claude-code

# 2 Β· go to your project root β€” this defines the workspace
cd ~/code/my-project

# 3 Β· first run signs you in
claude

Now install the Claude Code extension from the VS Code marketplace β€” or just run claude in VS Code's integrated terminal and it'll offer to install it for you. Then connect the two:

β–Έ inside the claude sessionClaude
/ide          # attach this session to the editor
/init         # scan the repo and write a CLAUDE.md
/status       # confirm the IDE shows as connected

Press Ctrl+Esc (⌘+Esc on Mac) to open the panel from anywhere. With the IDE connection live you get three things a bare terminal can't:

  • βœ… Your current selection is passed as context automatically
  • βœ… Edits open in VS Code's native diff view instead of scrolling past as text
  • βœ… Lint and type errors from the Problems panel are visible without pasting

● Codex

Install the Codex extension from the marketplace (it also works in Cursor and Windsurf), then sign in with your ChatGPT account or an API key. For long runs, add the CLI too:

β–Έ terminalCodex
npm install -g @openai/codex

cd ~/code/my-project
codex

Codex's defining setting is its approval mode. Set it deliberately on day one rather than clicking through prompts:

ModeIt canUse it when
πŸ”’ Read onlyRead files and answer. Nothing else without asking.Unfamiliar repo, or anything near production config.
⚑ AutoRead, edit and run commands inside the workspace. Asks before leaving it or hitting the network.Your default. Covers ~90% of real work.
πŸ”“ Full accessEverything β€” network calls, writes outside the project.Rarely. Never in a repo holding live credentials.

🎁 Make the editor part actually pay off

  • Select before you ask. Highlight the function, then open the panel. "Why is this slow?" with a selection beats a paragraph describing where the code lives.
  • Use @ to attach files instead of pasting β€” @src/auth/session.ts gives the live file, not a stale copy.
  • Let it read your errors. If the Problems panel is red, say "fix the type errors in the Problems panel" rather than copying them one by one.

07 Β· The Windows / .NET case

πŸͺŸ Visual Studio 2022 is a different story

Worth being blunt: Visual Studio and VS Code are unrelated products, and the extensions above are VS Code only. As of writing there's no first-party Claude Code or Codex extension for Visual Studio 2022. If you live in VS for .NET or C++, here's what works.

πŸ…°οΈ CLI in the integrated terminal

The pragmatic answer, and it loses less than you'd think. View β†’ Terminal, then run claude or codex from your solution folder.

You keep the agent's full capability. You lose the inline diff β€” but VS reloads changed files automatically and Git's own diff covers review.

πŸ…±οΈ Side-by-side windows

Run the agent in Windows Terminal (or WSL) beside VS. Snap them left and right.

Better for long runs β€” you can scroll the agent's output without stealing focus from the editor.

β–Έ Developer PowerShell in Visual Studio
# from the folder containing your .sln
claude

# give it the build commands up front β€” it can't discover MSBuild alone
> Build with: dotnet build MySolution.sln
> Test with:  dotnet test --no-build
βš™οΈ

Turn off the file-changed prompts first. Tools β†’ Options β†’ Environment β†’ Documents β†’ tick "Detect when file is changed outside the environment" and "Auto-load changes". Without this, every agent edit throws a modal dialog and the run stalls waiting on you.

πŸ’‘ GitHub Copilot's agent mode is the natively integrated option inside Visual Studio if you want inline review without leaving the IDE. Extension availability moves fast β€” check the Visual Studio Marketplace before assuming the above still holds.

08 Β· Configuration

πŸ“ Every file that matters, and why

This is the part that separates people who get a lot out of these tools from people who don't. The agent reads a handful of files at startup β€” and once you own those files, you're configuring behaviour instead of re-explaining yourself in every prompt.

🌳 What a well-set-up repo looks like

β–Έ project structure
my-project/
β”œβ”€β”€ CLAUDE.md                    ← project memory (Claude)   Β· commit βœ…
β”œβ”€β”€ AGENTS.md                    ← project memory (Codex)    Β· commit βœ…
β”œβ”€β”€ .mcp.json                    ← shared MCP servers        Β· commit βœ…
β”œβ”€β”€ .claude/
β”‚   β”œβ”€β”€ settings.json            ← team permissions + env    Β· commit βœ…
β”‚   β”œβ”€β”€ settings.local.json     ← your personal overrides   Β· gitignore ❌
β”‚   β”œβ”€β”€ commands/
β”‚   β”‚   β”œβ”€β”€ review-pr.md        ← becomes /review-pr        Β· commit βœ…
β”‚   β”‚   └── add-endpoint.md     ← becomes /add-endpoint     Β· commit βœ…
β”‚   └── agents/
β”‚       └── test-writer.md      ← a named subagent          Β· commit βœ…
β”œβ”€β”€ .gitignore                  ← must list the local files
└── src/

# and on your machine, outside any repo:
~/.claude/CLAUDE.md             ← your preferences, every project
~/.claude/settings.json        ← your global permissions
~/.codex/config.toml           ← Codex model, sandbox, approvals
~/.codex/AGENTS.md             ← your global Codex instructions
FileWhat it doesCommit?Why it's important
CLAUDE.mdRead at the start of every session. Commands, conventions, warnings.YesThe highest-leverage file in the repo. Everything you'd otherwise retype daily.
AGENTS.mdSame, for Codex. Nested copies in subfolders apply to that subtree.YesLets a monorepo give different rules per package.
.claude/settings.jsonPermission allow/deny rules, environment variables, hooks.YesGuardrails become a team asset instead of each person's local habit.
.claude/settings.local.jsonYour personal overrides on top of the shared file.NoLets you loosen things for yourself without loosening them for everyone.
.claude/commands/*.mdEach file becomes a slash command in the repo.YesTurns your best prompts into shared tooling. Massively underused.
.claude/agents/*.mdSubagents with their own instructions and tool access.YesFor repeated specialist work β€” test writing, migration review.
.mcp.jsonMCP servers available to anyone in this repo.YesNew teammate gets DB and tracker access with zero setup.
~/.claude/CLAUDE.mdYour preferences across every project.N/AStyle and tone that shouldn't be forced on your team.
~/.codex/config.tomlCodex model, approval policy, sandbox, MCP servers.N/APer-machine, so set your safe defaults here once.

πŸ“„ CLAUDE.md β€” the one to write properly

Run /init for a first draft, then edit it hard. Generated versions describe the repo; useful versions describe your conventions and the traps.

πŸ“„ CLAUDE.md
# Project: payments-api

## Commands
- Install: pnpm install
- Test: pnpm test --filter=<package>   (never the full suite β€” 20 min)
- Lint: pnpm lint --fix
- Typecheck: pnpm typecheck        (must pass before you say you're done)

## Conventions
- Money is always integer minor units. Never floats. Never a Number for a balance.
- Errors: throw AppError from src/errors.ts. Never a bare Error.
- New endpoints need a zod schema in src/schemas/ or the router won't register them.

## Do not touch
- src/generated/**   (codegen output)
- migrations/*.sql   (already applied β€” write a new migration instead)

## Notes
- The "legacy" folder is still in production. It is not dead code.
- If a test needs the DB, use the testcontainers helper, not a mock.

βœ… Keep it short

It's prepended to every session, so a 500-line file quietly costs you context on every request. Ruthless beats thorough.

βœ… Only write what was true when something broke

Aspirational style guides get ignored. "Never run the full suite" β€” written after it wasted 20 minutes β€” gets obeyed.

πŸ” .claude/settings.json β€” guardrails as code

Rules are matched by tool and command pattern. Deny rules win. This is how you stop an agent reading your .env without having to remember not to ask it to.

πŸ” .claude/settings.json
{
  "permissions": {
    "allow": [
      "Bash(pnpm test:*)",
      "Bash(pnpm lint:*)",
      "Bash(git status)",
      "Bash(git diff:*)",
      "Read(src/**)"
    ],
    "deny": [
      "Read(./.env)",
      "Read(./.env.*)",
      "Read(./secrets/**)",
      "Bash(rm -rf:*)",
      "Bash(git push:*)"
    ]
  },
  "env": { "NODE_ENV": "development" }
}

⚑ Custom slash commands β€” the underused one

Any markdown file in .claude/commands/ becomes a slash command for everyone on the repo. $ARGUMENTS picks up whatever you type after it.

⚑ .claude/commands/review-pr.md
---
description: Review staged changes like a senior reviewer
---

Review the staged diff. Pay particular attention to: $ARGUMENTS

Check for:
- unhandled error paths
- behaviour changes for existing callers
- tests that assert less than they used to
- new dependencies that weren't requested

Rank findings by severity. Do NOT apply fixes.

Then anyone in the repo types /review-pr security and gets your review standard, not their own improvised one. This is how a team's review quality becomes consistent.

πŸ”Œ .mcp.json β€” give it your real systems

MCP servers let the agent query your database, read tickets, or search internal docs directly instead of you copy-pasting.

πŸ”Œ .mcp.json
{
  "mcpServers": {
    "postgres": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-postgres",
               "postgresql://localhost:5432/dev"]
    }
  }
}
πŸ”’

Point MCP servers at dev, never production. A read-only replica is the most access an agent should ever have to a real database β€” and put the connection string in an env var, not the committed file.

βš™οΈ ~/.codex/config.toml

βš™οΈ ~/.codex/config.tomlCodex
# model names change β€” check `codex --help` or the docs for current values
model = "..."

# safe default: can edit inside the workspace, asks for anything else
approval_policy = "on-request"
sandbox_mode     = "workspace-write"

[sandbox_workspace_write]
network_access = false   # turn on only when a task truly needs it

πŸ™ˆ .gitignore additions

πŸ™ˆ .gitignore
# agent config β€” keep personal overrides out of the repo
.claude/settings.local.json
CLAUDE.local.md
🏁

If you do only one thing from this section: write a real CLAUDE.md / AGENTS.md and commit it. It costs twenty minutes and it's the difference between an agent that guesses your conventions and one that follows them.

09 Β· Workflow

πŸ” The loop that separates useful from annoying

A real sequence β€” each step exists because skipping it causes a specific failure. Use it for anything bigger than a one-line fix.

  1. πŸ—ΊοΈ Orient before you ask for code

    Open with a question, not a task. "Read the checkout flow and tell me where discount codes are validated." You get a map β€” and you find out immediately whether it understands your codebase, cheaply, before it writes 300 lines on a wrong assumption.

  2. πŸ“‹ Get a plan in writing

    Say "plan only, don't write code yet." In Claude Code, Shift+Tab cycles into plan mode, which enforces it. Read the plan properly: correcting a plan costs one sentence, correcting an implementation costs a review cycle.

  3. πŸ›‘οΈ Set the blast radius

    Decide now what it may do unattended. Claude Code: /permissions. Codex: pick the approval mode. Familiar repo with clean git status β†’ loosen it. Deploy scripts or real credentials β†’ don't.

  4. πŸ‘€ Let it run β€” read the diff, not the prose

    The agent's summary of what it did is the least reliable artefact in the session. The diff is the truth. In the editor extensions that's one click β€” which is the main argument for working there.

  5. πŸ”Ž Review it like a stranger's pull request

    Look specifically for: tests weakened to pass, error handling quietly swallowed, a new dependency you didn't ask for, and edits outside the scope you described. Those four cover most of what goes wrong.

  6. πŸ“ Write down what it got wrong

    Corrected the same misunderstanding twice? That's a line in CLAUDE.md or AGENTS.md. Everyone skips this step, and it's the one that compounds.

10 Β· The other comparison

βš–οΈ In the IDE vs. the desktop app

Claude's desktop app bundles chat, Cowork (agentic work on files and documents) and Claude Code in one window. Codex has a comparable story with its cloud tasks. The temptation is to treat these as "the same thing, bigger window." They're not β€” they're built on a different assumption about whether you're watching.

🧩 Extension in your IDE
πŸ–₯️ Desktop app / Cowork
🧩 IDEYou supervise turn by turn. Built for a tight read β†’ review β†’ accept loop.
πŸ–₯️ DesktopYou delegate and come back. Built for tasks that outlast your attention span.
🧩 IDESees your open file, cursor, selection and Problems panel. Context is free.
πŸ–₯️ DesktopKnows nothing about what you're looking at. You describe or attach everything.
🧩 IDENative side-by-side diffs before anything hits disk.
πŸ–₯️ DesktopReview happens after the fact β€” usually in git, or the app's own summary.
🧩 IDEOne project at a time, scoped to the folder you opened.
πŸ–₯️ DesktopSeveral tasks in parallel, across different repos and folders.
🧩 IDECode only. It has no useful opinion about your PDF, spreadsheet or inbox.
πŸ–₯️ DesktopCowork covers the non-code half β€” documents, research, spreadsheets, connectors.
🧩 IDEDies when you close the laptop.
πŸ–₯️ DesktopLong runs survive; start or check work from the mobile app.
🧩 IDEFast to correct β€” interrupt mid-thought, change one word, continue.
πŸ–₯️ DesktopA wrong assumption at minute two is discovered at minute forty.

🧩 Stay in the IDE when…

  • You'd need to review every line anyway
  • The task is scoped to files you can name
  • You're learning the codebase, not just shipping
  • It's production code with real consequences

πŸ–₯️ Go to the desktop app when…

  • The task is mechanical and long β€” bulk migrations, dep bumps
  • You want three things running while you're in a meeting
  • The work isn't a repo: a report, an analysis, a deck from a spec
  • You want to start it from your phone
⭐

The genuinely productive pattern is both. Delegate the mechanical pass to the desktop app or CLI, then open that branch in your IDE and use the extension to review and finish it. Bulk work where supervision adds nothing; careful work where it adds everything.

11 Β· Copy these

🎯 Five prompts that work

Real prompts, not templates. The pattern behind all of them: state the goal, state the constraint, state how you'll know it worked.

β–ΆπŸ§­Land in an unfamiliar codebaseEditor

Day one on a repo. Don't ask it to explain the whole thing β€” ask it to trace one real path, which is how you'd actually learn it.

πŸ’¬ prompt
Trace what happens when a user submits the signup form, from the
HTTP handler down to the database write. List the files in order,
one line each on what that layer is responsible for. Don't change
anything. Flag anything that looks like it's there for a reason
I wouldn't guess.
β–ΆπŸ§ͺFix a failing test without letting it cheatEditor

The failure mode here is famous: the agent makes the test pass by weakening the test. Close that door in the prompt.

πŸ’¬ prompt
`pnpm test auth` fails on "rejects expired tokens".

Find the root cause in the source, not the test. Do not modify the
test file, and do not add skips. Explain the cause in two sentences
before you edit anything, then fix it and re-run that one test.
▢♻️Refactor across many filesCLI / Desktop

Too big for a supervised loop. Give it checkpoint discipline so a bad turn costs one commit, not the whole run.

πŸ’¬ prompt
Replace every direct `process.env.X` read with the typed config
object in src/config.ts. Work package by package. After each
package: run typecheck, then commit with message
"refactor(config): <package>". If typecheck fails, stop and tell
me β€” don't move to the next package.
β–ΆπŸ”ŽReview your own work before the PREditor

The best use of an agent in the IDE, and the most underused. It reads the whole diff, which you won't.

πŸ’¬ prompt
Review the diff against main as if you were the reviewer who has to
maintain this. Focus on: unhandled error paths, anything that
changes behaviour for existing callers, and tests that assert less
than the old ones did. Rank findings by severity. Suggest fixes
but don't apply them.

πŸ’‘ Claude Code has /review as a shortcut β€” or use your own /review-pr command from the files section.

β–ΆπŸ§ΉThe chore you keep postponingDesktop

Perfect delegation candidate: mechanical, well-defined, verifiable, and boring enough that you'll never do it yourself.

πŸ’¬ prompt
Every file in src/routes/ has a copy-pasted try/catch block. Extract
it into a single wrapper in src/lib/handler.ts and apply it
everywhere. Keep behaviour identical β€” same status codes, same log
lines. Run the full test suite at the end and show me the diff
summary grouped by file.

12 Β· Learn these cheaply

⚠️ Things that go wrong

🧠 Context rot

Long sessions get worse, not better. Once a conversation holds three abandoned approaches, the agent is reasoning over its own failed attempts. Start fresh at each new task β€” /clear, or a new conversation. Use /compact only when you genuinely need continuity.

πŸ” Never let it commit unreviewed

An agent that can run git commit unattended will eventually commit something you didn't read. Let it stage, let it write the message β€” keep the commit as your keystroke.

πŸ’£ The skip-permissions flag

Claude Code's --dangerously-skip-permissions (and Codex's full-access mode) exist for sandboxed containers and CI. On your laptop, in a repo whose .env talks to production, they're a genuinely bad idea. If a run needs that much freedom, run it in a container.

🎭 It will confidently claim it's done

"All tests pass" is a claim, not a result. Put verification in the prompt β€” "run the tests and paste the output" β€” and actually read the output.

πŸ’Έ Cost tracks context, not messages

A 40-message session on a small file is cheap. One message that pulls in a 4,000-line file isn't. Attach the specific file, not the folder. /cost shows where a session went.

πŸ†

The habit that beats all of the above: commit before you let an agent start. A clean git status means the worst outcome of any run is git checkout . β€” and knowing that changes how boldly you'll use it.

13 Β· Reference

πŸ—‚οΈ Cheat sheet

⌨️ Claude Code β€” in-session

CommandDoes
/initGenerate a starter CLAUDE.md from the repo
/ideConnect the session to your editor
/clearWipe context β€” do this between tasks
/compactSummarise the session to free context but keep the thread
/reviewReview the current changes
/permissionsSee and edit what it's allowed to do
/agentsManage subagents
/modelSwitch model mid-session
/costToken and cost usage for this session
/mcpManage connected MCP servers
@path/to/fileAttach a file as live context
!commandRun a shell command directly
# noteAppend a line to CLAUDE.md without leaving the session

🎹 Keys worth memorising

KeysDoes
Ctrl/⌘ + EscOpen the Claude Code panel in VS Code
Shift + TabCycle modes β€” plan mode, auto-accept edits
EscInterrupt. Use it early and often.
Esc EscGo back and edit an earlier message
Ctrl + CQuit the session

πŸ–₯️ Terminal

CommandDoes
claude / codexStart an interactive session in the current folder
claude --continueResume the most recent session here
claude --resumePick from previous sessions
claude -p "..."One-shot, non-interactive β€” good for scripts and CI
claude mcp addConnect an MCP server
claude doctorDiagnose install problems
claude updateUpdate to the latest version
codex resumeResume a previous Codex session

πŸ“ Files at a glance

PathScopeCommit?
CLAUDE.mdProject memory (Claude)Yes
AGENTS.mdProject memory (Codex)Yes
.claude/settings.jsonTeam permissionsYes
.claude/settings.local.jsonPersonal overridesNo
.claude/commands/*.mdShared slash commandsYes
.mcp.jsonShared MCP serversYes
~/.claude/CLAUDE.mdYour global preferencesN/A
~/.codex/config.tomlCodex machine configN/A

πŸ“Œ Command names, file paths, extension availability and version requirements move quickly β€” verify against docs.claude.com/claude-code and OpenAI's Codex documentation before relying on anything here. Written against what was current in mid-2026.

Claude Code & Codex in your IDE
18 min read