Using OpenAI Codex for Long-Running Tasks: Jason Liu's Techniques for Preserving Context

OpenAI has published a case study on how developer Jason Liu uses Codex for long, multi-stage tasks. The central question is how to preserve project context between sessions so you don't start from scratch every time. Liu walks through his techniques: structuring prompts, passing state between requests, and delegating entire task branches to the agent. Together, these let Codex work for hours without human involvement.

AI-processed from OpenAI Blog; edited by Hamidun News
Using OpenAI Codex for Long-Running Tasks: Jason Liu's Techniques for Preserving Context
Source: OpenAI Blog. Collage: Hamidun News.
Listen to article
Article Fact Sheet & Key Figures
ParameterDetails
Primary sourceOpenAI Blog ↗
Editor-in-Chief
State handoffat the start of each session, Codex receives a structured file with the project's current status, decisions made, and open questions.
Pinning the environmentdependency and tool versions are strictly pinned so the agent doesn't break reproducibility between runs.

OpenAI has published a piece on how developer and AI practitioner Jason Liu uses Codex for long, multi-stage tasks, and why the standard "one prompt, one answer" approach breaks down on real projects.

Why a single prompt isn't enough

Most people use AI coding assistants for short tasks: fix a bug, write a function, explain a chunk of code. Real development is harder. A project accumulates a history of decisions, dependencies between modules, and style and architecture conventions, and none of that fits in a single prompt.

This is where most developers hit a wall. They have to re-explain the context every time, and the agent doesn't "remember" that the team decided yesterday to drop a particular approach, or that the tests cover only some of the cases.

OpenAI designed Codex to work in agent mode: it can run tasks asynchronously, execute tests, and iterate on the results. Liu sees the tool's biggest potential in exactly this mode, as a full-fledged executor rather than an autocomplete.

"Codex-maxxing" techniques

Liu's approach rests on several practices that let Codex "remember" and pick up work across sessions:

  • State handoff: at the start of each session, Codex receives a structured file with the project's current status, decisions made, and open questions.
  • Task decomposition: large tasks are split into independent subtrees, and the agent can solve each one on its own without needing the full context of the entire project.
  • Checkpoint prompts: at the end of a session, the agent writes a summary of what got done and what remains unfinished. That report becomes the starting point for the next run.
  • Delegating entire branches: instead of supervising step by step, the developer describes the goal and acceptance criteria, and Codex iterates on its own until it reaches the desired result.
  • Pinning the environment: dependency and tool versions are strictly pinned so the agent doesn't break reproducibility between runs.

Together, these techniques let Codex work on complex tasks for hours, without the developer constantly present.

The developer's changing role

The most important part of Liu's approach isn't the technical tricks but a shift in mindset. The developer stops being the one doing the work and becomes an architect of tasks. Their key skill is now stating intent precisely, managing context, and critically evaluating the agent's output, not writing code by hand.

A developer who knows how to "feed" the agent context properly and frame tasks well becomes significantly more productive. With the right setup, one person can run several parallel branches, each driven by Codex.

Why OpenAI is publishing this

The piece arrives as OpenAI actively promotes agentic use cases for Codex. It fits a broader narrative: AI tools are moving from the role of assistant to that of an independent executor on specific parts of the work.

Notably, Liu isn't an ordinary user: he created the Instructor library, which has become the de facto standard for getting structured output from LLMs. His view of agentic workflows comes from real experience building AI systems, not from marketing promises.

For the job market, the publication signals a shift in where value lies. Demand for developers who handle routine tasks will decline. Demand will grow for those who can decompose complex problems, build context for agents, and verify the quality of the results.

What it means

Liu's case is one of the first structured examples of how to actually work with AI agents on complex projects rather than demo scenarios. If Codex's agent mode becomes part of standard workflows, "codex-maxxing" skills will become an essential tool for every serious developer.

Story

Key Questions Answered

Why a single prompt isn't enough?

Most people use AI coding assistants for short tasks: fix a bug, write a function, explain a chunk of code. Real development is harder. A project accumulates a history of decisions, dependencies between modules, and style and architecture conventions, and none of that fits in a single prompt. This is where most developers hit a wall. They have to re-explain the context every time, and the agent doesn't "remember" that the team decided yesterday to drop a particular approach, or that the tests cover only some of the cases. OpenAI designed Codex to work in agent mode: it can

What are the key details on "Codex-maxxing" techniques?

Liu's approach rests on several practices that let Codex "remember" and pick up work across sessions: State handoff: at the start of each session, Codex receives a structured file with the project's current status, decisions made, and open questions. Task decomposition: large tasks are split into independent subtrees, and the agent can solve each one on its own without needing the full context of the entire project. Checkpoint prompts: at the end of a session, the agent writes a summary of what got done and what remains unfinished. That report becomes the starting point for

What are the key details on The developer's changing role?

The most important part of Liu's approach isn't the technical tricks but a shift in mindset. The developer stops being the one doing the work and becomes an architect of tasks. Their key skill is now stating intent precisely, managing context, and critically evaluating the agent's output, not writing code by hand. A developer who knows how to "feed" the agent context properly and frame tasks well becomes significantly more productive. With the right setup, one person can run several parallel branches, each driven by Codex.

ZK
Zhemal Khamidun — CPO at Alpina Digital, product manager of AlpinaGPT. Building AI products since 2019. Hamidun News is a pet project that grew into a production aggregator with 6,000+ readers.
✦ Hands-On AI Engineering · Hamidun Academy

Build & Ship Production AI Agents Without Boilerplate Code

Start your free 72-hour trial at Hamidun Academy (academy.hamidun.com) — interactive lessons on Claude Code & Cursor, live Tech Radar, and production agent templates.

Start 72h Free Trial →Vibe-Coding Intensive
What do you think?
Loading comments…