---
title: "The Evolution of Coding Agent Workflows: From Cody, to Amp, to Pi"
description: "It's not about the latest model, but about how we manage context, sessions, and agent roles. A journey from Cody to Amp, and finally finding the perfect fit with Pi Coding Agent."
publishedAt: 2026-04-24
locale: en
urlSlug: evolution-of-coding-agent-workflow
isDraft: false
defaultLocale: en
---
> Note: ID translation is unavailable, showing EN source.

[TOC]

Looking back, the biggest shift in my workflow with AI didn't come from the "latest model," but from **how I manage context, sessions, and agent roles**.

This post summarizes that journey: from using [Cody](https://sourcegraph.com/docs/cody), transitioning to [Amp](https://ampcode.com), and finally settling on [Pi](https://pi.dev) as my primary coding agent. The common thread has been consistent: **don't let sessions get too long**, **be explicit with prompts**, and **delegate tasks to the right threads/agents**.

## Starting Point: Karpathy's Video and Context Awareness

Around February or March 2025, I watched a video by Andrej Karpathy that became my first turning point[^fn:1]. One thing that really stuck: long AI sessions easily turn into distractions. Initially, it feels productive because "everything is in one place," but over time, the AI starts to hallucinate, especially once the *context window* is over 40% full[^fn:10].

From there, I started becoming more disciplined:

- Never letting a single chat contain too many *objectives*.
- Resetting sessions frequently.
- Breaking down work into clear phases (*planning, execution, exploration*).

I also watched a video on *tokenization*[^fn:2]. For me, this was more of a technical foundation to understand how AI "reads" our input, rather than a primary trigger for my daily workflow.

The real shift came later when I started applying the concept of **back pressure** in prompting for *coding tasks*[^fn:7]. Essentially, don't just tell the agent to "do it," but force it to have a verification mechanism for its own work.

Practically, I build this *back pressure* into my "prompt contract":

- For *bug fixes*, the agent must **prove** the bug is gone (via reproduction before/after, tests, or logs).
- For *frontend* tasks, the agent is given *browser* access to verify the UI directly.
- For *backend* tasks, the agent is given CLI access (like `psql`, `uv`, `node`) so validation isn't based on assumptions.

This pattern changed my perspective; AI isn't just about implementation—it's an agent with *delivery accountability*.

It goes back to the [inner-loop](https://sourcegraph.com/blog/developer-productivity-thoughts) concept; as devs, we do *requirement gathering* (*planning*), *coding*, and *testing*. But instead of doing it all "by hand," the process is now assisted by an "agent."

## From Cody to Amp: The Right Transition

I used [Cody](https://sourcegraph.com/docs/cody) from Sourcegraph for quite a while. When Cody was sunset and succeeded by [Amp](https://ampcode.com), I happened to have 40 USD in credits, so I continued my exploration there. The initial decision was practical, but it led to a more fundamental workflow discovery.

Amp's writing on *Threads* really resonated[^fn:3]. The concept is simple: **threads as units of work, not just chat history**.

In practice, it looks like this:
- *Planning session* → create a new thread.
- *Execution session* → move to a new thread.
- *Exploration session* → separate thread.
- If I need to go back to *planning* → create another new thread.

(Tip: In Amp, you can press *double enter* in the chat box to reference a previous thread, making the context handoff seamless).

This aligns with another Amp note that 200k tokens doesn't mean you should use them all at once[^fn:4]. Just because it can hold a lot doesn't mean it's optimal for the AI—it might just "hallucinate" more accurately.

## Subagents for Cognitive Role Splitting

The concept of **subagents** I encountered while using Amp further clarified this workload division[^fn:5]. Essentially, *subagents* are just **hyper-focused sessions** that perform **automatic handoff notes** behind the scenes.

The principle remains the same: breaking down the cognitive load into smaller units to maintain quality. The roles are roughly divided as follows:

- **Oracle (GPT)**: For *planning*, *problem framing*, or complex *bug fixes*.
- **Librarian (Sonnet)**: For understanding the *codebase* on GitHub, creating summaries, or internal documentation.

What matters isn't just "which model is smartest," but **whether the task fits the operating mode**. When an agent's role is clear, the output is more consistent, and my own cognitive load is reduced.

## The Emerging Pattern

Looking back at the journey from 2025 to now, the pattern is clear. There are three **core principles** I've unconsciously followed:

1. **Minimal Distraction**: Each thread has only one goal.
2. **Accurate Continuity**: Handoff notes ensure the next session knows exactly where we left off.
3. **Cognitive Ease**: No single session is forced to hold "everything"—making it easier for both the agent and the human driver.

Performance isn't just about the AI model; it's about the composition:
> **right task × right agent × right thread length × right prompt contract**

## Clicking with Pi Coding Agent

When the OpenClaw project gained momentum (late 2025 - early 2026), I got to know [Pi Coding Agent](https://pi.dev) because OpenClaw itself uses it as a foundation.

Reading Mario Zechner's writing on Pi, many things felt like they "clicked" with the principles I learned from Andrej and Amp[^fn:6]. The philosophy is aligned: tooling should make us more context-aware, modular, and intentional.

That's why Pi is no longer just an alternative, but my **primary coding agent**.

## Why Pi?

There are several reasons why Pi is now the benchmark for my workflow:

1. **Natural Thread-based Workflow**: It doesn't force us into one super-long session. I've learned to manage context better using the `/tree` feature[^fn:8]. **The subagents I mentioned earlier are essentially an automated form of this thread-based pattern.**
2. **Multi-session Workflow**: Separating *planning* and *execution* is effortless without losing direction.
3. **Aligned with Explicit Prompting**: It's easy to maintain the output "contract" and scope per session.

## My Default Workflow Today

This is now my default habit when coding:

- **One thread, one objective**.
- If the *objective* changes, **start a new thread immediately**.
- **The Handoff**: Every time I switch threads, I write a short **handoff note**: minimal context, key decisions, and next steps.
- **Explicit Prompts**: Be clear about role, constraints, output format, and completion criteria.

To keep things organized beyond the chat, I store artifacts in a `./memory` folder in the repo. You can see an example in the StitchDB repo[^fn:9], which contains files for planning, bug fixing, and handoff notes. Usually, the agent writes the initial draft, and I review/correct it. Think of this folder as a collaborative space.

Furthermore, this `./memory` folder makes it incredibly easy to switch coding agents. If I need a different perspective, I can just pass those notes to another agent like Amp or Gemini—which I still use alongside Pi.

Tools and models will keep changing. But my principles remain the same: **work in focused sessions, keep context clean, and ensure results are verifiable.**

It's been fascinating to follow the development of coding AI agents. Learning this feels a lot like when I first learned game development in middle school—that same spark of curiosity and excitement is still there.

[^fn:1]: [Andrej Karpathy video (YouTube)](https://youtu.be/EWvNQjAaOHw)
[^fn:2]: [Video on tokenization (YouTube)](https://youtu.be/zduSFxRajkE)
[^fn:3]: [Amp blog — Read Threads](https://ampcode.com/news/read-threads)
[^fn:4]: [Amp notes — 200k tokens is plenty](https://ampcode.com/notes/200k-tokens-is-plenty)
[^fn:5]: [Amp additional video (YouTube)](https://youtu.be/gvIAkmZUEZY)
[^fn:6]: [Mario Zechner — pi-coding-agent](https://mariozechner.at/posts/2025-11-30-pi-coding-agent/)
[^fn:7]: [Video on prompting practices and verification/back pressure (YouTube)](https://youtu.be/4Nna09dG_c0)
[^fn:8]: [Stack to Heap — Pi /tree & Context Window Management](https://stacktoheap.com/blog/2026/02/26/pi-tree-context-window-management/)
[^fn:9]: [Example workflow memory folder (StitchDB)](https://github.com/wayanjimmy/stitchdb/tree/main/memory)
[^fn:10]: [Video on AI performance degradation as context window fills up (YouTube)](https://youtu.be/rmvDxxNubIg)
