用 Planet 保存 Claude Code 会话

4 月 6 日
 Livid

有时候,当你在 Claude Code 里完成了一些复杂的事情,你可能想把这个 session 总结保存下来,稍后可以浏览或者分享。

你可以用下面的这个提示词让 Claude Code 来创建一个 skill 将会话保存到 Planet:

Create a Claude Code skill called `/save-session` that saves the current session summary as a Planet article. One planet per project, one article per session. If the article already exists, update it.

Planet API docs: https://raw.githubusercontent.com/Planetable/Planet/refs/heads/main/Technotes/API.md

然后你可以用这种方式来告诉 Claude Code 如何映射:

planet server url: http://127.0.0.1:8086

planet uuid for this project: 6A10E06A-C77E-4D43-B96F-4F870ACF7005

Planet UUID 可以右键 Copy UUID 获得。

然后就可以在需要的时候将会话总结保存进 Planet 稍后浏览或者分享了。


或者也可以用这里已经创建好的 skill 文件:

https://github.com/Planetable/Planet/tree/main/tools/claude-code-skill

2803 次点击
所在节点    Planet
13 条回复
cairnechen
4 月 6 日
啊? save-session 是按照 Claude Code 自己存 session memory 的方式保存的吗?还可以这样?
我这两天看源码,还准备自己写 skill 来按照它的方式保存 memory 然后在别的电脑或者 codex 继续工作来着

session memory 在 src\services\SessionMemory\prompts.ts

# Session Title
_A short and distinctive 5-10 word descriptive title for the session. Super info dense, no filler_

# Current State
_What is actively being worked on right now? Pending tasks not yet completed. Immediate next steps._

# Task specification
_What did the user ask to build? Any design decisions or other explanatory context_

# Files and Functions
_What are the important files? In short, what do they contain and why are they relevant?_

# Workflow
_What bash commands are usually run and in what order? How to interpret their output if not obvious?_

# Errors & Corrections
_Errors encountered and how they were fixed. What did the user correct? What approaches failed and should not be tried again?_

# Codebase and System Documentation
_What are the important system components? How do they work/fit together?_

# Learnings
_What has worked well? What has not? What to avoid? Do not duplicate items from other sections_

# Key results
_If the user asked a specific output such as an answer to a question, a table, or other document, repeat the exact result here_

# Worklog
_Step by step, what was attempted, done? Very terse summary for each step_
Livid
4 月 6 日
shoaly
4 月 6 日
更合适的方式是, 开一个工具, 直接将本地所有 session 中的对话整理出来, 同步到某个地方(obsidian 都行), 这样就能随时搜索之前聊了什么, 有时候项目久了, 是需要回头看看某一次说过什么, 机器回过什么的. 现在 cc 做不到跨项目, 跨 session 的搜索
Tink
4 月 6 日
@shoaly 这个有很多现成的工具,比如 tg_cli ,可以直接查 tg 聊天记录,还有 lossless_claw ,用 sqlite 存每一次对话
shoaly
4 月 6 日
@Tink #4 我在说 整理的是 claude code 的所有对话, 不用显示的 /save-session , tg 在这个场景是起的什么作用呢?
Tink
4 月 6 日
@shoaly 就是现在不是有很多 tg 控制 cc 的方案嘛,然后就刚好利用 tg 把 cc 的 session 不压缩保存到聊天记录里面,便于后续查之前的执行过程
shmilypeter
4 月 6 日
一些值得保存的 session 我一般会让其总结一下生成一个 html 文件,方便阅读和归档。

感谢 OP 提供 skills
ronman
4 月 6 日
@shoaly 同步到 obsidian 有什么的现成的工具吗
lemonda
4 月 7 日
是个问题,我甚至开着 OpenCode 让它搜 Claude Code 的聊天记录。
另一个需求是,AI 把我说的需求表达的更简练时,会看下它用了什么词儿。
Livid
4 月 7 日
@lemonda 那么你可以修改初始提示词,让这个 skill 重点保存的是所有的 prompts 及对应的回复:

```
Create a Claude Code skill called `/save-session` that saves the current session prompts and responses as a Planet article. One planet per project, one article per session. If the article already exists, update it.

Planet API docs: https://raw.githubusercontent.com/Planetable/Planet/refs/heads/main/Technotes/API.md
```

根据需求改就好。
Livid
4 月 7 日
今天用 Claude Code 分析一个代码库,然后让它创建了一篇详细的分析文档发送到 Planet:

https://k51qzi5uqu5dluwqy5gdyg2i4xsa18f70md07m5kyvshli6jisk5qs5b2ygw93.eth.sucks/DCCC1485-1CB9-45AD-AF1F-C3C4138E58A1/
seedscoder
4 月 7 日
Planet 是什么?是第一张截图里面的软件吗?
Livid
4 月 7 日

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/1203745

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX