AGENTIC BASICS 1 / 24

A talk for engineers · 29 minutes · source: aihero.dev

The new starter
with no memory.

The basics of agentic development, from Matt Pocock’s AI Hero. What an agent is, why it fails, and the flow that keeps it honest.

Before we start · two things to hold

This is not a machine learning topic. The agent writes the code. You decide what is worth building, and whether what came back is right. Your engineering judgement is the asset. It transfers directly.

“AI is not a super-powered developer. It’s a new starter with no memory.”

aihero.dev/how-to-make-codebases-ai-agents-love

No memory between sessions. Every session starts empty.

The mechanism · start here

“An agent, though, doesn’t use predetermined steps. It calls an LLM and gives it a bunch of tools, different options of things that it can do next.”

aihero.dev/what-is-an-agent
read a file edit it run the tests read the output not finished — go again done you typed once — the agent did all of this

A tool is one action it can ask for: read a file, run a command.

A real session, cropped · nothing here is mocked up

Slide 3 said “run the tests” · here is one, with the code it checks

Run it · the real output, cropped · nothing here is reworded

“When working with AI coding agents, especially those operating independently, you need feedback loops so the AI can verify its own work.”

aihero.dev/essential-ai-coding-feedback-loops-for-type-script-projects

The same session as slide 4, further down · still not mocked up

“Tests and feedback loops are essential — they’re how your AI new starters know if their changes work.”

aihero.dev/how-to-make-codebases-ai-agents-love

Why a loop beats a reminder

“AI agents don’t get frustrated by repetition. When code fails type checking or tests, the agent simply tries again.”

aihero.dev/essential-ai-coding-feedback-loops-for-type-script-projects

“Poor feedback loops. The AI doesn’t receive feedback fast enough, so it doesn’t know if what it changed actually did what it intended.”

aihero.dev/how-to-make-codebases-ai-agents-love

The fact behind every failure you will hit this week

“An agent can only work with what’s in its context window.”

aihero.dev/plan-mode-introduction

“Agents often work in fresh context windows.”

aihero.dev/my-7-phases-of-ai-development

What is actually in the window

1 2 3 4 5 1 system + CLAUDE.md 2 file contents 3 command outputs 4 conversation history 5 your prompt

Measured in tokens — chunks of text. A thousand tokens is roughly 750 words. A full window is about a short novel.

“Same model, same harness — just more context.”

boundary — debated SMART ZONE DUMB ZONE most of the window free window limit ↑

“The zones don’t track the context window limit. A session can be deep in the dumb zone with most of the window still free”

aihero.dev/ai-coding-dictionary/smart-zone

Why quality falls · the attention budget

the thing you care about — same size in both early in the session later — ten times as much in the window

Attention is a fixed budget, spread across everything in the window.

“Like humans, who have limited working memory capacity, LLMs have an “attention budget” that they draw on when parsing large volumes of context.”

anthropic.com/engineering/effective-context-engineering-for-ai-agents

What to do · spend the window on one task

“Use /clear frequently between tasks to reset the context window entirely”

code.claude.com/docs/en/best-practices

/clear is a slash command. You type it into the agent.

When it drifts from what you told it, do not paste in more documentation. That makes it worse. Clear it, and start again.

Three ways a session goes bad · from the official docs

  • Kitchen sink“You start with one task, then ask Claude something unrelated… Context is full of irrelevant information.”
  • Corrections“…you correct it, it’s still wrong, you correct again. Context is polluted with failed approaches.”
  • Exploration“You ask Claude to ‘investigate’ something without scoping it. Claude reads hundreds of files, filling the context.”

“If you’ve corrected Claude more than twice on the same issue in one session… Run /clear and start fresh with a more specific prompt that incorporates what you learned.”

code.claude.com/docs/en/best-practices

No memory · so where do you write it down?

“CLAUDE.md is a special file that Claude reads at the start of every conversation… This gives Claude persistent context it can’t infer from code alone.”

code.claude.com/docs/en/best-practices

“For each line, ask: ‘Would removing this cause Claude to make mistakes?’ If not, cut it. Bloated CLAUDE.md files cause Claude to ignore your actual instructions!”

code.claude.com/docs/en/best-practices

When a fact becomes a procedure · move it out of CLAUDE.md

“If an entry is a multi-step procedure or only matters for one part of the codebase, move it to a skill… instead.”

code.claude.com/docs/en/memory

“Only the name and description sit in context by default. When the agent’s task matches, it loads the rest. Until then, the skill takes up almost no room — a sentence or two of tokens, however large its full instructions are.”

aihero.dev/ai-coding-dictionary/skill

The session ends. Everything you agreed dies with it.

“The spec exists because context windows end.”

aihero.dev/skills-to-spec

“the tickets are disposable and the spec isn’t” — a session dies in the dumb zone, and the spec is what survives into the next window.

Matt’s pipeline · five skills you type, in order

  • /grill-with-docs“Get interviewed about a plan, and record the decisions.”
  • /to-spec“Turn an agreed conversation into a written spec.”
  • /to-tickets“Split a spec into small tickets an agent can build.”
  • /implement“Build a finished spec into code, test-first.” — /tdd is the engine inside this step.
  • /code-review“Review a diff against your standards and against the spec.”

The same ticket, twice

Cold

Prompt the agent. It builds the wrong thing. Correct it twice. /clear. Type the whole brief again from memory.

With the flow

Grill once. A spec file. Three tickets. Each ticket is a fresh session that reads the spec.

You write the brief once. Every later session reads it.

Stage one · the grilling · plan before any code

“You wouldn’t chuck vague requirements at a human colleague and expect good results. Without plan mode, that’s exactly what you’re doing to an AI.”

aihero.dev/plan-mode-introduction

“In plan mode, you iterate with the agent on what you want to build before any code gets written.”

aihero.dev/plan-mode-introduction

Inside implement · the loops · cheapest first

  • Types“TypeScript is essentially free feedback for your AI. Use it over JavaScript.”
  • Tests“Basic unit tests covering core functionality help keep the AI on track.”
  • Hooks“If any step fails, the commit is blocked and the AI gets an error message.”
  • Format“This runs Prettier on all staged files and automatically restages them.”

aihero.dev/essential-ai-coding-feedback-loops-for-type-script-projects

Your first skill · the whole of /grill-me

“Interview me relentlessly about every aspect of this plan until we reach a shared understanding. Walk down each branch of the design tree, resolving dependencies between decisions one by one. And finally, if a question can be answered by exploring the code base, explore the code base instead.”

aihero.dev/5-agent-skills-i-use-every-day

“Skills don’t have to be long to be impactful. You just need to choose the right words at the right time.”

aihero.dev/5-agent-skills-i-use-every-day

Do this

  • MondayOne real ticket, in plan mode. Shift+Tab. No code until the plan is right.
  • TuesdayRun /grill-with-docs on the next ticket. Keep the file it writes.
  • This weekOne feedback loop the agent can fail against. A typecheck, or a pre-commit hook.
  • Every timeRead the diff. You are still the engineer. Nobody else is reviewing this.

Thank you

“You have access to a fleet of middling to good engineers that you can deploy at any time. But these engineers have a critical flaw: they have no memory. They don’t remember things they’ve done before.”

aihero.dev/5-agent-skills-i-use-every-day

No memory.
So write it down.

grill-with-docs→ to-spec→ to-tickets→ implement→ code-review