Never used Claude Code, Cursor or Codex? Learn what a coding agent does, set up a safe first project, describe tasks it can finish, check its work, undo mistakes, and use it to fix bugs, build small tools and understand code.
Beginner friendly. A little programming helps. 66 lessons.
Lessons
- Coding agent vs chat assistantExplain that a coding agent is a language model with tools that reads your files, runs commands and edits code itself, while a chat assistant only returns text you copy by hand. Name what changes as a result: speed, reach and risk.
- The agent loop: act, observe, repeatDescribe the cycle the model runs: decide a next step, call a tool (read, search, run, edit), read the result, and repeat until it judges the task done. Predict that each step is driven by what it has observed so far.
- What the agent can and cannot seeExplain that the agent knows only what is in its context: your messages, files it chose to read, command output and its training data. It cannot see your screen, your unstated intent, files it never opened, or recent library changes.
- Confidently wrong: plausible is not correctRecognise that an agent can write fluent code, invent functions, misread a result, or report 'all tests pass' when they do not. Explain why a confident tone carries no information about correctness.
- What you stay responsible forState that you own every change you accept and every command you approve, including bugs, data loss, leaked secrets and licence or security problems. 'The AI did it' is not a defence at work or in your own project.
- The shape of a session: task to reviewWalk through the five phases of a typical session: you state a task, it explores and plans, it edits, it runs checks, and you review and accept or redirect. Name what you do in each phase.
- What agents do well and what they do badlySort tasks by fit. Well-specified, checkable, local changes in common languages suit agents. Vague goals, subtle design judgement, rare tools, and changes with no way to verify suit them poorly.
- Terminal basics: where you are and running thingsUse a terminal to see the current working directory, list files, change directory and run a program. Explain why an agent's commands run relative to the folder it was started in.
- Command output and exit codesTell normal output from error output. Explain that a command reports success (exit code 0) or failure (non-zero), which is how an agent decides whether a step 'worked'.
- Reading an error message and stack traceFind the error type, the message, and the file and line where a failure happened in a stack trace. Identify which part to paste to an agent as evidence.
- How a code project is laid outRecognise the usual parts of a project: source folders, entry point, config files, README, test folder and ignored files. Know where to look first in an unfamiliar repo.
- Dependencies, package managers and lockfilesExplain that projects pull in external packages through a package manager (pip, npm, ...), listed in a manifest and pinned in a lockfile. Explain why installing a package runs someone else's code on your machine.
- Environment variables and where secrets liveExplain how API keys and passwords usually reach a program: environment variables, `.env` files and config files. Explain why these files must stay out of git and out of anything you share.
- Git commits as snapshots you can return toExplain a repository, the staging area and a commit as a saved snapshot of the whole project with a message. Explain why a recent commit works as an undo button for anything an agent does afterwards.
- git status and reading a diffUse `git status` to see which files changed and `git diff` to see exactly how. Read a unified diff's '-', '+' and '@@' lines without help.
- Undoing with git: discard, reset, revertChoose the right undo. Discard uncommitted changes to files, return to the last commit, or revert a commit that is already made. Know which of these permanently loses work.
- Branches as parallel lines of workExplain a branch as a movable pointer to a line of commits. Create one for an experiment, switch between branches, and merge or delete it depending on how the experiment went.
- What automated tests are and how to run themExplain a test as code that runs your code with known inputs and checks the output. Run a project's test suite with one command and read which tests passed and which failed.
- Tokens: how models measure textExplain that models read and write text as tokens (word pieces). Explain that files, command output and conversation all consume tokens, which sets both memory limits and cost.
- Terminal, IDE and cloud agentsCompare the three common forms. A terminal agent runs in your shell, an IDE agent works inside an editor with inline diffs, and a cloud agent works on a copy of your repo in a remote sandbox and returns a branch or pull request.
- Choosing a tool for how you workPick a starting tool by weighing whether you prefer an editor or a terminal, whether the code may leave your machine, how much isolation you want, and team or employer rules. Know that the core skills transfer between tools.
- Approvals and permission modesExplain the common mechanism of approvals. The agent asks before edits or commands, you can allow specific safe commands permanently, and 'auto-approve' modes trade oversight for speed. Choose a cautious default.
- Sandboxes and isolated environmentsExplain how running the agent in a container, VM, dev container or cloud sandbox limits what a mistake can damage. Explain why this is the condition under which more autonomy becomes reasonable.
- What never to let an agent touchList the usual no-go zones: production systems and databases, real customer data, deploy and payment credentials, your home directory, and anything without a backup. Explain how to keep them unreachable rather than just asking the agent nicely.
- A safe first project: folder, git, clean stateSet up a dedicated project folder under git with a first commit and a `.gitignore` for secrets. Start your chosen agent from that folder with cautious approvals, so every change is visible and reversible.
- Your first small task, end to endRun one tiny, checkable task, such as adding a command-line option to a script. Watch it read files, approve its edit, run the result yourself, inspect `git diff` and commit, which practises the whole loop once.
- Describing a task: goal, context, constraints, checkWrite a task prompt that states the goal, the relevant files or background, the limits (don't touch X, keep the API) and how success will be checked. Explain which missing piece causes which typical failure.
- Giving the right context: files, errors, examplesPoint the agent at specific files, paste the exact error output, and give an example of the desired result instead of describing it vaguely. Explain why precise evidence beats a long description.
- Sizing and splitting tasksJudge whether a task is small enough to review in one sitting. Split a large request into steps that each end in a checkable, committable state.
- Project instruction files: purpose and contentsExplain that an instruction file (CLAUDE.md, AGENTS.md, ...) is read automatically at session start, which fixes the 'it forgets every session' problem. Write a short one covering how to build, run and test, key conventions, folders to leave alone, and recurring mistakes. Keep secrets and long prose out of it, and update it whenever the agent repeats an error.
- Following the agent while it worksRead the stream of tool calls as it happens: which files it opens, what it searches for, what it runs. Spot early signs it has misunderstood, such as wrong files, unrelated edits or repeated failures.
- Interrupting and redirecting mid-taskStop the agent as soon as it heads the wrong way and give a one-line correction. Explain why early redirection is cheaper than reviewing and undoing a long wrong run.
- Reading the agent's summary skepticallyTreat the end-of-task summary as claims to check, not facts. Notice what it says it did, what it says it verified, and what it quietly left out or marked as 'should work'.
- Reviewing the diff the agent madeRead the full diff of a change with `git diff` or an editor view. Check that every changed file belongs to the task, that nothing unrelated was deleted, and that the logic matches what was asked.
- Running and trying the result yourselfRun the program, the tests or the script yourself on a realistic input, including one edge case. Do not accept the agent's claim that it ran them, and explain what this catches that reading the diff does not.
- Spotting bad shortcuts in a changeRecognise typical shortcuts: hardcoded values, swallowed errors (empty catch blocks), disabled checks or linters, special cases for one input, and 'TODO' stubs presented as finished work.
- Verifying before you accept a changeApply a fixed acceptance routine before committing: check the summary against the diff, run it yourself, scan for shortcuts, and make sure you could explain it. Scale how deep you look with the risk of the change.
- Giving useful feedback on a wrong resultRespond to a wrong result with concrete evidence: the failing command and its output, the observed vs expected behaviour, and a pointer to the faulty line. Do not reply with 'still broken'.
- Recognising when the agent goes in circlesSpot the signs of a stuck agent: the same fix tried repeatedly, growing patches over patches, flipping between two approaches, or an apology without new evidence. Decide to stop, revert and reframe.
- Commit before every task: checkpointsMake a commit (or use the tool's snapshot feature) before each task and after each accepted step. Then every attempt starts from a known-good state and costs nothing to throw away.
- Branches for risky or alternative attemptsPut a risky change or a second approach on its own branch so main stays clean. Compare the two attempts and merge or delete the branch.
- Recovering from a bad changeGiven a broken state, choose the right recovery: discard uncommitted edits, return to the last checkpoint, or revert a specific commit. Then restart with a better prompt instead of piling fixes onto a bad attempt.
- The context window: the agent's working memoryExplain that everything in a session (instructions, messages, files read, command output) shares a fixed token budget. Predict what fills it fastest: large files, long logs and long sessions.
- Why long sessions degradeExplain why quality drops as context fills. Early instructions get diluted, stale failed attempts mislead, and automatic summarising (compaction) drops details. Recognise the symptoms in a real session.
- Cost and usage limitsExplain what drives usage: tokens read and written, long contexts, repeated tool loops, and stronger or slower models. Explain how subscription limits and pay-per-use differ in general, and why focused tasks waste less.
- When and how to start a fresh sessionDecide when to clear or restart: a new task, a polluted or stuck conversation, nearly full context, or rising cost. Carry over what matters in a short handoff note or the instruction file instead of the whole history.
- Asking for a plan before any editsAsk the agent to explore and propose a plan without changing files, using a plan or read-only mode or a plain instruction. Explain why this reveals misunderstandings before they become code.
- Reviewing and editing a planCheck a plan for wrong assumptions, missing steps, files it should not touch, and steps with no way to verify them. Correct the plan in words before approving it, which is the cheapest place to fix a design mistake.
- Doing a bigger change plan-first, step by stepRun a multi-step change by approving a plan, saving it to a file, executing one step at a time, and verifying and committing after each step. Re-plan when reality differs from the plan.
- Spotting tests bent to passRecognise when an agent makes tests pass by changing or deleting the tests, loosening assertions, mocking away the real code, or special-casing test inputs. Know how to forbid this in the task.
- Tests as the definition of doneTurn 'done' into a command that passes, for example by having a failing test written first and then making it pass without editing it. Explain why this gives the agent a goal it can check itself and gives you evidence.
- Outdated knowledge and invented APIsExplain why agents use old library versions, deprecated calls, or functions and flags that never existed. Counter this by pointing them at the installed version, the docs or the source.
- Workflow: fixing a bug from an error messageFix a bug end to end. Give the exact error and how to reproduce it, have it reproduce the failure as a test first, review the root-cause explanation, apply the minimal fix, and confirm the test passes and nothing else broke.
- Workflow: adding a small featureAdd a feature end to end. Specify behaviour with examples and edge cases, get a plan, implement in committed steps with tests, try it yourself, and review the final diff as a whole.
- Workflow: having the agent write testsGet useful tests for existing code by asking for behaviour-focused cases, edge cases and failure cases. Check that each test would fail if the code were broken, and decide what to do when a test exposes a real bug.
- Workflow: understanding unfamiliar codeUse the agent as a guide to a new repo. Ask where things live, how a request flows through the code, and what a function is for. Ask for file and line references, check claims against the code, and write your own short map.
- Workflow: one-off scripts and data choresHave the agent write throwaway scripts for renaming files, converting formats or cleaning a CSV. Work on a copy of the data, run on a small sample first, and spot-check outputs before running on the real thing.
- Workflow: building a small tool from scratchStart a new tool in an empty git folder. Describe what it does with example inputs and outputs, ask for the simplest stack with few, checked dependencies, and get a runnable skeleton first. Add an instruction file with run and test commands, then grow the tool in planned, committed steps.
- Workflow: refactoring safely with an agentRefactor safely by making sure tests cover the behaviour first, then asking for behaviour-preserving changes in small committed steps on a branch. Check that no test or public interface was quietly changed.
- Keeping secrets out of the agent's reachExplain how secrets leak: the agent reads `.env`, prints keys in logs, commits them, or sends them to the model provider. Use ignore and deny rules, test keys and separate credentials so the agent never needs the real ones.
- Catching destructive commandsRecognise risky commands before approving them: recursive deletes, force-push, history rewrites, database drops, and installs with system-wide effects. Explain why 'always allow' must never cover them.
- Unknown and invented packagesExplain why an agent may suggest a package that does not exist or is a malicious look-alike, which attackers register on purpose. Check name, publisher, popularity and need before approving an install.
- Untrusted text steering the agentExplain prompt injection: instructions hidden in a web page, issue, README, dependency or data file can redirect the agent. Explain why private data plus untrusted input plus a way to send data out is the dangerous combination.
- Setting safety boundaries for a sessionChoose the boundaries for a given task: the folder, permission level, network access, credentials in reach, and whether it runs in a sandbox. Base the choice on what the worst plausible mistake or injection could damage.
- When not to use an agentRecognise poor-fit situations: you cannot check the result, the change is tiny and faster by hand, the stakes are high and the reviewer is unclear, the domain or tool is too obscure, or you need to learn the skill yourself.
- Learning yourself instead of outsourcing itUse the agent so your own understanding grows. Predict before reading its answer, ask it to explain its choices, write key parts yourself sometimes, and only accept code you could explain to a colleague.
Bytewise
All courses