惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

量子位
D
Docker
月光博客
月光博客
MongoDB | Blog
MongoDB | Blog
Vercel News
Vercel News
美团技术团队
博客园 - 叶小钗
I
InfoQ
Jina AI
Jina AI
博客园 - 司徒正美
雷峰网
雷峰网
B
Blog
Y
Y Combinator Blog
A
About on SuperTechFans
WordPress大学
WordPress大学
酷 壳 – CoolShell
酷 壳 – CoolShell
大猫的无限游戏
大猫的无限游戏
Microsoft Security Blog
Microsoft Security Blog
Stack Overflow Blog
Stack Overflow Blog
腾讯CDC
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Recent Announcements
Recent Announcements
V
V2EX
N
Netflix TechBlog - Medium

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
How I use premortems with Claude and Codex
Pavel Kalo · 2026-06-17 · via DEV Community

I started using premortems for a boring reason: I did not trust the default review question.

When I ask a coding agent "does this plan look good?", the answer is usually useful but too polite. It finds reasons the plan can work. It notices a few edge cases. It gives me a clean list of improvements. Fine.

But that is not the check I want right before I choose an implementation path, publish an idea, change auth, move data, or let an agent write a large diff.

At that point I want a second pass that tries to break the decision.

So I started asking for a premortem.

The frame

The method is Gary Klein's, not mine. He wrote about project premortems in Harvard Business Review in 2007. Daniel Kahneman later pointed to the technique as a practical way to push back on overconfidence. The idea is simple: assume the plan has already failed, then explain why.

That small change matters with LLMs.

Weak:

Is this plan good?

Better:

It is six months from now. This plan failed.
Explain how it happened. Be specific.

The second prompt gives the model a different job. It is no longer approving the plan. It is reconstructing the failure.

Two rows compare a normal review prompt with a premortem failure frame

"What could go wrong?" often gives me a generic risk list. "This already failed, why?" gives me a story. The first break. The hidden assumption. The signal I would probably ignore. The rollback I forgot to design.

That is easier to act on.

Where I use it

I use premortems as a second check in two places.

First, coding decisions.

Not every code change needs this. I use it when the plan is still cheap to change but expensive to undo later: migrations, auth changes, data model changes, release plans, agent workflows that can touch many files, or anything where I am about to say "yeah, this should be fine" without enough friction.

Second, ideas.

Before I spend time on an article, a small open-source launch, or a product idea, I ask what would make it quietly fail. Not "is this interesting?" but "six weeks later nobody cared, what happened?" That usually surfaces a better problem than the one I was about to write about.

It is not a replacement for taste, tests, review, or talking to people. It is just a cheap extra check before the plan hardens.

Why I packaged it as a skill

I had been retyping the frame by hand. That worked, but it was inconsistent. Sometimes I asked too vaguely. Sometimes I let the answer become a generic list. Sometimes I forgot to force the model to revise the plan at the end.

So I made a small skill:

https://github.com/PabloNAX/premortem-skill

There are other premortem prompts and agent workflows already out there. I made this one for how I actually use Claude Code and Codex:

  • short output in chat
  • no HTML report
  • one investigation per important failure mode
  • a revised plan and checklist at the end

The chat output matters. If the result becomes a separate report I have to open, I read it later, which often means never. I want the critique in the same conversation while I still have the plan in my head.

What the skill does

The skill expects a concrete plan. If the plan is too vague, it asks for the missing context instead of making things up.

Then it runs the failure frame:

  1. Treat the plan as already failed.
  2. Generate failure modes that match the plan.
  3. Investigate the important ones separately.
  4. Synthesize the result into a short chat answer.

A flow diagram shows plan, context, failure frame, failure modes, parallel checks, and chat synthesis

The output I want is small:

most likely failure
most dangerous failure
hidden assumption
revised plan
checklist

After that I can push on one part:

Go deeper on the rollback failure.
Assume I only have two hours before starting the migration.

Premortem skill demo

Coding example

One side-project example: I wanted to move a small app from SQLite to Postgres over a weekend. Solo, no staging, a few months of real local data.

Normal review would probably tell me to dump, restore, test, and keep a backup. True, but not sharp enough.

The premortem came back with a more useful failure story:

Most likely failure
SQLite's loose typing allowed rows that Postgres rejects or coerces differently.
The import looks mostly fine, but a few records become wrong after cutover.

Most dangerous failure
There is no rollback boundary. The app starts writing to Postgres, the migration
half-succeeds, and the SQLite copy is no longer a clean source of truth.

Hidden assumption
The queries are portable and the database switch is mostly a connection string.

Revised plan
1. Restore into local Postgres first.
2. Diff row counts and sample rows before switching anything.
3. Put the database backend behind one env var.
4. Run normal local use against Postgres for a day.

None of that is exotic. That is the point. It found the boring failure I was most likely to skip. The rollback boundary changed the plan before I touched the migration.

Idea example

I also ran the skill on the launch plan for the skill itself.

The useful catch was simple: the repo explained the idea but did not show what the output looked like. A visitor would see install commands and text, but no proof of the experience. That changed the README. I recorded the short terminal demo and put it near the top.

It also pushed back on my metric. I was thinking about GitHub stars. The premortem pointed out that stars are easy to count and easy to optimize badly. A better signal would be a few people trying it on a real plan and telling me where the output was wrong.

That is the kind of critique I want. Not a big philosophical argument. A small correction before I spend more time on the wrong version of the idea.

How I ask

The input has to be concrete.

Weak:

Premortem my startup idea.

Better:

Premortem this launch plan:
I am releasing a Claude/Codex skill for premortems.
Audience: developers who already use coding agents.
Goal: get 10 serious trials from people who use it on a real plan.
Channels: GitHub README, DEV article, LinkedIn post.
Constraint: no fake production examples.

That gives the model something to inspect: audience, goal, channel, constraint, and failure condition.

Same for coding. "Premortem my migration" is weak. "Premortem this SQLite to Postgres migration, solo, no staging, rollback required" is useful.

Try it

Install for Claude Code:

git clone --depth 1 https://github.com/PabloNAX/premortem-skill && ./premortem-skill/install.sh claude

Install for Codex instead:

git clone --depth 1 https://github.com/PabloNAX/premortem-skill && ./premortem-skill/install.sh codex

I still ask agents to review plans. I just do not stop there anymore. For decisions that matter, I want one extra pass where the plan already failed and the agent has to tell me why.

Sources

  • Gary Klein, "Performing a Project Premortem," Harvard Business Review, 2007. https://hbr.org/2007/09/performing-a-project-premortem
  • Daniel Kahneman, Thinking, Fast and Slow, 2011.
  • D. J. Mitchell, J. E. Russo, N. Pennington, "Back to the future: Temporal perspective in the explanation of events," Journal of Behavioral Decision Making, 1989.
  • M. Sharma et al., "Towards Understanding Sycophancy in Language Models," Anthropic, 2023. https://arxiv.org/abs/2310.13548