claude code 踩坑


我发现我的claude每次都无法准确识别当前目录,比如我让他帮我下一个脚本,其实我的本意是让他在我打开的目录下执行(也就是我执行cc的目录),但是他总是识别不了,写到错误的目录,害的我不得不盯着他的执行过程找到最后写的脚本写到哪个目录了,最后在把脚本移动到我想要的目录下。很烦。

于是为了排查这个问题,我问他 “你现在的工作目录是什么?” 结果他总会报以下的错误。

Bash(pwd)
  ⎿  PreToolUse:Bash hook returned blocking error                            ⎿  [Fact-Forcing Gate]

                                                                                Quote the user's current instruction verbatim.
                                                                                Then retry the same operation.
  ⎿  Error: [Fact-Forcing Gate]

     Quote the user's current instruction verbatim.
     Then retry the same operation.

这个报错不是你系统的报错, 是 Claude 内部的安全 / 校验拦截机制 ,翻译成人话就是:

Claude 想执行 pwd,但被它自己的安全网关拦住了,要求你 原样复述一遍指令 ,才能重试执行。

原因

安装了 everything-claude-code 造成的,卸载即可。 everything-claude-code 这个传的很神,但个人使用下来,感觉一般,可能我还没有找到使用的方法


评论