Merge dff4a3443d into da71eaebd2
This commit is contained in:
commit
18032bfdf5
@ -10,11 +10,11 @@ Search your complete conversation history stored in session JSONL files. Use thi
|
|||||||
|
|
||||||
## Trigger
|
## Trigger
|
||||||
|
|
||||||
Use this skill when the user asks about prior chats, parent conversations, or historical context that isn’t 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
|
## 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
|
- **`sessions.json`** - Index mapping session keys to session IDs
|
||||||
- **`<session-id>.jsonl`** - Full conversation transcript per session
|
- **`<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
|
### List all sessions by date and size
|
||||||
```bash
|
```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)
|
date=$(head -1 "$f" | jq -r '.timestamp' | cut -dT -f1)
|
||||||
size=$(ls -lh "$f" | awk '{print $5}')
|
size=$(ls -lh "$f" | awk '{print $5}')
|
||||||
echo "$date $size $(basename $f)"
|
echo "$date $size $(basename $f)"
|
||||||
@ -41,7 +41,7 @@ done | sort -r
|
|||||||
|
|
||||||
### Find sessions from a specific day
|
### Find sessions from a specific day
|
||||||
```bash
|
```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"
|
head -1 "$f" | jq -r '.timestamp' | grep -q "2026-01-06" && echo "$f"
|
||||||
done
|
done
|
||||||
```
|
```
|
||||||
@ -63,7 +63,7 @@ jq -s '[.[] | .message.usage.cost.total // 0] | add' <session>.jsonl
|
|||||||
|
|
||||||
### Daily cost summary
|
### Daily cost summary
|
||||||
```bash
|
```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)
|
date=$(head -1 "$f" | jq -r '.timestamp' | cut -dT -f1)
|
||||||
cost=$(jq -s '[.[] | .message.usage.cost.total // 0] | add' "$f")
|
cost=$(jq -s '[.[] | .message.usage.cost.total // 0] | add' "$f")
|
||||||
echo "$date $cost"
|
echo "$date $cost"
|
||||||
@ -88,7 +88,7 @@ jq -r '.message.content[]? | select(.type == "toolCall") | .name' <session>.json
|
|||||||
|
|
||||||
### Search across ALL sessions for a phrase
|
### Search across ALL sessions for a phrase
|
||||||
```bash
|
```bash
|
||||||
rg -l "phrase" ~/.clawdbot/agents/<agentId>/sessions/*.jsonl
|
rg -l "phrase" ~/.openclaw/agents/<agentId>/sessions/*.jsonl
|
||||||
```
|
```
|
||||||
|
|
||||||
## Tips
|
## Tips
|
||||||
@ -101,5 +101,5 @@ rg -l "phrase" ~/.clawdbot/agents/<agentId>/sessions/*.jsonl
|
|||||||
## Fast text-only hint (low noise)
|
## Fast text-only hint (low noise)
|
||||||
|
|
||||||
```bash
|
```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'
|
||||||
```
|
```
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user