汕尾市网站建设_网站建设公司_响应式开发_seo优化
2026/1/16 12:32:58 网站建设 项目流程

痛点

1. 在windows下,vscode 中使用 基于windows安装的claude code插件。在写文件的时候,经常使用大量的bash的命令,来来回回的操作失败,最后,采用了python写入文件。浪费时间和token.

2. 在win下,plan模式下,仍然没有请示,就直接修改代码。

解决方法:

vs code 创建Snippet,来对claude code 进行约束。

{"Claude Code Windows Strict Write Guard": {"prefix": "cc-win-guard","body": ["Environment:","- Windows OS.","- Shell / command-line tools are unreliable.","","Global Rules (Strict):","1. Do NOT use any shell commands.","2. Do NOT modify, create, or delete any file","   unless I explicitly grant permission.","3. Any file write without permission is a violation.","","Two-Phase Protocol:","","Phase 1 (Default — Read Only):","- Read files only.","- Analyze and propose changes.","- Output a clear plan including:","  * Target files (exact list)","  * Exact modifications","  * Risk or edge cases","- Do NOT write any file.","- Do NOT scan the repository unless explicitly asked.","","Phase 2 (Write Allowed):","- Proceed ONLY after I explicitly say:","  \"Approved. You may apply the changes.\"","- Modify ONLY the approved files.","- Apply changes in a single deterministic pass.","- Write each file exactly once.","- No extra or opportunistic changes.","","If permission is not granted, STOP after Phase 1."],"description": "Claude Code Windows strict write-guard (cc-win + approval protocol)"}
}

需要专业的网站建设服务?

联系我们获取免费的网站建设咨询和方案报价,让我们帮助您实现业务目标

立即咨询