Contents Lesson 1 of 9

14 min read · foundations

Install your agent, set its limits, and get a first table

By the end of this lesson you will have a coding agent installed, a clear idea of what it may and may not touch on your machine, and a folder holding one script it wrote that prints a three-row table in your terminal: ticker, last price, change on the day in per cent, and the time of the quote in UTC.

The idea

From here the track works with one kind of assistant: an agent in your terminal that reads your files, runs your commands and shows you each change before it lands. Two decisions come first, and you make them once — which agent, and what it may do.

Which agent, and what it costs

This track's examples use Claude Code. Codex CLI, OpenAI's terminal agent, follows every lesson too: where a command or a file differs, the lesson shows both, Claude Code first. Neither is free:

Claude Code Codex CLI
Account a Claude Pro plan or higher (Pro is $20 a month billed monthly), or a Claude Console API key that pays per use a ChatGPT Plus plan or higher (Plus is $20 a month), or an OpenAI API key that pays per use
Not enough the free claude.ai plan ChatGPT Free and Go, which offer Codex in the desktop app only
Check it installed claude --version codex --version
Sign in the first claude you run asks the first codex you run asks; codex login does it again

Install with the official installer:

# Claude Code — macOS, Linux, WSL
curl -fsSL https://claude.ai/install.sh | bash
# Claude Code — Windows PowerShell
irm https://claude.ai/install.ps1 | iex
# Codex CLI — macOS, Linux, WSL
curl -fsSL https://chatgpt.com/codex/install.sh | sh
# Codex CLI — Windows PowerShell
powershell -ExecutionPolicy ByPass -c "irm https://chatgpt.com/codex/install.ps1 | iex"

A third path works with every lesson as well, minus the commands that belong to one agent: the agent mode of your editor. Whether it reads AGENTS.md, the rules file lesson 2 writes, depends on the editor; if it does not, paste the file in as your first message. Claude Code and Codex both read it.

What it is allowed to do

Both agents check an action — editing a file, running a command — before it happens, and both let you choose how much they do without asking. They draw the line in different places.

Claude Code checks rules first, then a mode:

the agent wants to act
  → a deny rule matches?   refused
  → an ask rule matches?   you are asked
  → an allow rule matches? it runs
  → no rule at all?        the permission mode decides

The mode is the default for everything no rule covers. In a session, Shift+Tab cycles through them and the status bar names the one you are in. Recent versions start in auto mode, where a second model reviews each action instead of you. While you are learning, start in manual mode, where every edit and every command stops and waits:

claude --permission-mode manual

(manual is the same mode the previous course set with "defaultMode": "manual": the agent asks before every edit and command. Older guides call it default, which still works as a second name.)

Codex CLI runs every command inside a sandbox the operating system enforces, which decides where the command may write and whether it may reach the network, and an approval policy decides when it stops for you. /permissions in a session switches between its presets. While you are learning, start in Read Only, where it reads your files but asks before every edit and before any command that writes or uses the network:

codex --sandbox read-only --ask-for-approval on-request

Either way it is slow for a week, and then the fastest way to learn what the agent actually does. Loosen it later, one step at a time.

Claude Code's rules live in .claude/settings.json inside the project, and /permissions lists every rule in force with the file it came from. A sensible first set:

Allow without asking Ask every time Deny
npm test, npm run … git push reading or editing .env and .env.local

The deny column is the one that matters, and the starter repository you clone at the end of this lesson already carries it as Read(./.env.local) and its siblings: Claude Code cannot open the file your key lives in.

Be clear about what that rule covers, because the honest answer is "less than it looks". It stops Claude Code's own file tools and the shell commands it recognises as reading a file, such as cat. It does not stop a Node or Python script the agent writes and runs from opening the file itself. Closing that gap at the operating-system level is what Claude Code's sandbox is for: /sandbox turns it on, on macOS, Linux and WSL2, and native Windows has none.

Codex has no counterpart to that deny rule in its default setup. Its sandbox is on from the start, on every system, but it limits where commands write and what they reach, not which files inside your folder they read. A beta feature, permission profiles, can deny a path to every command the agent runs, a script included, which is further than Claude Code's rule reaches. It replaces the --sandbox setting rather than adding to it, and on native Windows it needs Windows 11's MXC sandbox or one an administrator installs. Until it leaves beta, this course does not rely on it.

