pi-share

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

pi-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
--human-summary
when the user asks you to:
  • 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

工作原理

  1. Session exports are stored as GitHub Gists
  2. The URL contains a gist ID after the
    ?
  3. The gist contains a
    session.html
    file with base64-encoded session data
  4. The helper script fetches and decodes this to extract the full conversation
  1. 会话导出文件存储为GitHub Gists
  2. 链接的
    ?
    后包含Gist ID
  3. Gist中包含一个
    session.html
    文件,其中包含base64编码的会话数据
  4. 辅助脚本会获取并解码该文件,以提取完整对话内容

Usage

使用方法

bash
undefined
bash
undefined

Get 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
undefined
node ~/.pi/agent/skills/pi-share/fetch-session.mjs <gist-id> --human-summary
undefined

Human Summary

人类视角总结

The
--human-summary
flag generates a ~300 word summary focused on the human's experience:
  • 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
pi -p
to analyze the condensed session transcript.
--human-summary
参数会生成约300字的总结,聚焦于人类的操作体验:
  • 他们的初始目标是什么?
  • 他们多久重新提示或引导一次Agent?
  • 他们进行了哪些类型的干预操作?(修正、澄清、表达不满等)
  • 他们的指令是具体还是模糊?
该功能通过
pi -p
调用claude-haiku-4-5来分析压缩后的会话记录。

Session 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:
  • message
    - User/assistant/toolResult messages with content blocks
  • model_change
    - Model switches
  • thinking_level_change
    - Thinking mode changes
  • compaction
    - Context compaction events
Message content block types:
  • text
    - Text content
  • toolCall
    - Tool invocation with
    toolName
    and
    args
  • thinking
    - Model thinking content
  • image
    - Embedded images
解码后的会话包含以下内容:
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
undefined
bash
undefined

Pipe 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'
undefined
node ~/.pi/agent/skills/pi-share/fetch-session.mjs "<url>" --entries | jq -s '[.[] | select(.type == "message") | .message.content[]? | select(.type == "toolCall")] | length'
undefined