session-navigation

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Session navigation

会话导航

Find your way around past Droid sessions. Maybe you want to pick up where you left off, find that thing you did last week, or just see what's been happening in a project.
查找过往Droid会话的相关内容。你可能想从中断处继续工作、找到上周处理的事项,或者查看某个项目的进展情况。

Where sessions live

会话存储位置

Sessions are in
~/.factory/sessions/
, organized by project folder. Each project gets its own directory with the path encoded (slashes become dashes):
~/.factory/sessions/
├── -Users-enoreyes-code-work-myapp/
│   ├── <uuid>.jsonl
│   └── <uuid>.settings.json
├── -Users-enoreyes-code-projects-api/
│   ├── <uuid>.jsonl
│   └── <uuid>.settings.json
└── ...
Two files per session:
The conversation (
.jsonl
): Each line is a JSON object. First line has metadata (session id, title, working directory). Rest is the back-and-forth: user messages, assistant responses, tool calls.
The settings (
.settings.json
): Stats about the session. Which model, how long it ran, token counts, autonomy mode.
会话存储在
~/.factory/sessions/
目录下,按项目文件夹组织。每个项目都有自己的目录,路径中的斜杠会替换为短横线:
~/.factory/sessions/
├── -Users-enoreyes-code-work-myapp/
│   ├── <uuid>.jsonl
│   └── <uuid>.settings.json
├── -Users-enoreyes-code-projects-api/
│   ├── <uuid>.jsonl
│   └── <uuid>.settings.json
└── ...
每个会话对应两个文件:
会话对话文件
.jsonl
):每一行是一个JSON对象。第一行包含元数据(会话ID、标题、工作目录),其余行是对话内容:用户消息、助手回复、工具调用记录。
会话设置文件
.settings.json
):会话相关统计信息,包括使用的模型、运行时长、令牌数量、自主模式等。

Finding sessions

查找会话

List project folders

列出项目文件夹

bash
undefined
bash
undefined

See all project folders with sessions

查看所有包含会话的项目文件夹

ls ~/.factory/sessions/
ls ~/.factory/sessions/

Find folders for a specific project (partial match)

查找特定项目的文件夹(支持部分匹配)

ls ~/.factory/sessions/ | grep "myapp"
undefined
ls ~/.factory/sessions/ | grep "myapp"
undefined

Recent sessions in a project

项目中的近期会话

bash
undefined
bash
undefined

List sessions by date for a project

按日期列出项目的会话

ls -lt ~/.factory/sessions/-Users-enoreyes-code-work-myapp/
ls -lt ~/.factory/sessions/-Users-enoreyes-code-work-myapp/

Get titles of recent sessions

获取近期会话的标题

for f in $(ls -t ~/.factory/sessions/-Users-enoreyes-code-work-myapp/*.jsonl | head -10); do echo "=== $f ===" head -1 "$f" | jq -r '.title // "Untitled"' done
undefined
for f in $(ls -t ~/.factory/sessions/-Users-enoreyes-code-work-myapp/*.jsonl | head -10); do echo "=== $f ===" head -1 "$f" | jq -r '.title // "Untitled"' done
undefined

Search by content

按内容搜索

bash
undefined
bash
undefined

Search across ALL sessions

在所有会话中搜索

rg "authentication" ~/.factory/sessions/
rg "authentication" ~/.factory/sessions/

Search within a specific project

在特定项目中搜索

rg "bug fix" ~/.factory/sessions/-Users-enoreyes-code-work-myapp/
rg "bug fix" ~/.factory/sessions/-Users-enoreyes-code-work-myapp/

See matches in context

查看匹配内容的上下文

rg -C 2 "login" ~/.factory/sessions/-Users-enoreyes-code-projects-api/
undefined
rg -C 2 "login" ~/.factory/sessions/-Users-enoreyes-code-projects-api/
undefined

Find which project has sessions about something

查找包含特定内容的项目会话

bash
undefined
bash
undefined

Which projects have sessions mentioning "redis"?

哪些项目的会话中提到了 "redis"?

rg -l "redis" ~/.factory/sessions/ | cut -d'/' -f1-5 | sort -u
undefined
rg -l "redis" ~/.factory/sessions/ | cut -d'/' -f1-5 | sort -u
undefined

Reading a session

读取会话内容

Once you've found a session file:
bash
undefined
找到会话文件后:
bash
undefined

The metadata (title, working directory)

查看元数据(标题、工作目录)

head -1 ~/.factory/sessions/-Users-enoreyes-code-work-myapp/<uuid>.jsonl | jq .
head -1 ~/.factory/sessions/-Users-enoreyes-code-work-myapp/<uuid>.jsonl | jq .

Session stats (model, tokens, duration)

查看会话统计信息(模型、令牌数、时长)

cat ~/.factory/sessions/-Users-enoreyes-code-work-myapp/<uuid>.settings.json | jq .
cat ~/.factory/sessions/-Users-enoreyes-code-work-myapp/<uuid>.settings.json | jq .

How long was this conversation?

查看对话的行数(即会话长度)

wc -l ~/.factory/sessions/-Users-enoreyes-code-work-myapp/<uuid>.jsonl

User messages have `"role": "user"`, assistant responses have `"role": "assistant"`. Tool calls show what commands ran and what files got touched.
wc -l ~/.factory/sessions/-Users-enoreyes-code-work-myapp/<uuid>.jsonl

用户消息的`"role"`字段为`"user"`,助手回复的`"role"`字段为`"assistant"`。工具调用记录会显示运行的命令和操作的文件。

Common situations

常见场景

"What did I work on in this project?" List that project's session folder, check dates, read through the conversation files.
"Find that session where we fixed the login bug" Search for "login" or "auth" across sessions. Once you find it, read the conversation.
"Resume what I was doing" Find the session, read through what happened, summarize the key decisions before continuing.
"How much have I been using Droid?" The settings files have token counts and active time. Sum across sessions if needed.
“我在这个项目中做了什么?” 列出该项目的会话文件夹,查看日期,阅读对话文件。
“找到修复登录bug的那个会话” 在所有会话中搜索“login”或“auth”关键词。找到后,阅读对话内容。
“从中断处继续工作” 找到对应的会话,回顾之前的内容,总结关键决策后再继续。
“我使用Droid的频率有多高?” 设置文件中包含令牌数量和活跃时长,如有需要可汇总所有会话的数据。

Tips

小贴士

Use
rg
(ripgrep) instead of grep. It's faster and handles nested folders better.
Project paths have slashes replaced with dashes.
/Users/me/code/app
becomes
-Users-me-code-app
.
The session title isn't always helpful. Sometimes you need to read the conversation to know what it was about.
Sessions can contain sensitive stuff. Be careful about what you surface.
使用
rg
(ripgrep)替代grep,它速度更快,更适合处理嵌套文件夹。
项目路径中的斜杠会被替换为短横线,例如
/Users/me/code/app
会变为
-Users-me-code-app
会话标题有时不够直观,可能需要阅读对话内容才能了解会话主题。
会话中可能包含敏感信息,查看时需谨慎。