Getting it into your agent
This one installs as part of its plugin. Adding the marketplace and installing the plugin brings it with everything else the plugin ships.
/plugin marketplace add ChamHerry/claude-code-third-party-plugins/plugin install session-managerWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/commands/chamherry/claude-code-third-party-plugins/save-session)<a href="https://agentmods.dev/commands/chamherry/claude-code-third-party-plugins/save-session"><img src="https://agentmods.dev/badge/commands/chamherry/claude-code-third-party-plugins/save-session/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/commands/chamherry/claude-code-third-party-plugins/save-session"><img src="https://agentmods.dev/badge/commands/chamherry/claude-code-third-party-plugins/save-session.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What 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.1 | $0.00011 | $0.02870 |
| Opus 5.5 | $0.00004 | $0.01148 |
| Sonnet 5.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 1mo 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.
- 1mo 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 10mo ago), licensed MIT. It adds 11 tokens to every session and 2,870 once invoked, about $0.0000 per session on Opus 5.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
minutes-ideas
Surface recent voice memos and ideas captured from any device. Use when the user asks "what ideas did I have?", "what were my recent memos?", "what did I record while walking?", or wants to recall a captured thought.
learn
Force claude-smart to extract learnings from this session now.
memory-store
Store an insight, decision, or pattern to memory.
analyze-context
USE WHEN you want to analyze project context before starting work on a task. Calls context + recall, then synthesizes goals, decisions, gotchas, and relevant memories into a pre-task brief.
cc-memory
Configure persistent memory that survives across sessions using a layered approach: split rule files for always-loaded context, auto-memory for organic learning, and optional MCP-backed long-term memory for large codebases.
lians-recall
Recall current (non-stale) facts from Lians memory, optionally as-of a past date.