问HN:没有钩子,AI代码辅助是否从根本上无法执行?

2作者: meloncafe11 天前原帖
我今年在Claude Code上花了大约2000美元(我有超过10年的开发经验,现在从事非开发工作,仅做一些副项目)。 我学到的一个重要教训是:Markdown指令并不奏效。 人工智能需要强制执行。 问题的转折点是自动压缩。 在上下文压缩后,Claude总是忽视CLAUDE.md——这是Anthropic告诉你要创建的文件。 这就像雇了一个每两小时就忘记自己工作描述的人。 我无法仅通过指令解决的核心问题有: - 压缩后的健忘症:“解释”上一个会话,往往是破坏性的 - 会话记忆丧失:每天像新实习生一样问同样的问题 - TODO流行病:“我实现了它!”(旁白:那只是一个TODO) - 命令混乱:rm -rf,重复的curl提示,带有“by Claude”的git提交 - 指导方针=建议:在它想的时候才遵循 经过6个月的挣扎,我建立了强制执行的钩子(命令限制器、压缩前的自动摘要、TODO检测器、提交验证器)。 它们有效,但我感觉自己是在与工具对抗,而不是与之合作。 我想问社区几个问题: 1. 这是大家的共同经历,还是我根本上在错误地使用Claude Code? 2. 对于使用Cursor/Copilot等工具的人,是否也面临同样的强制执行问题? 3. “Markdown指导方针→AI遵循它们”在大规模上是否根本不可行? 这些钩子在GitHub上(大部分是韩文,但功能通用): https://github.com/meloncafe/claude-code-hooks 我真的很想知道这是否是一个普遍的AI编码问题,还是我个人的技能问题。
查看原文
I spent ~$2k on Claude Code this year (10+ years dev, non-dev job now, side projects only). The hard lesson: markdown instructions don&#x27;t work.<p>AI needs enforcement.<p>The breaking point was Auto Compact. After context compression, Claude consistently ignores CLAUDE.md - the very file Anthropic tells you to create. It&#x27;s like hiring someone who forgets their job description every 2 hours.<p>Core issues I couldn&#x27;t solve with instructions alone:<p>- Post-compact amnesia: &quot;interprets&quot; previous session, often destructively<p>- Session memory loss: asks the same questions like a new intern daily<p>- TODO epidemic: &quot;I implemented it!&quot; (narrator: it was just a TODO)<p>- Command chaos: rm -rf, repetitive curl prompts, git commits with &quot;by Claude&quot;<p>- Guidelines = suggestions: follows them... when it feels like it<p>After 6 months struggling with this, I built enforcement hooks (command restrictor, auto-summarizer before compact, TODO detector, commit validator). They work, but I feel like I&#x27;m working against the tool rather than with it.<p>Questions for the community:<p>1. Is this everyone&#x27;s experience, or am I using Claude Code fundamentally wrong?<p>2. For those on Cursor&#x2F;Copilot&#x2F;etc - same enforcement issues?<p>3. Is &quot;markdown guidelines → AI follows them&quot; just... not viable at scale?<p>The hooks are on GitHub (mostly Korean but universally functional):<p>https:&#x2F;&#x2F;github.com&#x2F;meloncafe&#x2F;claude-code-hooks<p>Really curious if this is a universal AI coding problem or a skill issue on my end.