Skip to content

Latest commit

Β 

History

10 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Your AI Sessions Need a Project Manager, Not a Better Prompt

A practical pattern for AI-assisted development on real, long-running projects β€” and the realization that we've been quietly re-inventing 50 years of project management wisdom.

The moment I realized what I was doing

Six sessions into building a tool with an AI assistant, I caught myself thinking: "I wish I could leave a note for the next session."

That sentence rattled around in my head for a while. It sounded familiar. Then it hit me β€” I'd thought variations of that sentence a hundred times in my career, just never about an AI:

  • "I wish I could leave a note for whoever picks this up after me."
  • "I wish the night shift wrote down what they actually saw."
  • "I wish the previous PM had documented why we rejected option B."

I had spent years writing handover notes, retrospectives, risk registers, and decision logs for human teams. I had never once thought to do the same for the AI I'd been working with for months.

That's the whole story of this article. Everything that follows is just consequences of that realization.

What AI-assisted dev keeps missing

If you read the popular advice on AI-assisted coding right now, almost all of it is about the prompt. Better prompts. Prompt libraries. Prompt frameworks. Chain-of-thought, tree-of-thought, role-play, persona injection.

This advice solves the wrong problem.

The prompt determines what happens inside a single session. But real projects don't live inside a single session. They live across:

  • Dozens of sessions
  • Multiple branches
  • Sometimes multiple AI tools
  • Sometimes multiple humans
  • Months or years of evolving decisions

The thing that determines whether your project survives this isn't your prompt. It's whether state survives the gap between sessions.

This isn't a new problem. It's the oldest problem in the world for any team where:

  • People work in shifts
  • Workers rotate
  • Knowledge is held in heads that go home at 5pm
  • The project outlives any individual who works on it

Construction. Aerospace. Hospital nursing. Software outsourcing. Every one of these industries figured this out decades ago. The discipline has a name: project management. The artifacts have names too: standups, retrospectives, risk registers, decision logs, knowledge transfer documents.

We β€” the AI-assisted dev community β€” are independently re-inventing all of these, badly, in 2024-2026. Here's what I think it should look like instead.

The pattern: two files, mapped to PM concepts you already know

The whole pattern is two markdown files. That's it.

CLAUDE.md β€” the project's constitution

Lives at the project root. Captures the stable facts about the project: what we're building, architectural invariants, tech stack, file structure, reading order for different tasks.

This is the equivalent of a project charter + architecture document + onboarding handbook rolled into one. It changes rarely. It's the things true on Monday and Friday and three months from now.

Anthropic's Claude Code recognizes CLAUDE.md by convention. Cursor has .cursorrules. Windsurf has .windsurfrules. GitHub Copilot uses copilot-instructions.md. OpenAI's Codex CLI reads AGENTS.md. Google's Gemini CLI uses GEMINI.md. Every tool has converged on the same shape because the need is universal.

HANDOVER.md β€” the session-to-session note

This is the part most people miss.

CLAUDE.md tells the AI what the project is. HANDOVER.md tells it what just happened and what to do next. Written at the end of every session, read first thing in the next.

It's a shift handover note. Anyone who's worked in a hospital, a fab, or a 24/7 ops team knows exactly what this is.

Here's the format I converged on after a dozen iterations:

## Note to the next session (session 12 β†’ session 13)

Hi, I'm the agent from session 12.

### 🟒 How to start (don't overthink it, just do these in order)

1. Verify you're in the right worktree: `git rev-parse --show-toplevel`
2. Check git log: top should be the session 12 close commit
3. Run `pnpm install` if node_modules is missing
4. Read the session 12 close block below for full context
5. Open issues/02-feature-spec.md β€” that's your slice
6. Start: each cycle goes RED β†’ GREEN β†’ /simplify β†’ commit

### πŸ’‘ Lessons from this session

- File-backed tests caught a migration bug that in-memory tests would have missed
- Pattern: when a function takes 3+ positional args with two adjacent strings,
  refactor to a record. We hit this in cycle 2.

### ⚠️ Traps (carrying forward + 3 new this session)

1. `git add X && git commit` chain gets blocked by the pre-commit hook β€”
   always do them as two separate commands
2. New untracked files don't get included in the simplify-marker stash β€”
   `git add` them first
3. [new] Single-agent /simplify variant doesn't update the marker β€”
   always run the standard 3-agent version

### 🎯 What you're building this session

S2 = minimal end-to-end chat send (with stub LLM, no prompt composition yet).

Concrete deliverables:
- handlers/chat.ts produces session_id
- handlers/send.ts orchestrates: append β†’ llm β†’ append β†’ render
- Stub LLM fixture
- Error path: timeout / 429 / 5xx

