Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add commands/chamherry/claude-code-third-party-plugins/save-sessiongit clone --depth 1 https://github.com/ChamHerry/claude-code-third-party-pluginsWhat it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00011 | $0.02870 |
| Opus 5 | $0.00005 | $0.01435 |
| Sonnet 5 | $0.00002 | $0.00574 |
| Haiku 4.5 | $0.00001 | $0.00287 |
Grade A, and why
save-session scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 401 lines — stays where its author put it; the contents beside it link to each section on GitHub.
智能分析当前会话内容,提取关键信息(项目进度、实施方案、关键决策、文件变更),并保存到分层存储结构中。
核心特性:
- 📊 智能提取: 自动识别 TodoWrite、AskUserQuestion、文件操作等关键信息
- 💾 分层存储: 摘要文件 + 完整日志,兼顾查询效率和数据完整性
- 🔍 防失真: 保留完整对话记录,避免压缩导致信息丢失
- 🌐 跨平台: 完全兼容 Windows / macOS / Linux
执行步骤
1. 定位当前会话文件
找到 Claude Code 当前会话的 JSONL 文件。
位置:~/.claude/projects/ 目录下
匹配规则:
- 项目目录名包含当前工作目录的路径信息
- 例如:项目在
/Users/user/my-project - 对应目录可能是:
-Users-user-my-project/
- 例如:项目在
- 文件名格式:
{session-uuid}.jsonl - 排除
agent-开头的文件 - 选择最新的文件(按修改时间)
如果找不到:
- 输出错误信息
- 说明可能原因:
- 当前不在 Claude Code 会话中
- 会话数据已被清理
- 项目路径不匹配
提取信息:
- 会话文件的完整路径
- 会话 UUID(文件名不含扩展名)
2. 读取并解析会话数据
a. 使用 Read 工具读取整个 JSONL 文件
# 读取会话文件
Read tool: $CURRENT_SESSION
b. 解析 JSONL 数据并提取关键信息
- 使用 Python 脚本处理 JSON 数据(跨平台兼容)
- 提取以下信息:
- 第一条用户消息(作为会话标题)
- 所有用户消息和 AI 响应
- TodoWrite 工具调用(进度信息)
- AskUserQuestion 工具调用(关键决策)
- Write/Edit 工具调用(文件变更)
- 消息时间戳(开始和结束时间)
c. 解析脚本实现
import json
import sys
from datetime import datetime
# 读取 JSONL 并解析
messages = []
todos = []
decisions = []
file_changes = []
for line in sys.stdin:
msg = json.loads(line.strip())
messages.append(msg)
# 提取 TodoWrite
if msg.get('type') == 'tool_use' and msg.get('name') == 'TodoWrite':
todos.append(msg.get('input', {}).get('todos', []))
# 提取 AskUserQuestion
if msg.get('type') == 'tool_use' and msg.get('name') == 'AskUserQuestion':
decisions.append({
'timestamp': msg.get('timestamp'),
'questions': msg.get('input', {}).get('questions', []),
'answers': msg.get('input', {}).get('answers', {})
})
# 提取文件操作
if msg.get('type') == 'tool_use' and msg.get('name') in ['Write', 'Edit']:
file_changes.append({
'operation': 'created' if msg.get('name') == 'Write' else 'modified',
'path': msg.get('input', {}).get('file_path', ''),
'timestamp': msg.get('timestamp')
})
# 输出结果
print(json.dumps({
'messages': messages,
'todos': todos,
'decisions': decisions,
'file_changes': file_changes
}))
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 2d ago First seen · 401 lines · 11 tokens per session scan A aa62129be236
save-session is a command published in the GitHub repository ChamHerry/claude-code-third-party-plugins (50 stars, last pushed 9mo ago), licensed MIT. It adds 11 tokens to every session and 2,870 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other commands, from other repositories
checklist
Generate a custom checklist for the current feature based on user requirements.
clarify
Identify underspecified areas in the current feature spec by asking up to 5 highly targeted clarification questions and encoding answers back into the spec.
specify
Create or update the feature specification from a natural language feature description.
analyze
Perform a non-destructive cross-artifact consistency and quality analysis across spec.md, plan.md, and tasks.md after task generation.
converge
Assess the current codebase against the feature's spec, plan, and tasks, then append any remaining unbuilt work as new tasks to tasks.md so implement can complete it.
implement
Execute the implementation plan by processing and executing all tasks defined in tasks.md.