Skip to content

Commit 89bb39c

Browse files
Fix session-navigation: sessions organized by project folder
Sessions are stored in project-specific folders, not loose files. Updated examples to reflect the actual directory structure. Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
1 parent 2c446ac commit 89bb39c

1 file changed

Lines changed: 53 additions & 40 deletions

File tree

  • plugins/droid-evolved/skills/session-navigation
Lines changed: 53 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
name: session-navigation
3-
version: 1.0.0
3+
version: 1.1.0
44
description: |
55
Navigate, search, and manage Droid sessions. Use when the user wants to:
66
- List recent sessions
@@ -16,94 +16,107 @@ Find your way around past Droid sessions. Maybe you want to pick up where you le
1616

1717
## Where sessions live
1818

19-
Everything's in `~/.factory/sessions/`. Two types of files per session:
19+
Sessions are in `~/.factory/sessions/`, organized by project folder. Each project gets its own directory with the path encoded (slashes become dashes):
20+
21+
```
22+
~/.factory/sessions/
23+
├── -Users-enoreyes-code-work-myapp/
24+
│ ├── <uuid>.jsonl
25+
│ └── <uuid>.settings.json
26+
├── -Users-enoreyes-code-projects-api/
27+
│ ├── <uuid>.jsonl
28+
│ └── <uuid>.settings.json
29+
└── ...
30+
```
31+
32+
Two files per session:
2033

2134
**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.
2235

2336
**The settings** (`.settings.json`): Stats about the session. Which model, how long it ran, token counts, autonomy mode.
2437

25-
Sessions are organized by project path. A session from `/Users/me/code/myapp` ends up in:
38+
## Finding sessions
2639

27-
```
28-
~/.factory/sessions/-Users-me-code-myapp/<uuid>.jsonl
29-
```
40+
### List project folders
3041

31-
Sessions without a specific project just go in the root sessions folder.
42+
```bash
43+
# See all project folders with sessions
44+
ls ~/.factory/sessions/
3245

33-
## Finding sessions
46+
# Find folders for a specific project (partial match)
47+
ls ~/.factory/sessions/ | grep "myapp"
48+
```
3449

35-
### Recent stuff
50+
### Recent sessions in a project
3651

3752
```bash
38-
# What's been happening lately?
39-
ls -lt ~/.factory/sessions/*.jsonl | head -20
53+
# List sessions by date for a project
54+
ls -lt ~/.factory/sessions/-Users-enoreyes-code-work-myapp/
4055

41-
# Get the titles
42-
for f in $(ls -t ~/.factory/sessions/*.jsonl | head -10); do
56+
# Get titles of recent sessions
57+
for f in $(ls -t ~/.factory/sessions/-Users-enoreyes-code-work-myapp/*.jsonl | head -10); do
58+
echo "=== $f ==="
4359
head -1 "$f" | jq -r '.title // "Untitled"'
4460
done
4561
```
4662

4763
### Search by content
4864

4965
```bash
50-
# Find sessions that mention something
51-
rg -l "authentication" ~/.factory/sessions/*.jsonl
66+
# Search across ALL sessions
67+
rg "authentication" ~/.factory/sessions/
5268

53-
# See the matches in context
54-
rg -C 2 "authentication" ~/.factory/sessions/*.jsonl
69+
# Search within a specific project
70+
rg "bug fix" ~/.factory/sessions/-Users-enoreyes-code-work-myapp/
71+
72+
# See matches in context
73+
rg -C 2 "login" ~/.factory/sessions/-Users-enoreyes-code-projects-api/
5574
```
5675

57-
### For a specific project
76+
### Find which project has sessions about something
5877

5978
```bash
60-
# Just that project's sessions
61-
ls ~/.factory/sessions/-Users-me-code-myapp/
62-
63-
# Search within them
64-
rg "bug fix" ~/.factory/sessions/-Users-me-code-myapp/*.jsonl
79+
# Which projects have sessions mentioning "redis"?
80+
rg -l "redis" ~/.factory/sessions/ | cut -d'/' -f1-5 | sort -u
6581
```
6682

6783
## Reading a session
6884

6985
Once you've found a session file:
7086

7187
```bash
72-
# The metadata
73-
head -1 ~/.factory/sessions/<uuid>.jsonl | jq .
88+
# The metadata (title, working directory)
89+
head -1 ~/.factory/sessions/-Users-enoreyes-code-work-myapp/<uuid>.jsonl | jq .
7490

7591
# Session stats (model, tokens, duration)
76-
cat ~/.factory/sessions/<uuid>.settings.json | jq .
92+
cat ~/.factory/sessions/-Users-enoreyes-code-work-myapp/<uuid>.settings.json | jq .
7793

7894
# How long was this conversation?
79-
wc -l ~/.factory/sessions/<uuid>.jsonl
95+
wc -l ~/.factory/sessions/-Users-enoreyes-code-work-myapp/<uuid>.jsonl
8096
```
8197

82-
To dig into the content, read the `.jsonl` file. User messages have `"role": "user"`, assistant responses have `"role": "assistant"`. Tool calls show what commands ran and what files got touched.
98+
User messages have `"role": "user"`, assistant responses have `"role": "assistant"`. Tool calls show what commands ran and what files got touched.
8399

84100
## Common situations
85101

86-
**"What did I do yesterday?"**
87-
List recent sessions, check the timestamps, read the ones from yesterday.
102+
**"What did I work on in this project?"**
103+
List that project's session folder, check dates, read through the conversation files.
88104

89105
**"Find that session where we fixed the login bug"**
90-
Search for "login" or "auth" or whatever you remember about it. Once you find it, skim the conversation.
106+
Search for "login" or "auth" across sessions. Once you find it, read the conversation.
91107

92108
**"Resume what I was doing"**
93-
Find the session, read through what happened, and pick up from there. You might want to summarize the key decisions or the state of things before continuing.
94-
95-
**"What's been going on in this project?"**
96-
List that project's session folder, maybe grep for specific features or issues.
109+
Find the session, read through what happened, summarize the key decisions before continuing.
97110

98111
**"How much have I been using Droid?"**
99-
The settings files have token counts and active time. You could sum those up across sessions if you wanted.
112+
The settings files have token counts and active time. Sum across sessions if needed.
100113

101114
## Tips
102115

103-
Use `rg` (ripgrep) instead of grep. It's faster and handles the sessions folder better.
116+
Use `rg` (ripgrep) instead of grep. It's faster and handles nested folders better.
104117

105-
Sessions can contain sensitive stuff. Be careful about what you surface.
118+
Project paths have slashes replaced with dashes. `/Users/me/code/app` becomes `-Users-me-code-app`.
106119

107-
The session title in the first line of the jsonl isn't always helpful. Sometimes you need to actually read the conversation to know what it was about.
120+
The session title isn't always helpful. Sometimes you need to read the conversation to know what it was about.
108121

109-
Project paths in folder names have slashes replaced with dashes. `/Users/me/code/app` becomes `-Users-me-code-app`. Takes a second to get used to reading them.
122+
Sessions can contain sensitive stuff. Be careful about what you surface.

0 commit comments

Comments
 (0)