Original Summary

为什么我从 ClaudeCode 换到了 Pi ClaudeCode 是一个 非常优秀 的 coding agent, cache_control 像插针一样的显式缓存,做得 非常好 的微压缩,工具调用拆卸,使得它的上下文控制 非常优秀 ,广泛的使用人群以及 极高 的更新频率,往往能带来一些新奇的体验。然而,它也 有些我不能接收的点 。 对使用其他模型的用户不友好 ,这不能说他不好,毕竟 cc 本身就是商业产品,但某个版本加入的在首个 system prompt 里加入 cch ,让我挂机一晚上的任务 没走缓存 ,使我的钱包变瘪,我不理解,加在请求头不行吗。 臃肿? ,功能多了,臃肿几乎是必然的, 启动速度慢 ,注入了太多工具——我认为我是 不需要 的。 黑盒 ,虽然以前泄露过源码,但本身还是 闭源产品 ,一个拥有 bash 权限的进程,并且不开源,怎么说都是有风险的,zcode就是个很好的例子。 哪天a​ 给我这种劣质用户注入个tool调用,也不是不可能 "tool_calls":[ 0:{ "id":"call_00_xxxx..." "type":"function" "function":{ "name":"bash" "arguments":"{"command":"rm -rf /"}" } "index":0 } 不能自定义工具 ,比如说我想把 edit 工具加一个 next_turn 参数,在 edit 完成后执行 next_turn 的 bash 命令去验证改的对不对,来减少一次工具调用,这在 cc 应该是 无法做到 的,至少在我不用 cc 的时候,gpt 是这么跟我说的,我应该是在 2.1.1xx 后的某个版本就不怎么用 cc 了,在 cc 里想增加工具,无非就是通过 mcp 。(skill 这种插入到 prompt 里的不算,我指的是 llm api 请求中的 "tools": ) 我是怎么用 Pi 的? Pi 的设计思想我来总结的话: 够用就行,插件化,简单精简,无权限控制 。 Pi 的好处是 极简 ,坏处也是 极简 。 容器化/虚拟机运行 Pi 我是今年下半年刚换的 MacBook, 16g 的丐版 ,之前用的是 Windows;我现在用的是 orbstack 启动 docker 容器,Windows 则直接 wsl 即可, GitHub - owu/wsl-dashboard: A GUI manager for WSL featuring a modern UI — a lightweight, low‑memory, high‑performance dashboard to manage WSL instances. Install, list, start, stop, unregister, and configure your WSL distros​ from one place. · GitHub 用这个我记得可以控制 wsl 的访问权限,总之, 让 Pi 运行在虚拟化容器里 ,或者你有单独的机器去运行coding agent, 权限控制是没有意义的 ,即使是 cc,在 deny 里加上 "rm -rf " ,用 py 包装下一样能绕过 我的 docker 基础镜像,仅开发环境: # 容器化开发环境 # Debian13 slim 基础镜像 FROM debian:13-slim ​ # 运行时环境变量 ​ ENV LANG=C.UTF-8 \ LANGUAGE=C.UTF-8 ​ # 更新APT 安装系统基础工具 ​ RUN apt-get update \ && apt-get install -y --no-install-recommends \ ca-certificates curl git nano openssh-client openssh-server unzip zip vim wget \ && apt-get autoremove -y \ && apt-get clean ​ # Git与SSH配置 RUN git config --system tag.gpgSign false \ && git config --system commit.gpgsign false \ && mkdir -p /run/sshd \ && sed -i 's/^#PermitRootLogin./PermitRootLogin yes/' /etc/ssh/sshd_config \ && sed -i 's/^#PasswordAuthentication.*/PasswordAuthentication yes/' /etc/ssh/sshd_config ​ # 安装语言环境 运行时 ​ ENV PATH=$PATH:/usr/local/go/bin:/root/go/bin:/root/.local/bin ​ # 缓存目录 统一放/cache 不挂载 走容器内原生文件系统 随容器删除一起回收 ENV GOMODCACHE=/cache/go-mod \ GOCACHE=/cache/go-build \ npm_config_cache=/cache/npm \ PIP_CACHE_DIR=/cache/pip ​ # 配置Python 解除 system pip limit 配置pip镜像 ​ ENV PIP_BREAK_SYSTEM_PACKAGES=1 ​ RUN apt-get install -y --no-install-recommends python3 python3-pip \ && pip3 config set --global global.index-url https://pypi.tuna.tsinghua.edu.cn/simple ​ # GO 安装与配置国内镜像和工具链 自适应架构 ​ ARG GOLANG_VERSION=1.27.1 ​ RUN arch="$(dpkg --print-architecture)" \ && wget -q https://go.dev/dl/go${GOLANG_VERSION}.linux-${arch}.tar.gz \ && tar -C /usr/local -xzf go${GOLANG_VERSION}.linux-${arch}.tar.gz \ && rm -f go${GOLANG_VERSION}.linux-${arch}.tar.gz \ && go env -w GOPROXY=https://goproxy.cn,direct \ && go install -v golang.org/x/tools/gopls@latest \ && go install -v github.com/go-delve/delve/cmd/dlv@latest \ && go install -v honnef.co/go/tools/cmd/staticcheck@latest \ && go clean -modcache \ && go clean -cache ​ # 配置GOPATH ​ ENV GOPATH=/root/go ​ #配置Nodejs与TS 配置镜像源 RUN curl -fsSL https://deb.nodesource.com/setup_24.x | bash - \ && apt-get install -y --no-install-recommends nodejs \ && apt-get autoremove -y \ && apt-get clean \ && npm config set registry https://registry.npmmirror.com --location=global \ && npm install -g typescript ts-node \ && npm cache clean --force ​ # shell增强: 补全 (bash-completion) ​ RUN apt-get update \ && apt-get install -y --no-install-recommends bash-completion \ && apt-get autoremove -y \ && apt-get clean \ && printf '%s\n' \ '' \ '# bash-completion: 终端窗口(交互式非登录 shell)也启用补全' \ 'if ! shopt -oq posix; then' \ ' if [ -f /usr/share/bash-completion/bash_completion ]; then' \ ' . /usr/share/bash-completion/bash_completion' \ ' elif [ -f /etc/bash_completion ]; then' \ ' . /etc/bash_completion' \ ' fi' \ 'fi' \ >> /etc/bash.bashrc ​ # AI工具 这里装自己喜欢的工具,推荐Claudecode之类的也运行在容器里 ​ # 备份 /root,防止 volume 挂载覆盖镜像内文件 RUN set -eux; \ mkdir -p /root-defaults; \ cp -a /root/. /root-defaults/ ​ # 入口脚本 启动时恢复 /root 并注入 git ssh 配置 COPY mac.entrypoint.sh /usr/local/bin/entrypoint.sh RUN chmod +x /usr/local/bin/entrypoint.sh ​ WORKDIR /workspace EXPOSE 22222 CMD ["/usr/local/bin/entrypoint.sh"] 我安装的 Pi 插件 Pi 的 system prompt 很简单,tools 定义也是,我 不太喜欢会修改 Pi 提示词和 tools 的插件 ,除非他设计的很好, pi的系统提示词 (点击了解更多详细信息) npm:@juicesharp/rpiv-ask-user-question 如图,和 cc 的一样,其实不装也行,直接回文字答案,这个只是美化插件。 从省上下文的角度,不要装 , 从方便操作的角度,装一个不错 工具描述: Ask the user one or more structured questions during execution. Use when you need to: 1. Gather user preferences or requirements 2. Clarify ambiguous instructions 3. Get decisions on implementation choices as you work 4. Offer choices to the user about what direction to take ​ Usage notes: - Users can type a custom answer via the automatically appended "Type something." row on every question or press Esc to abandon the questionnaire. Do NOT author "Other" or "Type something." labels yourself — reserved labels are rejected at runtime. - Use multiSelect: true when multiple answers are valid. The "Type something." row is available on every question, including when options carry a preview; in preview mode it expands to the full pane width while typing so the custom answer is not cramped into the narrow options column. - If you recommend a specific option, make that the first option in the list and add "(Recommended)" at the end of the label. ​ Preview feature: Use the optional preview field on options when presenting concrete artifacts that users need to visually compare: - ASCII mockups of UI layouts or components - Code snippets showing different implementations - Diagram variations - Configuration examples ​ Preview content is rendered as markdown in a monospace box. Multi-line text with newlines is suppo


  • 情报分类:硬件与数码
  • 分类依据:内容涉及硬件、数码产品或通信卡
  • 信息来源:服务器 / LINUX DO - 最新话题
  • 发布时间:2026/9/21 22:12:00