← Master Index
Vol. 22 Module 22.6 Lecture

Claude Code

AI IDEs & Coding Tools

How This Lesson Fits the Module & Volume

The first three lectures were GUI IDEs: Cursor, Windsurf, Copilot. Claude Code is Anthropic’s terminal coding agent—agentic by default, not a Tab ghost-text product. It pairs with Vol. 22.1 Anthropic (Claude, Claude Code, Artifacts, Projects, API) and Vol. 18 Anthropic SDK: same models, different UX (CLI loop vs Messages API in your service).

Vol. 15 agent loops / tool calling / HITL are the right mental model: Claude Code reads files, runs commands, edits, and asks permission. Vol. 21 coding assistants still demand tests and human ownership of the diff. Next: Gemini CLI, Google’s terminal peer.

Learning Objectives

By the end of this lesson, students should be able to:

  • Define Claude Code as a terminal-native, tool-using coding agent (not an IDE Tab).
  • Contrast agentic CLI work vs autocomplete in Cursor/Copilot.
  • Use project memory files (e.g. CLAUDE.md) plus ignore/permission gates for privacy.
  • Place Claude Code next to the Anthropic API/SDK (Vol. 18 / 22.1) without conflating them.
  • Choose Claude Code vs Gemini CLI vs GUI IDEs from stack, UX, and risk constraints.
  • Keep dangerous shell tools behind HITL; never unsupervised prod deploys.
Definition

Claude Code is Anthropic’s command-line coding agent. You run it in a repo; it uses tools (read/write files, shell, search) in a Vol. 15-style loop, typically with permission prompts for sensitive actions. Project conventions often live in a CLAUDE.md (name may evolve). Authentication is via Anthropic account / API key / Claude subscription—confirm current install docs. It is complementary to GUI IDEs: many developers keep Copilot/Cursor for Tab and Claude Code for long agentic tasks.

Agent-First, Not Autocomplete-First

Claude CodeCursor / Copilot Tab
Primary UXTerminal conversation + tool traceGhost text in the buffer
Default jobMulti-step implement / repair / explainNext chunk of code
LatencySeconds to minutes per turnSub-second
HITLApprove tools + review git diffAccept/ignore snippet
Vol. 15 analogueAgent loop + toolsSuggestion only

If you try to use Claude Code as “smarter Tab,” you will overspend tokens and underuse the product. If you try to use Tab as a multi-file architect, you will miss call sites. Pair them.

Good Claude Code tasks

  • Add a FastAPI route + tests (Vol. 18)
  • Bisect a failing pytest
  • Repo Q&A with file citations
  • Mechanical refactors with git diff review

Keep in the GUI IDE

  • Keystroke autocomplete
  • Visual debug / GUI merge
  • JetBrains inspections

Keep out of both

  • Exploit / malware generation
  • Unattended kubectl apply to prod
  • Pasting production secrets

Privacy and Repo Context

Claude Code’s context is the working tree plus what it reads. There is no magic whole-repo paste; the agent chooses files (Vol. 11 context budget still applies). You influence it with CLAUDE.md, ignore patterns, and permission allowlists. Data handling follows your Anthropic plan (API vs consumer subscription vs Team/Enterprise)—read retention/training settings; do not invent them.

Shell tools are the privacy and safety hotspot: a coding agent that can run curl or read ~/.ssh needs the same Vol. 20 discipline as any tool-calling agent. Prefer project-scoped directories; deny broad filesystem by default.

Catalog Snapshot (Qualitative)

DimensionClaude CodeGemini CLIGitHub Copilot
Pricing postureAnthropic subscription and/or API tokens; agent turns can be token-heavy—watch usage dashboardsGoogle AI Studio / Gemini API / Vertex metering; free-tier experiments possibleSeat + premium/agent requests
StrengthsAgent-first terminal UX; Claude reasoning/coding quality; CLAUDE.md; works beside any editorLong-context Gemini; Google Cloud alignment; open CLI trajectoryIDE Tab + GitHub PR path; multi-IDE
WeaknessesNo native JetBrains ghost text; runaway shell/token spend; not a visual IDENewer daily-driver culture; Vertex IAM complexityWeaker terminal-agent story than dedicated CLIs (gap changes)
Agentic vs autocompleteAgentic defaultAgentic defaultAutocomplete heritage + added agents
Privacy / repoLocal workspace + Anthropic retention SKU + permission promptsLocal workspace + Google data terms / VertexContent exclusion + org policy

CLI + Project Memory Sketch

Commands and flags change—treat this as an educational pattern. Always confirm with current Anthropic Claude Code docs. Educational use on repos you own.

