peon-ping-rename
它能做什么
它为当前会话命名,让 peon-ping 通知和终端标签页更容易区分。适合同时运行多个 Claude Code 会话的人。
适用场景
- ✓当你同时运行多个 Claude Code 会话,并希望为每个会话命名时。
- ✓当你希望通知中显示清晰的会话名称时。
- ✓当你想把会话名称恢复为自动命名时。
技能链接
https://github.com/PeonPing/peon-ping/blob/main/skills/peon-ping-rename/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请把这个会话改名为 Auth Refactor,方便我在终端标签页中找到它。”
每周 5 个新技能,1 分钟读完。
工作原理
一个 hook 会为此会话保存名称,并立即更新终端标签页的标题。不带名称调用该命令,即可恢复为自动命名。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
peon-ping-rename
Give the current session a custom name shown in desktop notification titles and the terminal tab title.
How it works
When the user types /peon-ping-rename <name>, a UserPromptSubmit hook intercepts the command before it reaches the model:
- Extracts the session ID and name
- Writes
session_names[session_id] = nameto.state.json - Immediately updates the terminal tab title via ANSI escape sequence
- Returns confirmation (zero tokens used)
On every subsequent hook event, peon.sh reads session_names[session_id] as the highest-priority project name. Multiple tabs in the same repo each get independent names.
Usage
/peon-ping-rename Auth Refactor
/peon-ping-rename API: payments
/peon-ping-rename ← reset to auto-detect
Names are capped at 50 characters. Allowed: letters, numbers, spaces, dots, hyphens, underscores.
Manual fallback (if hook fails)
1. Get the session ID
echo "$CLAUDE_SESSION_ID"
2. Write name to state
python3 -c "
import json, os, time
state_path = os.path.expanduser('~/.claude/hooks/peon-ping/.state.json')
try:
state = json.load(open(state_path))
except:
state = {}
state.setdefault('session_names', {})['SESSION_ID_HERE'] = 'My Session Name'
json.dump(state, open(state_path, 'w'), indent=2)
"
3. Trigger a hook event to refresh the tab title
Submit any prompt — peon.sh will pick up the new name on the next UserPromptSubmit or Stop event.
Reset
/peon-ping-rename
Or remove the session ID from session_names in .state.json directly.
Priority
/peon-ping-rename > CLAUDE_SESSION_NAME env var > .peon-label file > notification_title_script > project_name_map > notification_title_override > git repo name > folder name
常见问题
会话名称最多多少个字符?
名称上限为 50 个字符。
允许使用哪些字符?
字母、数字、空格、点号、连字符和下划线。
改名会消耗模型的 token 吗?
该技能说明,hook 处理这条命令时不消耗模型 token。
详情
作者的原始描述
Rename the current Claude session for peon-ping notifications and terminal tab title. Use when user wants to give this session a custom name like "/peon-ping-rename Auth Refactor". Call with no argument to reset to auto-detect.
repo: PeonPing/peon-ping
热度
- GitHub 星标
- 5.1k
- 排名
- #15042
- 许可证
- MIT
- 更新时间
- 2026/10/19
评论
- …