There's a thread on Hacker News right now asking: if AI writes code, should the AI session log be committed alongside the code?
The answers reveal something interesting: the developers who are most productive with AI have already solved this. Not by logging sessions — but by building a different kind of artifact before the session even starts.
Here's what they do, and why it matters more than you think.
The Real Problem: Context Collapse
When an AI writes code, it's operating from context: your description, your constraints, your decisions. That context lives in the session. The session ends. The code remains — but the why behind it evaporates.
This is context collapse. And it's why:
- Future you (or a new AI session) re-discovers the same wrong paths
- Code reviews are harder because the reasoning is gone
- Bugs get re-introduced because the original tradeoff is invisible
The session log would help. But it's the wrong artifact.
What Actually Works: The Plan Before the Code
The most upvoted comments in that thread describe a three-file workflow:
- project.md — what you're building and why
- plan.md — what the AI will do (iterated with the AI before coding starts)
- decisions.md — the non-obvious choices: "tried X, caused Y, went with Z"
You commit all three alongside the code.
The insight: the plan is the session artifact. It's distilled, intentional, and reusable. A raw session log is noise. A plan.md is signal.
This is exactly how great engineering teams work — the RFC or design doc comes before the PR, not after.
Why This Matters If You're Building an AI Product
If you're building with AI (using it to write your product) this workflow saves you days of rediscovery time.
If you're building for AI (building AI products for customers), this pattern points to a real product gap:
Nobody has built a clean "AI session to commit artifact" pipeline yet.
The tools exist in fragments:
- Cursor has rules files
- Claude Code has CLAUDE.md
- Some people use Notion or Obsidian to store AI session notes
But there's no standard. No format. No git-native workflow for it.
That's either a product opportunity or a future git feature. Probably both.
The Immediate Practical Takeaway
Whether or not you build this as a product, start doing it today:
- Before starting an AI coding session, write a 10-line
plan.md - After the session, update it with the 2-3 non-obvious decisions you made
- Commit it with your code
Three months from now, when you or a new AI picks up the project, you'll have a map instead of a mystery.
The session doesn't need to be in the commit. The reasoning does.
Top comments (0)