pi-share
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinesepi-share / buildwithpi Session Loader
pi-share / buildwithpi 会话加载工具
Load and parse session transcripts from pi-share URLs (shittycodingagent.ai, buildwithpi.ai, buildwithpi.com).
加载并解析来自pi-share链接(shittycodingagent.ai、buildwithpi.ai、buildwithpi.com)的会话记录。
When to Use
使用场景
Loading sessions: Use this skill when the user provides a URL like:
https://shittycodingagent.ai/session/?<gist_id>https://buildwithpi.ai/session/?<gist_id>https://buildwithpi.com/session/?<gist_id>- Or just a gist ID like
46aee35206aefe99257bc5d5e60c6121
Human summaries: Use when the user asks you to:
--human-summary- Summarize what a human did in a pi/coding agent session
- Understand how a user interacted with an agent
- Analyze user behavior, steering patterns, or prompting style
- Get a human-centric view of a session (not what the agent did, but what the human did)
The human summary focuses on: initial goals, re-prompts, steering/corrections, interventions, and overall prompting style.
**加载会话:**当用户提供如下格式的链接时使用该技能:
https://shittycodingagent.ai/session/?<gist_id>https://buildwithpi.ai/session/?<gist_id>https://buildwithpi.com/session/?<gist_id>- 或者直接提供Gist ID,例如
46aee35206aefe99257bc5d5e60c6121
**人类行为总结:**当用户要求你完成以下操作时,使用参数:
--human-summary- 总结人类在pi/编码Agent会话中的操作
- 理解用户与Agent的交互方式
- 分析用户行为、引导模式或提示风格
- 获取会话的人类视角总结(关注人类的操作,而非Agent的行为)
人类行为总结重点包括:初始目标、重新提示、引导/修正、干预操作以及整体提示风格。
How It Works
工作原理
- Session exports are stored as GitHub Gists
- The URL contains a gist ID after the
? - The gist contains a file with base64-encoded session data
session.html - The helper script fetches and decodes this to extract the full conversation
- 会话导出文件存储为GitHub Gists
- 链接的后包含Gist ID
? - Gist中包含一个文件,其中包含base64编码的会话数据
session.html - 辅助脚本会获取并解码该文件,以提取完整对话内容
Usage
使用方法
bash
undefinedbash
undefinedGet full session data (default)
获取完整会话数据(默认模式)
node ~/.pi/agent/skills/pi-share/fetch-session.mjs "<url-or-gist-id>"
node ~/.pi/agent/skills/pi-share/fetch-session.mjs "<url-or-gist-id>"
Get just the header
仅获取会话头信息
node ~/.pi/agent/skills/pi-share/fetch-session.mjs <gist-id> --header
node ~/.pi/agent/skills/pi-share/fetch-session.mjs <gist-id> --header
Get entries as JSON lines (one entry per line)
以JSON行格式获取会话条目(每行一个条目)
node ~/.pi/agent/skills/pi-share/fetch-session.mjs <gist-id> --entries
node ~/.pi/agent/skills/pi-share/fetch-session.mjs <gist-id> --entries
Get the system prompt
获取系统提示词
node ~/.pi/agent/skills/pi-share/fetch-session.mjs <gist-id> --system
node ~/.pi/agent/skills/pi-share/fetch-session.mjs <gist-id> --system
Get tool definitions
获取工具定义
node ~/.pi/agent/skills/pi-share/fetch-session.mjs <gist-id> --tools
node ~/.pi/agent/skills/pi-share/fetch-session.mjs <gist-id> --tools
Get human-centric summary (what did the human do in this session?)
获取人类视角总结(会话中人类的操作)
node ~/.pi/agent/skills/pi-share/fetch-session.mjs <gist-id> --human-summary
undefinednode ~/.pi/agent/skills/pi-share/fetch-session.mjs <gist-id> --human-summary
undefinedHuman Summary
人类视角总结
The flag generates a ~300 word summary focused on the human's experience:
--human-summary- What was their initial goal?
- How often did they re-prompt or steer the agent?
- What kind of interventions did they make? (corrections, clarifications, frustration)
- How specific or vague were their instructions?
This uses claude-haiku-4-5 via to analyze the condensed session transcript.
pi -p--human-summary- 他们的初始目标是什么?
- 他们多久重新提示或引导一次Agent?
- 他们进行了哪些类型的干预操作?(修正、澄清、表达不满等)
- 他们的指令是具体还是模糊?
该功能通过调用claude-haiku-4-5来分析压缩后的会话记录。
pi -pSession Data Structure
会话数据结构
The decoded session contains:
typescript
interface SessionData {
header: {
type: "session";
version: number;
id: string; // Session UUID
timestamp: string; // ISO timestamp
cwd: string; // Working directory
};
entries: SessionEntry[]; // Conversation entries (JSON lines format)
leafId: string | null; // Current branch leaf
systemPrompt?: string; // System prompt text
tools?: { name: string; description: string }[];
}Entry types include:
- - User/assistant/toolResult messages with content blocks
message - - Model switches
model_change - - Thinking mode changes
thinking_level_change - - Context compaction events
compaction
Message content block types:
- - Text content
text - - Tool invocation with
toolCallandtoolNameargs - - Model thinking content
thinking - - Embedded images
image
解码后的会话包含以下内容:
typescript
interface SessionData {
header: {
type: "session";
version: number;
id: string; // 会话UUID
timestamp: string; // ISO时间戳
cwd: string; // 工作目录
};
entries: SessionEntry[]; // 对话条目(JSON行格式)
leafId: string | null; // 当前分支节点
systemPrompt?: string; // 系统提示词文本
tools?: { name: string; description: string }[];
}条目类型包括:
- - 包含内容块的用户/助手/工具结果消息
message - - 模型切换
model_change - - 思考模式变更
thinking_level_change - - 上下文压缩事件
compaction
消息内容块类型:
- - 文本内容
text - - 带有
toolCall和toolName的工具调用args - - 模型思考内容
thinking - - 嵌入的图片
image
Example: Analyze a Session
示例:分析会话
bash
undefinedbash
undefinedPipe entries through jq to filter
通过jq管道过滤条目
node ~/.pi/agent/skills/pi-share/fetch-session.mjs "<url>" --entries | jq 'select(.type == "message" and .message.role == "user")'
node ~/.pi/agent/skills/pi-share/fetch-session.mjs "<url>" --entries | jq 'select(.type == "message" and .message.role == "user")'
Count tool calls
统计工具调用次数
node ~/.pi/agent/skills/pi-share/fetch-session.mjs "<url>" --entries | jq -s '[.[] | select(.type == "message") | .message.content[]? | select(.type == "toolCall")] | length'
undefinednode ~/.pi/agent/skills/pi-share/fetch-session.mjs "<url>" --entries | jq -s '[.[] | select(.type == "message") | .message.content[]? | select(.type == "toolCall")] | length'
undefined