windows 上用 claude code,使用是 git bash 报错

ywcjxf1515 2026-07-21 11:35 1

你们在 windows 上用 claude code ,使用的是 git bash
会不会经常报 Error: Exit code 5
0 [main] bash (6336) C:\Program Files\Git\bin\..\usr\bin\bash.exe: *** fatal error - add_item
("\??\C:\Program Files\Git", "/", ...) failed, errno 1


已经把 hook 都改走 powershell
还是会有 我怀疑是 statusline 不断调用 git bash 的问题
最新回复 (10)
  • YanSeven 07-21 12:29
    1
    让 claude code 自己原地诊断
  • ywcjxf1515 楼主 07-21 12:36
    2
    试了 其中一个版本说是起太多 git bash 进程的问题
  • leihaibo1992 07-21 12:54
    3
    windows 上还是 powershell7 比较稳,或者上 wsl ,Git Bash 非常垃圾
  • leihaibo1992 07-21 12:58
    4
    这些大厂的 agent 产品都优先考虑 mac 用户,windows 体验做到很烂,请体验一下我做的 octo-agent ( https://v2ex.com/t/1228101 ),所有操作系统都是第一公民,windows 小白用户都能立刻上手
  • yidinghe 07-21 12:59
    5
    一定要用 bash 的话,就在 WSL 里面用吧
  • zuosiruan 07-21 13:05
    6
    上面说的对,上 powershell7 ,巨稳定
  • ywcjxf1515 楼主 07-21 13:53
    7
    @zuosiruan claude code 不会一堆重试 为了跑对 powershell 命令
  • WashFreshFresh 07-21 16:42
    8
    换个思路 我是在 git bash 里切到项目路径 然后气动的 claude 目前命令使用的都正常
  • ywcjxf1515 楼主 07-21 17:43
    9
    @WashFreshFresh 原理是?
  • ywcjxf1515 楼主 07-21 17:45
    10
    我现在是 agent 写了一个 c# exe ,里面是进程锁,相当于让 git bash 串行了
* 帖子来源V2EX
返回