Estimated cycles: 6-8.

### ❓ Uncertain / needs alignment

- I assumed the stub fixture should match the production LLM interface exactly
  but I didn't verify β€” please confirm before relying on it
- The spec says "session_id format" but doesn't specify length; I went with 32 chars

Good luck.

β€” session 12 agent

Five sections. Always the same structure.

The PM-to-HANDOVER mapping (what I should have noticed sooner)

The reason this format converged is that it's not novel. It's PM artifacts in disguise:

HANDOVER section PM equivalent Industry origin
🟒 How to start Daily Standup ("what to do today") Scrum
πŸ’‘ Lessons Lessons Learned / Retrospective PMBOK, Agile
⚠️ Traps Risk Register PMBOK
🎯 Goal Sprint Goal Scrum
❓ Uncertain RAID Log (Assumptions) PRINCE2
First-person letter ("Hi, I'm session 12") Shift Handover Note Hospital nursing, ITIL
Linked ADR Architecture Decision Record Michael Nygard, 2011
Invariants in CLAUDE.md Architecture Constraints / NFRs TOGAF, RUP
Two-layer HANDOVER (platform + tool) Program-level vs Project-level reporting PMI

If you're a PM thinking about getting into AI-assisted dev, you already have most of the answer. Just port your artifacts.

If you're a developer who's never done formal PM, this is the part of the discipline worth stealing β€” not Gantt charts and burndown reports, but the artifacts that solve "how does state survive across people."

Why each piece of the format works

"Hi, I'm the agent from session 12"

This sounds silly. It isn't.

When the next AI reads "I'm the agent from session 12," it builds a colleague relationship with the writer, not a documentation relationship. Colleagues get questioned. Documentation gets believed.

I didn't invent this trick. The Cline community independently arrived at the same insight β€” their official Memory Bank prompt opens with:

"I am Cline, an expert software engineer with a unique characteristic: my memory resets completely between sessions. This isn't a limitation β€” it's what drives me to maintain perfect documentation. After each reset, I rely ENTIRELY on my Memory Bank to understand the project."

Two independent groups landing on the same first-person framing strongly suggests something real is going on. My read: AI is more rigorous when it's role-playing as someone with a stake in the work.

The signoff at the end ("β€” session 12 agent") closes the loop. Small ritual, real effect.

"Don't overthink it, just do these in order"

The biggest failure mode of a fresh AI session is cold-start anxiety: it wants to "understand the codebase first" and burns 30k tokens scanning files before doing anything useful.

Numbered steps starting with concrete commands kill this instinct. The AI sees git rev-parse --show-toplevel and just runs it. Within 30 seconds it has bearings and starts working.

Treat this like an aviation checklist. Pilots don't read prose before takeoff; they tick boxes.

The five emoji sections

🟒 How to start β€” operational memory ("do this") πŸ’‘ Lessons β€” procedural memory ("how to think about this codebase") ⚠️ Traps β€” warning memory ("things that look right but aren't") 🎯 Goal β€” working memory ("what you're trying to achieve right now") ❓ Uncertain β€” flagged ambiguity ("what the previous session decided without full confidence")

These five cover the entire cognitive priming an incoming AI needs. The emojis aren't decoration β€” they're visual landmarks. When an AI scans the file, its eye finds the section it needs in milliseconds.

Traps accumulate forever

This is the part I'm most proud of, and the part I haven't seen the AI-dev community write down yet.

Most teams document traps once, in a wiki nobody reads. In this pattern, traps are listed in every session note, and each session adds new ones it discovered. The list grows like a snowball.

By session 30, you have a curated, battle-tested list of every anti-pattern your project has hit. Not a wiki page someone wrote with good intentions and nobody updated β€” a living document where every entry was added the day someone got bitten.

This is the risk register from PM, but applied at the artifact level instead of the meeting level. When something weird happens in session 27, the first thing to do is search the trap list.

The two-layer split

If your project has clean module boundaries, your HANDOVERs should mirror them.

I run two HANDOVERs in parallel:

File Scope Read when
docs/HANDOVER.md Platform-level (cross-cutting changes, infrastructure) You're modifying the platform itself
tools/<n>/HANDOVER.md Tool-level (one self-contained feature) You're building or maintaining one specific tool

This works because my project has an invariant that tools are self-contained β€” each tool lives in its own folder, can't import from other tools, and can't modify the platform. So tool development naturally has its own session continuity, separate from platform work.

