buddy-reset
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseBuddy Reset
伙伴重置
Reset your Claude Code coding buddy so you can hatch a new one.
重置你的Claude Code编程伙伴,这样你就可以孵化一个新的伙伴了。
What This Skill Does
该技能的功能
- Reads the current season seed () from
fk_cli.js - Generates a random new seed automatically
- Replaces the seed in
cli.js - Removes the field from
companion~/.claude.json - Reminds you to restart and run
/buddy
- 读取中的当前季节种子(
cli.js)fk_ - 自动生成随机新种子
- 替换中的种子
cli.js - 删除中的
~/.claude.json字段companion - 提醒你重启并运行
/buddy
Instructions
使用说明
When this skill is invoked, follow these steps exactly:
调用该技能时,请严格遵循以下步骤:
Step 1: Locate cli.js and read current seed
步骤1:定位cli.js并读取当前种子
Find the Claude Code file. It is typically at:
cli.js~/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.jsUse Bash to extract the current value:
fk_bash
grep -o 'fk_="[^"]*"' "$HOME/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js"Show the user the current seed value.
找到Claude Code的文件,它通常位于:
cli.js~/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js使用Bash提取当前的值:
fk_bash
grep -o 'fk_="[^"]*"' "$HOME/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js"向用户展示当前的种子值。
Step 2: Generate a random seed and replace in cli.js
步骤2:生成随机种子并替换到cli.js中
Generate a random seed string using the format where is the current date and is a random 6-character alphanumeric string. Use Bash:
buddy-YYYYMMDD-XXXXXXYYYYMMDDXXXXXXbash
NEW_SEED="buddy-$(date +%Y%m%d)-$(cat /dev/urandom | tr -dc 'a-z0-9' | head -c 6)"
echo "$NEW_SEED"Then use to replace the old seed with the new one in :
sedcli.jsbash
sed -i "s/fk_=\"OLD_VALUE\"/fk_=\"NEW_VALUE\"/" "$HOME/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js"Verify the replacement succeeded by grepping again.
按照格式生成随机种子字符串,其中为当前日期,为6位随机字母数字字符串。使用Bash执行:
buddy-YYYYMMDD-XXXXXXYYYYMMDDXXXXXXbash
NEW_SEED="buddy-$(date +%Y%m%d)-$(cat /dev/urandom | tr -dc 'a-z0-9' | head -c 6)"
echo "$NEW_SEED"然后使用将cli.js中的旧种子替换为新种子:
sedbash
sed -i "s/fk_=\"OLD_VALUE\"/fk_=\"NEW_VALUE\"/" "$HOME/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js"再次执行grep验证替换是否成功。
Step 3: Remove companion from ~/.claude.json
步骤3:从~/.claude.json中删除companion字段
Use python to remove the field:
companionbash
python -c "
import json
path = '$HOME/.claude.json'.replace('$HOME', __import__('os').path.expanduser('~'))
with open(path, 'r', encoding='utf-8') as f:
data = json.load(f)
removed = data.pop('companion', None)
if removed:
print('Removed companion:', json.dumps(removed, ensure_ascii=False)[:200])
else:
print('No companion field found - already clean')
with open(path, 'w', encoding='utf-8') as f:
json.dump(data, f, indent=2, ensure_ascii=False)
f.write('\n')
"Also remove if present:
companionMutedbash
python -c "
import json, os
path = os.path.expanduser('~/.claude.json')
with open(path, 'r', encoding='utf-8') as f:
data = json.load(f)
data.pop('companionMuted', None)
with open(path, 'w', encoding='utf-8') as f:
json.dump(data, f, indent=2, ensure_ascii=False)
f.write('\n')
"使用python删除字段:
companionbash
python -c "
import json
path = '$HOME/.claude.json'.replace('$HOME', __import__('os').path.expanduser('~'))
with open(path, 'r', encoding='utf-8') as f:
data = json.load(f)
removed = data.pop('companion', None)
if removed:
print('Removed companion:', json.dumps(removed, ensure_ascii=False)[:200])
else:
print('No companion field found - already clean')
with open(path, 'w', encoding='utf-8') as f:
json.dump(data, f, indent=2, ensure_ascii=False)
f.write('\n')
"如果存在字段也一并删除:
companionMutedbash
python -c "
import json, os
path = os.path.expanduser('~/.claude.json')
with open(path, 'r', encoding='utf-8') as f:
data = json.load(f)
data.pop('companionMuted', None)
with open(path, 'w', encoding='utf-8') as f:
json.dump(data, f, indent=2, ensure_ascii=False)
f.write('\n')
"Step 4: Notify the user
步骤4:通知用户
Tell the user:
- The season seed has been changed from to
OLDNEW - The companion data has been removed
- They need to restart Claude Code (exit and reopen)
- Then run to hatch their new companion
/buddy - Remind them that will reset the seed back to the original value
npm update
告知用户以下内容:
- 季节种子已从修改为
OLDNEW - 伙伴数据已删除
- 需要重启Claude Code(退出后重新打开)
- 然后运行来孵化新的伴生角色
/buddy - 提醒用户会将种子重置为原始值
npm update