RUIIIOVO

Pi Setup — Development skill for Claude Code

Development community

Personal setup baseline for the pi coding agent (@earendil-works/pi-coding-agent): subscription billing attribution patch, one-line tool call folding, collapsed thinking blocks.

How to install Pi Setup

This entry records only its repository, not the path inside it, so there is no exact command to give. Open RUIIIOVO/pi-setup and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

What Pi Setup does

Personal setup baseline for the pi coding agent (@earendil-works/pi-coding-agent): subscription billing attribution patch, one-line tool call folding, collapsed thinking blocks. One command on a new machine.

Alternatives in Development

  • Third-party Notices — THE FOLLOWING SETS FORTH ATTRIBUTION NOTICES FOR THIRD PARTY SOFTWARE THAT MAY BE CONTAINED IN PORTIONS OF THI 94.7k ★
  • Ccusage — CLI for analyzing Claude Code/Codex usage from local JSONL files 11.8k ★
  • Clawgod — This is NOT a third-party Claude Code client 837 ★

README

pi-setup

给 [pi](https://www.npmjs.com/package/@earendil-works/pi-coding-agent)(`@earendil-works/pi-coding-agent`)用的一套个人配置基线。解决三件事:

  1. Claude 订阅账号(Pro / Max / Team)在 pi 里被算成 extra usage,请求直接 400
  2. 工具调用折叠态还是占好几行,屏幕很快被 bash 输出和 diff 淹没
  3. 思考块默认展开,读起来更吵

换机器时 clone 下来跑一条命令,不用再翻记忆。

**先读这段再决定用不用。** 第 1 项通过改写 pi 的 npm 产物,在请求里加上官方客户端的计费归属标识。这个做法是否符合 Anthropic 的服务条款,请你自己判断,风险自负。本仓库只记录做法,不提供任何保证。不需要这一项的话,删掉 `pi/patches/` 再装,其余部分互不依赖。


目录

效果

工具调用折叠态,装之前(bash 保留最后 5 行输出、edit 照画 diff、write 打印文件预览):

$ rg --files-with-matches "billing" dist/
dist/core/model-runtime.js
dist/core/usage.js
dist/providers/anthropic.js
dist/providers/openai.js
dist/modes/interactive/status-line.js

装之后,一行,尾部挂摘要,`ctrl+o` 照样能展开看全文:

$ rg --files-with-matches "billing" dist/    7 lines · 0.3s (ctrl+o to expand)

环境要求

  • macOS(已验证);Linux 理论上也能跑,脚本只用到 python3 标准库,没有第三方依赖,但我没测过
  • Python 3.9+
  • pi 已安装,且能通过 mise which pi 或 which pi 找到
  • pi 是 npm 包形式安装的(脚本要定位 node_modules/@earendil-works/pi-coding-agent)

安装

git clone  ~/Code/pi-setup
cd ~/Code/pi-setup

python3 install.py --dry-run   # 先看会改什么,零改动
python3 install.py             # 执行

安装是幂等的,重复跑不会有副作用;任何被覆盖的文件都会先备份成 `<原名>.bak-<时间戳>`。

用 coding agent 的话,把仓库丢给它,说一句「按 pi-setup 的 install.py 把这台机器的 pi 配好」即可,根目录的 `AGENTS.md` 写了执行步骤和禁止事项。

install.py 会做这些事,仅此而已:

动作 目标
合并 settings ~/.pi/agent/settings.json
建软链 ~/.pi/agent/extensions/collapse-tool-output.ts
建软链 ~/.pi/patches/apply-billing-header.py
执行补丁 pi 包内的 dist/bundle/chunks/anthropic-messages-*.js
只读检查 ~/.pi/agent/auth.json 是否存在(不读内容)

它**不会**改你的 shell 配置,**不会**碰凭据,**不会**联网。

每一项分别做了什么

1. Anthropic OAuth 计费归属补丁

文件:`pi/patches/apply-billing-header.py`

Anthropic 从 2026-04-04 起收紧了归属判定:拿 Claude 订阅账号的 OAuth 凭据发请求,如果第一条 s