Go from never having used a coding agent to working productively and safely with one. The learner should understand what an agent is and how it differs from a chat assistant. They should choose a tool, set up a protected first project, describe tasks the agent can do well, and follow and verify its work. They should recover from bad changes, manage context, and plan bigger changes. They should also use tests as the definition of done and run everyday workflows (bug fixes, features, writing tests, codebase exploration, scripts, small tools, refactors). Throughout, they should keep secrets and systems safe and keep their own understanding growing instead of outsourcing it.
The context window: the agent's working memory
card 4 of 5
Reading a log: whole vs. targeted
builds on: Tokens: how models measure text, What the agent can and cannot see
Ask for only the part that matters. `tail -n 200` prints just the last 200 lines of a file, and only those lines enter the context. The token counts are rough. They assume log lines of about 60 characters, and plain text runs about four characters per token, so each line is about 15 tokens.
# Costly: the whole file
▸ You: why does the import fail? see app.log
⚙ Read: app.log
# 8,000 lines ≈ 120,000 tokens
# over half of a 200,000-token budget
# Targeted: only what matters
▸ You: check only the last 200 lines of
app.log and find the error that ended the run
⚙ Run: tail -n 200 app.log
# 200 lines ≈ 3,000 tokens
Terms on this card
- token
- A word piece, the unit a model uses to read and write text. In English, roughly four characters or three-quarters of a word.
- log
- A file where a program writes a running record of what it did, often thousands of lines long.
- `tail -n 200`
- A command that prints only the last 200 lines of a file instead of the whole thing.
- context
- All the text the agent currently has to work from: your messages, file contents it read, command output, and its own earlier replies.
- tokens
- Secret strings, similar to API keys or passwords, that a service issues to grant access.
Lesson goal: Explain 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. ·
the whole lesson