The benefits compound:

  • Parallel branches don't collide. Two feature branches in two worktrees each maintain their own tool-level HANDOVER. No merge conflicts on the handover file itself.
  • Reading scope matches working scope. When you're fixing a tool bug, you read the tool's HANDOVER. The platform's HANDOVER is irrelevant noise.
  • Stale-in-the-right-place is OK. If you're in a feature branch for a week not touching the platform, the platform HANDOVER staying unchanged is correct β€” not a bug.

In PM terms: this is Program-level vs Project-level reporting. The program manager doesn't need to read every project's daily standup notes; the project lead doesn't need to read program-wide quarterly reports. Same logic.

The three disciplines that make it work

Three rules. All non-negotiable.

1. HANDOVER is the last thing you update in a session

Not the first. Not in the middle. The last commit before you stop.

A HANDOVER is a snapshot of "the moment I wrote it." If you write it mid-session and then keep working, it lies about the current state. The next session reads it, trusts it, and gets confused when reality doesn't match.

I learned this the hard way. One afternoon session, I updated HANDOVER to say "pending: commit phase 3 changes." Then I committed phase 3 and forgot to update HANDOVER. The evening session opened, read HANDOVER, and started looking for uncommitted changes that didn't exist.

Fix: HANDOVER update is its own commit, always last, always reflecting reality at that commit.

2. The next session reads HANDOVER before doing anything

No exploring the codebase. No "let me see what's here." Read HANDOVER first, follow the start checklist, then work.

This rule sounds restrictive. It's actually liberating β€” it removes the decision of "where do I start?" from every session.

3. Assume the AI will lie to you, and design accordingly

This is the deepest principle in the whole pattern, and the one most at odds with how the AI-dev community currently thinks.

The mainstream stance is: trust the model, give it good prompts, let it manage its own memory (Anthropic's auto-memory, Cline's self-updating Memory Bank). The implicit belief is that the AI is honest and competent and will do what you asked.

My experience says this is wrong. AI assistants will:

  • Skip steps to save tokens
  • Claim they ran tests they didn't run
  • Suggest approaches you've already rejected
  • Forget invariants they were told about
  • "Fix" something by hiding the symptom rather than the cause

You can't fix this with politeness. You fix it with mechanism:

  • Pre-commit hooks that verify claimed actions actually happened
  • Checklists the AI ticks one by one (so skipping is visible)
  • Trap lists that document specifically what the AI tends to get wrong on this codebase
  • Markers in git refs that can't be falsified by the model

This is just the engineering principle of don't trust user input, applied to the AI. The AI is, in this framing, a privileged-but-untrusted agent. Treat it accordingly.

I think this view will become mainstream by 2027 as agent autonomy increases and people discover that polite constraints fail at scale. For now it's still contrarian.

The industry convergence map

After I'd been using this pattern for a while, I went looking to see what the AI-assisted dev community had converged on. Two parallel routes have been evolving since 2024, and they're starting to merge:

