How AI Coding Agents Actually Work

Max who?

  • 🇩🇰 Danish — 17 years abroad (Switzerland → JBoss → Red Hat → IBM) — back home since 2022

  • Red Hat Distinguished Engineer, STSM @ IBM

  • 20+ years building developer tools (Quarkus, JBang, Hibernate, …​)

  • Building with AI/LLM coding since 2023 (ChatGPT API)

  • Reconnecting with the local dev community — glad to be here!

The Camps

  • 🚀 "This changes everything! I’m 10x now!"

  • 🙄 "It’s autocomplete with better marketing"

  • 🔥 "It burns all the energy — don’t use it!"

 

All are wrong. All are right.
Let me demystify the magic.

Claude Code: impressive, but…​

  • Polished, powerful, complete

  • MCP, Sub-agents, plan mode, permissions, memory

  • Huge engineering effort

claude code machine

The four building blocks

Every coding agent is just:

  1. Model — next-token prediction machine

  2. System prompt — text instructions prepended to every conversation

  3. Tools — JSON schemas the model can "call" (harness executes)

  4. Agentic loop — while/if/else

 

That’s it. No magic. Let me show you.

The agentic loop

model.system_prompt = "You are a helpful assistant."
while not done:
    response = model.chat(messages)

    if response.has_tool_calls:
        for tool_call in response.tool_calls:
            result = execute(tool_call)     # ← runs locally
            messages.append(result)
    else:
        done = true   # model is finished

nanocode: 271 lines of python 261 lines of java

Proof: pi.dev

  • Same model. 4 tools: read, write, edit, bash.

  • No MCP, nosub-agents. No plan mode. No permission popups.

  • ~500 word system prompt + Skills + Extensions

  • Same results. Fraction of the complexity.

  • Core of OpenClaw

 

Demo time!

What you need to know

Skills: extend with prose + code

<!-- ~/.pi/agent/skills/code-review/SKILL.md -->
# Code Review
Use when user says "review this" or shares a PR.

## Steps
1. Read the diff or use gh pr diff to get the changes
2. Check for security issues, N+1 queries
3. Summarize findings with severity levels

 

  • Auto-discovered. No code. Just markdown.

  • Share via npm packages or git repos

  • Works with any model — it’s just prompt text

  • All relevant coding agents support it

Beyond Skills

Context window = working memory

  • Models have a fixed window (100K-200K tokens)

  • Everything goes in: prompt + conversation + tool results

  • When full → agent forgets earlier context

  • This is why long sessions degrade

 

Keep tasks focused. Start fresh often.

Why agents hallucinate

  • The model always generates an answer — no "I don’t know" circuit

  • Confident tone ≠ correct answer

  • Sycophantic AI is a problem

  • This is not a bug. It’s the architecture.

 

Review like a junior dev wrote it.
Because that’s roughly what happened.

Take home

Patterns that work

  • Seeing is believing - don’t just read about it, try it out!

  • Use it for boring stuff — boilerplate, check plans, tests, migrations, docs, regex

  • Small tasks — "add input validation to page x" not "rewrite auth"

  • Give context — you know what the model doesn’t, treat it as a new hire

  • Project rulesCLAUDE.md / AGENTS.md when needed = cheapest quality boost

  • Skills — teach your agent team-specific workflows

Monday morning

  • Try Claude Code or pi on a small non-critical task

  • Have it write a CLAUDE.md / AGENTS.md or skill for your task

  • Add a Skill for your team’s review checklist

  • Review AI output like you’d review a junior’s PR

 

You are still the engineer/builder. The agent is a power tool.

The End!

It’s not magic — it’s a while loop.
Learn how it works. Use it wisely.