# CLAUDE.md — project memory (commit this; no secrets) # Stack: FastAPI + pytest (Vol. 18). Formatter: ruff. # Agent rules: # - Propose diffs; do not push to main. # - Run `pytest -q` after edits. # - Never read or echo .env. Ask the human to set env vars. # - Refuse exploit, malware, and unauthorized-access tasks (Vol. 20). # - Prefer editing src/ and tests/ only. # typical terminal loop (illustrative — verify current binary name) # claude # start in repo root # /permission # review tool allowlist # "Add GET /health returning {status: ok} and a pytest." # hitl_gate.py FORBIDDEN_TOOLS = {"rm -rf /", "kubectl apply -f prod", "curl | sh"} def allow_shell(cmd: str, human_ok: bool) -> bool: if any(bad in cmd for bad in FORBIDDEN_TOOLS): return False if cmd.startswith(("git push", "git reset --hard")): return human_ok return True

When to Pick Claude Code

Pick Claude Code when

  • The team already standardizes on Claude (22.1 / Vol. 18 SDK).
  • Work is SSH/tmux/remote and GUI IDEs are awkward.
  • The task is inherently agentic (multi-file + tests).
  • You want CLAUDE.md as the repo’s agent contract.

Pick something else when

  • Ghost text in JetBrains is the daily need → Copilot.
  • Google Cloud / Vertex is the mandated substrate → Gemini CLI.
  • Non-engineers need a browser preview → Bolt / Lovable / Replit.
  • Legal forbids Anthropic data paths.

Related Lectures

LectureRole
Anthropic catalog (22.1)Models, API, Artifacts vs this CLI
Anthropic SDKSame vendor, service-side Messages API
Agent loop / tool callingTheory of the CLI trace
Coding assistantsHITL + eval still required
Gemini CLINext terminal peer
Common Misconception

“Claude Code is the Anthropic API with extra logging.” The API is for your products (Vol. 18); Claude Code is a developer agent. Second: auto-approving all shell tools is fine on a laptop with prod kubeconfigs. Third: CLAUDE.md may contain API keys. Fourth: it replaces CI. Fifth: token-heavy agent runs are “free with Pro” without reading the meter. Sixth: inventing dollar prices or SWE-bench scores from memory.

Knowledge Check

  1. Short Answer: Is Claude Code primarily autocomplete or agentic? Answer: Agentic terminal coding agent (not IDE Tab).
  2. True/False: Claude Code and the Anthropic SDK are the same UX. Answer: False—CLI developer agent vs Messages API in your service.
  3. Multiple Choice: A good Claude Code task is: (a) add FastAPI route + pytest, (b) unsupervised kubectl to prod, (c) generate ransomware. Answer: (a).
  4. Short Answer: What file often holds project agent conventions? Answer: CLAUDE.md (or current equivalent).
  5. True/False: Shell tool allowlists are part of privacy/safety for Claude Code. Answer: True.
  6. Multiple Choice: Pricing posture is closest to: (a) Anthropic plan/API tokens (watch agent usage), (b) a fake $9 figure, (c) n8n self-host only. Answer: (a).
  7. Short Answer: When pick Gemini CLI instead? Answer: Google Cloud / Vertex / Gemini long-context mandate (or bake-off win).
  8. True/False: You should still review the git diff after Claude Code edits. Answer: True.
  9. Multiple Choice: Vol. 15 analogue is: (a) agent loop + tools + HITL, (b) CNN backprop, (c) BLEU only. Answer: (a).
  10. Short Answer: Name one GUI tool to keep for ghost text alongside Claude Code. Answer: Copilot, Cursor, or Windsurf Tab.

Key Takeaways

  • Claude Code is Anthropic’s terminal agent—agentic default, complementary to IDE Tab.
  • CLAUDE.md, ignore rules, and permission prompts are the privacy/repo contract.
  • Do not conflate it with the Anthropic SDK used inside Vol. 18 services.
  • Pricing is subscription/API usage; agent turns can be token-heavy.
  • Next: Gemini CLI.
Trainer’s Guide

Lab: On a toy FastAPI repo, add CLAUDE.md and a .env that the agent must not read. Ask Claude Code (or a mock tool trace if licenses are unavailable) to add /health + test. Human reviews diff.

Whiteboard: Draw IDE Tab vs Claude Code loop vs Anthropic SDK in FastAPI. Preview Gemini CLI as the Google-shaped twin.

Recap: Claude Code turns Vol. 15 agent loops into a daily terminal tool on Anthropic’s models—HITL diffs, no Tab replacement. Continue to Gemini CLI.