With either agent, the other half is you reading each command before you approve it, and a sentence in the rules file — lesson 2. On Codex, that half is all there is.

One setting to never use on your own machine: Claude Code's bypassPermissions mode, or Codex's --dangerously-bypass-approvals-and-sandbox. Both skip every check, and both exist for throwaway containers.

Try it now

The prompt

Make an empty folder, open a terminal in it, start the agent in its learning mode — claude --permission-mode manual, or codex --sandbox read-only --ask-for-approval on-request — and paste:

Create quotes.mjs, a Node script with no dependencies. It fetches delayed
quotes for AAPL.US, MSFT.US and TSLA.US in ONE request to
https://eodhd.com/api/real-time/AAPL.US?s=MSFT.US,TSLA.US&fmt=json&api_token=demo
and prints a table with four columns: ticker, last price (close), change
on the day in per cent (change_p), and the quote time in UTC from the
timestamp field, which is in Unix seconds. Run it with node and show me
the output. Do not install anything.

demo is a public token EODHD APIs publish for trying the API. It covers a handful of symbols, these three among them, and spends nothing from any account. Below is the same request answered with the academy's own key; your table should have the same three tickers, with prices from whenever you ran it.

Show the API answer
Live API response: der3 three last prices

What the agent should do

Two permission prompts, and you read both before saying yes:

  • Create quotes.mjs, one new file, usually thirty to forty-five lines once it has formatting and error handling: a fetch, a loop or a map over three objects, and a console.table or a hand-built table. No package.json, no node_modules.
  • Run node quotes.mjs, a command that writes nothing and talks to one host.

If it asks for anything else — installing a package, reading another folder — answer no and ask why.

Check it yourself

  1. Run node quotes.mjs yourself, outside the agent. Three rows, one per ticker, four columns.
  2. Run ls. The one file you asked for and nothing else.
  3. Compare the tickers with the academy's table above, and the time column with your clock. A delayed quote is minutes old while the market is open and hours old after it closes.
  4. Go up out of your scratch folder, clone the starter with git clone https://github.com/EodHistoricalData/academy-dashboard-starter, and run npm install inside the new folder. It prints many npm warn lines and ends with a count of "vulnerabilities": that is expected. Do not run npm audit fix; it can change versions the starter depends on. Then open .claude/settings.json. The deny rules for the env files are there; they are Claude Code's, and Codex does not read this file.
  5. Start your agent in the starter folder. In Claude Code, type /permissions: the starter's deny rules are listed, each with the settings file it came from. There are more than the two you wrote in Start From Zero, because the starter denies both reading and editing, for each env file name. In Codex, type /status: its Permissions line names the preset in force, Read Only, its Agents.md line names the starter's AGENTS.md, and there is no deny rule to list.

Break it on purpose

Ask the agent to add Nvidia to the list and run the script again. The demo token does not cover Nvidia, and the API answers 403. (On Windows a script that exits with an error may print an extra line starting Assertion failed after the error; that is Node's exit glitch, not yours.) Watch what the script does with an answer it was not written for — a crash, a row of undefined, or a silently shorter table. Then ask for the status code and the response body to be printed whenever the request fails, and run it once more.

Compare with ours

The part of our script that matters
const body = await res.json();
// One symbol comes back as a bare object, several as an array.
const rows = Array.isArray(body) ? body : [body];
console.table(rows.map((q) => ({
  ticker: q.code,
  price: q.close,
  "change %": q.change_p,
  "time (UTC)": new Date(q.timestamp * 1000).toISOString().slice(11, 16),
})));

The whole file, with the failure branch from "Break it on purpose", is on the branch ref/work-with-an-agent/1 of the starter repository, in first-win/quotes.mjs.

The demo data is for trying the API, and nothing in it is investment advice.

Checkpoint

Put the scratch folder under git: run git init, then git branch -m main, then git status (it should list quotes.mjs and nothing else), then git add -A, and commit the script:

first win: three delayed quotes from the demo token, no dependencies

Then answer this lesson's questions. The starter repository you cloned is where the rest of the course happens.