This commit is contained in:
bonald 2026-01-30 17:05:45 +05:30 committed by GitHub
commit 18032bfdf5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -10,11 +10,11 @@ Search your complete conversation history stored in session JSONL files. Use thi
## Trigger
Use this skill when the user asks about prior chats, parent conversations, or historical context that isnt in memory files.
Use this skill when the user asks about prior chats, parent conversations, or historical context that isn't in memory files.
## Location
Session logs live at: `~/.clawdbot/agents/<agentId>/sessions/` (use the `agent=<id>` value from the system prompt Runtime line).
Session logs live at: `~/.openclaw/agents/<agentId>/sessions/` (use the `agent=<id>` value from the system prompt Runtime line).
- **`sessions.json`** - Index mapping session keys to session IDs
- **`<session-id>.jsonl`** - Full conversation transcript per session
@ -32,7 +32,7 @@ Each `.jsonl` file contains messages with:
### List all sessions by date and size
```bash
for f in ~/.clawdbot/agents/<agentId>/sessions/*.jsonl; do
for f in ~/.openclaw/agents/<agentId>/sessions/*.jsonl; do
date=$(head -1 "$f" | jq -r '.timestamp' | cut -dT -f1)
size=$(ls -lh "$f" | awk '{print $5}')
echo "$date $size $(basename $f)"
@ -41,7 +41,7 @@ done | sort -r
### Find sessions from a specific day
```bash
for f in ~/.clawdbot/agents/<agentId>/sessions/*.jsonl; do
for f in ~/.openclaw/agents/<agentId>/sessions/*.jsonl; do
head -1 "$f" | jq -r '.timestamp' | grep -q "2026-01-06" && echo "$f"
done
```
@ -63,7 +63,7 @@ jq -s '[.[] | .message.usage.cost.total // 0] | add' <session>.jsonl
### Daily cost summary
```bash
for f in ~/.clawdbot/agents/<agentId>/sessions/*.jsonl; do
for f in ~/.openclaw/agents/<agentId>/sessions/*.jsonl; do
date=$(head -1 "$f" | jq -r '.timestamp' | cut -dT -f1)
cost=$(jq -s '[.[] | .message.usage.cost.total // 0] | add' "$f")
echo "$date $cost"
@ -88,7 +88,7 @@ jq -r '.message.content[]? | select(.type == "toolCall") | .name' <session>.json
### Search across ALL sessions for a phrase
```bash
rg -l "phrase" ~/.clawdbot/agents/<agentId>/sessions/*.jsonl
rg -l "phrase" ~/.openclaw/agents/<agentId>/sessions/*.jsonl
```
## Tips
@ -101,5 +101,5 @@ rg -l "phrase" ~/.clawdbot/agents/<agentId>/sessions/*.jsonl
## Fast text-only hint (low noise)
```bash
jq -r 'select(.type=="message") | .message.content[]? | select(.type=="text") | .text' ~/.clawdbot/agents/<agentId>/sessions/<id>.jsonl | rg 'keyword'
jq -r 'select(.type=="message") | .message.content[]? | select(.type=="text") | .text' ~/.openclaw/agents/<agentId>/sessions/<id>.jsonl | rg 'keyword'
```