History Explorer
Read-only helper that inspects OpenClaw.NET session history for downstream
workflows (especially meta-skill-creator).
What It Does
Parses a JSON session snapshot and returns structured analytics:
| Key |
Description |
turns |
Turn count, role distribution (user vs assistant), time span, recent turn previews |
tools |
Tool invocation frequency, top tools, tool co-occurrence in the same turn |
meta_runs |
Meta-skill execution history: skill name, status, step counts, failure codes |
co_occurrences |
Skill/tool pairs that appear together across turns |
placeholder |
Emitted when no session data is available; downstream workflows treat this as a signal to rely on user intent only |
Input Contract
The script expects JSON session data on stdin. The calling agent should pipe a
JSON object matching the Session schema — specifically:
{
"id": "session-guid",
"history": [
{ "role": "user", "content": "...", "timestamp": "..." },
{ "role": "assistant", "content": "...", "timestamp": "...", "toolCalls": [...] }
],
"metaRunHistory": [
{
"runId": "...", "skillName": "...", "status": "completed",
"startedAtUtc": "...", "completedAtUtc": "...",
"stepResults": [
{ "id": "...", "kind": "...", "status": "...", "durationMs": 123 }
]
}
]
}
Output Contract
Always returns a JSON object. When session data is available, includes the
requested analytics keys. When unavailable or unparseable, returns a single
placeholder key so downstream workflows degrade deterministically.
When to Use
- Before running
meta-skill-creator: feed co-occurrence and meta-usage data
into the creator's proposal draft
- When the user asks "what skills did I use recently" or "show my session history"
- When debugging: inspect recent tool failures or meta-run error codes
- When the agent needs to recall conversation context from earlier turns
Limitations
- Read-only; never mutates session state
- Depends on the agent passing session JSON via stdin; does not access the
persistence layer directly
window_days filtering is best-effort on the timestamp field
- Session snapshots may be truncated by the agent for token budget reasons
1---2name: history-explorer3description: Inspect recent session conversation turns and meta-run history. Returns structured JSON summaries of turn counts, role distribution, tool usage, meta-skill executions, and co-occurrence patterns. Use this before running meta-skill-creator or when the user asks about recent history, past tool usage, or session activity.4---56# History Explorer78Read-only helper that inspects OpenClaw.NET session history for downstream9workflows (especially `meta-skill-creator`).1011## What It Does1213Parses a JSON session snapshot and returns structured analytics:1415| Key | Description |16| --- | --- |17| `turns` | Turn count, role distribution (`user` vs `assistant`), time span, recent turn previews |18| `tools` | Tool invocation frequency, top tools, tool co-occurrence in the same turn |19| `meta_runs` | Meta-skill execution history: skill name, status, step counts, failure codes |20| `co_occurrences` | Skill/tool pairs that appear together across turns |21| `placeholder` | Emitted when no session data is available; downstream workflows treat this as a signal to rely on user intent only |2223## Input Contract2425The script expects JSON session data on **stdin**. The calling agent should pipe a26JSON object matching the `Session` schema — specifically:2728```json29{30 "id": "session-guid",31 "history": [32 { "role": "user", "content": "...", "timestamp": "..." },33 { "role": "assistant", "content": "...", "timestamp": "...", "toolCalls": [...] }34 ],35 "metaRunHistory": [36 {37 "runId": "...", "skillName": "...", "status": "completed",38 "startedAtUtc": "...", "completedAtUtc": "...",39 "stepResults": [40 { "id": "...", "kind": "...", "status": "...", "durationMs": 123 }41 ]42 }43 ]44}45```4647## Output Contract4849Always returns a JSON object. When session data is available, includes the50requested analytics keys. When unavailable or unparseable, returns a single51`placeholder` key so downstream workflows degrade deterministically.5253## When to Use5455- Before running `meta-skill-creator`: feed co-occurrence and meta-usage data56 into the creator's proposal draft57- When the user asks "what skills did I use recently" or "show my session history"58- When debugging: inspect recent tool failures or meta-run error codes59- When the agent needs to recall conversation context from earlier turns6061## Limitations6263- Read-only; never mutates session state64- Depends on the agent passing session JSON via stdin; does not access the65 persistence layer directly66- `window_days` filtering is best-effort on the `timestamp` field67- Session snapshots may be truncated by the agent for token budget reasons