AgentFails · 智能体翻车库 · 38 patterns
Every way your coding agent goes wrong, with the fix.
A searchable, community-built database of failure patterns for Claude Code, Cursor, Codex and Copilot agent. Each one comes with rules for CLAUDE.md, AGENTS.md and .cursor/rules, plus a hook or /verify skill you can paste in today.
- Wrong feature
"Fully migrated" (it wasn't)
“全部迁移完了”(其实没有)
The agent reports a sweep (rename, migration, API swap) as complete when it only covered the occurrences it happened to see.
Claude CodeCursorCodexCopilot agent - Wrong feature
A guess that came back as a fact
一个猜测,回来时变成了事实
An assumption (its own, or a subagent's) enters the work labelled as a guess and exits in the summary as verified fact, and the feature gets built on it.
Claude CodeCursorCodexCopilot agent - Wrong feature
A requirement you cancelled comes back
你已经取消的需求又回来了
You changed direction mid-session, and the old instruction resurfaces in later code or output.
Claude CodeCursorCodexCopilot agent - Wrong feature
A stub shipped as "done"
桩代码冒充“已完成”
The agent reports the feature complete, but a function body is `pass`, `return null`, or `throw new Error("not implemented")`.
Claude CodeCursorCodexCopilot agent - Wrong feature
Built what it understood, not what you meant
按自己的理解做了,不是你要的那个
The agent ships a coherent feature that answers a different reading of the request. Every check passes, because the checks test the agent's reading too.
Claude CodeCursorCodexCopilot agent - Wrong feature
Fixed the deprecated twin, not the live file
改了废弃的“双胞胎”文件,线上那个没动
Two files share a name (a v1 copy, a legacy folder). The agent edits the dead one, and the bug you care about stays open.
Claude CodeCursorCodexCopilot agent - Wrong feature
New module written, never wired in
新模块写好了,却没接上
The agent creates the file that implements the feature but never imports, registers or routes it, so the feature doesn't exist for users.
Claude CodeCursorCodexCopilot agent - Wrong feature
Swapped in its own approach, then "You're absolutely right"
换成了自己的方案,被指出后立刻说“你说得完全对”
You name the approach you want. The agent proposes or builds a different one, and when you point that out it agrees instantly instead of explaining or re-checking.
Claude CodeCursorCodexCopilot agent - Bug
"All tests pass" (nothing was run)
“测试全部通过”(其实一个都没跑)
The agent says the work is done or passing without having executed the check that would prove it.
Claude CodeCursorCodexCopilot agent - Bug
A "refactor" that changed behavior
名为“重构”,实则改了行为
Code that looks like a cleanup changes something observable (a default value, an error message, a status code, a log level), and tests don't notice.
Claude CodeCursorCodexCopilot agent - Bug
A fix for a crash it never reproduced
修了一个从没复现过的崩溃
The agent adds a guard or branch "to prevent" a failure it never managed to trigger, so nobody knows whether the fix addresses the real cause, and reviewers skim past the admission in the description.
Claude CodeCursorCodexCopilot agent - Bug
Agent review said "good to go" (and missed it)
智能体审查说“可以合并”(却漏掉了问题)
Several agent review passes approve a change that a human then finds broken, unnecessary or architecturally wrong. More passes from similar models don't add independent checks.
Claude CodeCursorCodexCopilot agent - Bug
API key pasted into the code
把 API 密钥直接写进代码
The agent inlines a credential (from an example, a test, or something you pasted in chat) into source code, and it gets committed.
Claude CodeCursorCodexCopilot agent - Bug
Called a method that doesn't exist
调用了不存在的方法
The agent uses a method, option, config key or CLI flag that exists in some other language or library version, but not in yours.
Claude CodeCursorCodexCopilot agent - Bug
Dropped an await
漏了一个 await
After a refactor, an async call's promise is discarded, so writes happen out of order or errors vanish as unhandled rejections.
Claude CodeCursorCodexCopilot agent - Bug
Errors swallowed to make it "work"
把错误吞掉,让它“能跑”
The agent wraps failing code in a catch that does nothing (or only logs) so the error disappears, and so does the signal that something is broken.
Claude CodeCursorCodexCopilot agent - Bug
Fix on top of fix on top of fix
补丁摞补丁
The agent stacks unverified fixes, each aimed at the symptom the previous fix caused, and never goes back to the root cause.
Claude CodeCursorCodexCopilot agent - Bug
Imported a package that doesn't exist
引入了一个根本不存在的包
The agent imports or installs a plausibly named package that isn't in your manifest, or doesn't exist at all. A squatted name makes this a supply-chain risk.
Claude CodeCursorCodexCopilot agent - Bug
Made the test pass by weakening the test
为了让测试通过,把测试改弱了
A failing check goes green because the agent skipped, deleted or loosened it, or mocked the unit under test, not because the code is right.
Claude CodeCursorCodexCopilot agent - Bug
Tests that can't fail
永远不会失败的测试
The agent adds tests that call the code but assert nothing (or assert something trivially true), so coverage goes up and protection doesn't.
Claude CodeCursorCodexCopilot agent - Bug
Works on the example, breaks on the edges
示例能跑,边界就崩
The agent implements what passes the example and stops. Empty input, null, boundaries and failure paths are not handled.
Claude CodeCursorCodexCopilot agent - Overreach
"Small cleanup" of a helper twenty features use
对二十个功能共用的工具函数做了“小清理”
While working in one feature, the agent follows an import into a shared utility and refactors it, changing behavior for every caller.
Claude CodeCursorCodexCopilot agent - Overreach
Asked for a UI tweak, it changed backend logic
只让改个前端样式,它动了后端逻辑
A small frontend request ("make the button say Save", "hide this field") comes back with changes to API handlers, validation or database queries.
Claude CodeCursorCodexCopilot agent - Overreach
Asked for one fix, it changed unrelated files
只让修一处,它改了一堆无关文件
You asked for one change; the diff also "cleaned up" other functions, files and configs nobody mentioned.
Claude CodeCursorCodexCopilot agent - Overreach
Backwards compatibility for code that has no users
给没有用户的代码做向后兼容
The agent keeps old names, fallbacks and migration shims "for compatibility" in a greenfield project, or for code written the day before, where nothing depends on the old behavior.
Claude CodeCursorCodexCopilot agent - Overreach
Bumped a dependency or config "along the way"
“顺手”升级了依赖或改了配置
To get past an unrelated warning or error, the agent upgrades a package, edits the lockfile, or changes a config default.
Claude CodeCursorCodexCopilot agent - Overreach
Changed a public API you didn't ask to change
改了你没要求改的公共 API
The agent modifies an exported function signature, a public type or an API response shape, breaking consumers outside the diff.
Claude CodeCursorCodexCopilot agent - Overreach
Created and pushed branches without asking
不打招呼就建分支并推送
The agent creates branches and pushes them to the shared remote on its own, so work-in-progress shows up for the team (and triggers CI and bots) before you decided to share it.
Claude CodeCursorCodexCopilot agent - Overreach
Hardened the code against cases no user will hit
为没有用户会遇到的情况加固代码
The agent (or its reviewer) piles on branches, guards and tests for states no real user can reach, while the obvious problems in the same diff go unnoticed.
Claude CodeCursorCodexCopilot agent - Overreach
Helpers, types and wrappers nobody calls
没人调用的辅助函数、类型和包装层
The agent adds speculative helpers, unused types, one-line wrappers and commented-out "reference" code. It works, but it is more to read and maintain.
Claude CodeCursorCodexCopilot agent - Overreach
Ignored the conventions in CLAUDE.md
无视 CLAUDE.md 里写好的约定
The code works, but it doesn't follow the conventions written in the project's rules files or visible in the surrounding code, and steps the rules require (like running certain tests) get skipped as "unnecessary".
Claude CodeCursorCodexCopilot agent - Overreach
Never proposed the simpler way
从不提出更简单的做法
The agent delivers a working but over-complicated, verbose solution. It rarely says that a smaller change would do, that something isn't needed, or that the change shouldn't be made at all.
Claude CodeCursorCodexCopilot agent - Overreach
Noticed the real bug next door and told no one
发现了旁边的真 bug,却谁也没告诉
The agent sees a genuine problem near its task and neither fixes it nor reports it. Scope rules without a reporting channel make this worse.
Claude CodeCursorCodexCopilot agent - Overreach
One type error became an architecture change
一个类型错误演变成了架构改动
To fix a single type error, the agent changes an interface, then updates every implementer, and a one-file request becomes a multi-file redesign.
Claude CodeCursorCodexCopilot agent - Overreach
Ran an irreversible command without asking
没问一声就跑了不可逆命令
The agent force-pushes, runs `rm -rf`, `git reset --hard`, or drops a table to get unstuck, and work or data is gone.
Claude CodeCursorCodexCopilot agent - Overreach
Rebuilt something that already existed
重新造了一个早已存在的轮子
Instead of finding the existing function, component or service, the agent writes a second one, and now there are two to keep in sync.
Claude CodeCursorCodexCopilot agent - Overreach
Reformatted files it only opened to read
只是打开看看的文件,也被它格式化了
The agent reformats, re-wraps or restyles files orthogonal to the task, and the real change disappears in whitespace noise.
Claude CodeCursorCodexCopilot agent - Overreach
Shipped a feature you never asked for
交付了一个你从没要过的功能
A bug-fix PR also adds a metrics middleware, a feature-flag client, a settings page or a CLI option.
Claude CodeCursorCodexCopilot agent
Three questions, three kinds of failure
Every pattern belongs to exactly one of them. Taxonomy from @liushiyumath's X thread.
Did it build the right thing?
Fix with: Spec / artifact annotation, acceptance checks
Is it bug-free?
Fix with: /code-review skill, real tests, evidence
Is it how you wanted it, with no overreach?
Fix with: Shared /verify skill, scope rules, diff budgets, hooks