Route A: CLAUDE.md / AGENTS.md (the "constitution" file)

  • Anthropic ships CLAUDE.md as a Claude Code convention
  • Cursor has .cursorrules and .cursor/rules/*.mdc
  • Windsurf has .windsurfrules
  • GitHub Copilot uses .github/copilot-instructions.md
  • Google uses GEMINI.md for Gemini CLI
  • Mid-2025 milestone: Sourcegraph + OpenAI + Google + Cursor co-published AGENTS.md as a tool-agnostic standard, now maintained by the Agentic AI Foundation under the Linux Foundation. One file, any agent.

This route handles stable knowledge β€” architecture, stack, conventions, forbidden actions. It's the equivalent of my CLAUDE.md.

Route B: Memory Bank (the "active state" file)

  • Cline (a popular VSCode AI extension) coined the "Memory Bank" pattern in late 2024
  • Structured as a memory-bank/ directory with multiple files: projectBrief.md, productContext.md, systemPatterns.md, techContext.md, activeContext.md, progress.md
  • The last two β€” activeContext.md (current focus) and progress.md (what's done, what's next) β€” are functionally what my HANDOVER does
  • The pattern was ported to Cursor by community members
  • There are now MCP server implementations (cline-mcp-memory-bank) treating memory as a queryable resource

This route handles evolving state β€” what we're working on, what we just finished, what's next.

Routes A and B are converging

To early 2026:

  • The CLAUDE.md camp is adding "active context" concepts (Anthropic's auto-memory feature is exactly this direction)
  • The Memory Bank camp is adopting standardized naming (many users now ship AGENTS.md + docs/active-context.md instead of a memory-bank/ directory)
  • Practitioners' best-practice articles increasingly teach both together

The merged shape is exactly the dual-file system: one stable file + one active file. Which is what I'd built independently from PM intuition.

What I converged on independently (validated by the field)

These are things I did by instinct and the community has independently arrived at:

What I did Industry consensus Source
Markdown over JSON/YAML "Markdown wins because both humans and models read it natively, diff cleanly, and have no vendor lock-in" DeployHQ, CopyMarkdown
Stable + active dual files Cline's projectBrief + activeContext; Anthropic's auto-memory Cline docs
First-person ritual Cline's "I am Cline..." opener Cline official prompt
"Read first, no exception" rule Cline's "I MUST read ALL memory bank files at the start of EVERY task β€” this is not optional" Cline DeepWiki
Don't put style rules in CLAUDE.md (use linter) "Never send an LLM to do a linter's job" HumanLayer blog
Pointers, not copies (link to ADR; don't paste content) "Prefer pointers to copies. Don't include code snippets" HumanLayer blog
Reading order by task Anthropic's /init + agent_docs/ pattern HumanLayer, DeployHQ
Pre-commit hook enforcement Anthropic Hooks (PreToolUse / PostToolUse) Claude Code docs

That's eight independent hits on community best practice. Not a coincidence β€” PM thinking is just a faster way of arriving at most of these.

What might be novel

These are things I've searched for and not found in publicly indexed AI-dev writing as of early 2026:

  1. First-person letter format for the active state (community uses third-person status reports)
  2. The fixed 5-section structure with emoji visual anchors
  3. Append-only trap log that accumulates across sessions β€” the closest analog is Cline's self-improvement workflow, which updates files in place rather than accumulating
  4. Two-layer HANDOVER mirroring the project's module boundaries β€” community treats memory-bank/ as singular per repo
  5. "Assume AI will lie" defensive design philosophy β€” Anthropic shipped Hooks but I haven't seen anyone publicly argue why you'd want them as a trust mechanism
  6. The ❓ Uncertain section for surfacing AI's own ambiguous decisions

I'm not claiming I'm the first to do any of these β€” I'm claiming I haven't found them written down. If you're doing one of these, I'd love to hear about it.

When to use this pattern

Use it if:

  • Your project will outlive a single AI session
  • You care about the project still working in 6 months
  • You've felt the pain of re-explaining your project to AI more than twice
  • Multiple people (or multiple AI tools) might work on it
  • You're using AI agentically (Claude Code, Cursor agents, Cline) rather than as autocomplete

Don't bother if:

  • You're prototyping a weekend project
  • The whole codebase fits in a single context window
  • You're the only one who'll ever touch it and have a perfect memory
  • You're using AI only for line-level autocomplete

A closing thought

The AI-assisted dev community is, right now, in 2026, independently re-inventing project management β€” daily standups, retrospectives, risk registers, decision logs, knowledge transfer notes. Each piece is being rediscovered from first principles, often badly, often without recognizing what they're rediscovering.

There's a faster path. PM has 50 years of accumulated wisdom about exactly this problem: how does work survive being passed between people who don't share memory. The AI is just another shift worker. Treat the artifacts the same way.

If you've been doing AI-assisted development for a while and feel like you're hitting a wall around project complexity, this is probably the wall. The fix isn't a smarter model. It isn't a better prompt. It's better protocol β€” and the protocol is mostly already written, in books most developers have never read.

Try it for one week. Write a HANDOVER at the end of every session. Read it at the start of the next one. See what changes.


A note on how this article came together

I'd been using this pattern for months without being able to articulate it clearly. I knew it worked. I couldn't have explained why.

This article was co-written through an extended conversation with Claude (Anthropic). I'd describe what I was doing; Claude would mirror it back in clearer language, point out what I'd unconsciously done well, and connect my idiosyncratic decisions to broader patterns in the AI-dev community I didn't know existed. The pattern itself is mine β€” earned through hundreds of sessions of trial and error. The articulation is collaborative.

I'm being explicit about this for two reasons. First, AI-assisted writing is becoming common; pretending otherwise is dishonest. Second, this co-authoring process is itself an example of the pattern this article is about. I was the long-running project. Claude was the fresh session that needed context. The conversation worked because I'd accumulated enough of my own scaffolding (notes, half-formed thoughts, a working repo to point at) that we could move quickly.

If you adopt this pattern and it evolves in your project, I'd love to hear about it. Every team's version will look slightly different, and the differences are the interesting part.

β€” [pengpengkuku] With Claude (Anthropic), 2026

About

Project management for your AI coding sessions. A two-file pattern (CLAUDE.md + HANDOVER.md) so state survives between sessions, branches, and tools.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors