{
  "schemaVersion": "1.0",
  "item": {
    "slug": "mh-session-logs",
    "name": "MH session-logs",
    "source": "tencent",
    "type": "skill",
    "category": "开发工具",
    "sourceUrl": "https://clawhub.ai/mohdalhashemi98-hue/mh-session-logs",
    "canonicalUrl": "https://clawhub.ai/mohdalhashemi98-hue/mh-session-logs",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadMode": "redirect",
    "downloadUrl": "/downloads/mh-session-logs",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=mh-session-logs",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "installMethod": "Manual import",
    "extraction": "Extract archive",
    "prerequisites": [
      "OpenClaw"
    ],
    "packageFormat": "ZIP package",
    "includedAssets": [
      "SKILL.md"
    ],
    "primaryDoc": "SKILL.md",
    "quickSetup": [
      "Download the package from Yavira.",
      "Extract the archive and review SKILL.md first.",
      "Import or place the package into your OpenClaw setup."
    ],
    "agentAssist": {
      "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
      "steps": [
        "Download the package from Yavira.",
        "Extract it into a folder your agent can access.",
        "Paste one of the prompts below and point your agent at the extracted folder."
      ],
      "prompts": [
        {
          "label": "New install",
          "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete."
        },
        {
          "label": "Upgrade existing",
          "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run."
        }
      ]
    },
    "sourceHealth": {
      "source": "tencent",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-04-30T16:55:25.780Z",
      "expiresAt": "2026-05-07T16:55:25.780Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=network",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=network",
        "contentDisposition": "attachment; filename=\"network-1.0.0.zip\"",
        "redirectLocation": null,
        "bodySnippet": null
      },
      "scope": "source",
      "summary": "Source download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this source.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/mh-session-logs"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    },
    "downloadPageUrl": "https://openagent3.xyz/downloads/mh-session-logs",
    "agentPageUrl": "https://openagent3.xyz/skills/mh-session-logs/agent",
    "manifestUrl": "https://openagent3.xyz/skills/mh-session-logs/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/mh-session-logs/agent.md"
  },
  "agentAssist": {
    "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
    "steps": [
      "Download the package from Yavira.",
      "Extract it into a folder your agent can access.",
      "Paste one of the prompts below and point your agent at the extracted folder."
    ],
    "prompts": [
      {
        "label": "New install",
        "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete."
      },
      {
        "label": "Upgrade existing",
        "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run."
      }
    ]
  },
  "documentation": {
    "source": "clawhub",
    "primaryDoc": "SKILL.md",
    "sections": [
      {
        "title": "session-logs",
        "body": "Search your complete conversation history stored in session JSONL files. Use this when a user references older/parent conversations or asks what was said before."
      },
      {
        "title": "Trigger",
        "body": "Use this skill when the user asks about prior chats, parent conversations, or historical context that isn't in memory files."
      },
      {
        "title": "Location",
        "body": "Session logs live at: ~/.openclaw/agents/<agentId>/sessions/ (use the agent=<id> value from the system prompt Runtime line).\n\nsessions.json - Index mapping session keys to session IDs\n<session-id>.jsonl - Full conversation transcript per session"
      },
      {
        "title": "Structure",
        "body": "Each .jsonl file contains messages with:\n\ntype: \"session\" (metadata) or \"message\"\ntimestamp: ISO timestamp\nmessage.role: \"user\", \"assistant\", or \"toolResult\"\nmessage.content[]: Text, thinking, or tool calls (filter type==\"text\" for human-readable content)\nmessage.usage.cost.total: Cost per response"
      },
      {
        "title": "List all sessions by date and size",
        "body": "for f in ~/.openclaw/agents/<agentId>/sessions/*.jsonl; do\n  date=$(head -1 \"$f\" | jq -r '.timestamp' | cut -dT -f1)\n  size=$(ls -lh \"$f\" | awk '{print $5}')\n  echo \"$date $size $(basename $f)\"\ndone | sort -r"
      },
      {
        "title": "Find sessions from a specific day",
        "body": "for f in ~/.openclaw/agents/<agentId>/sessions/*.jsonl; do\n  head -1 \"$f\" | jq -r '.timestamp' | grep -q \"2026-01-06\" && echo \"$f\"\ndone"
      },
      {
        "title": "Extract user messages from a session",
        "body": "jq -r 'select(.message.role == \"user\") | .message.content[]? | select(.type == \"text\") | .text' <session>.jsonl"
      },
      {
        "title": "Search for keyword in assistant responses",
        "body": "jq -r 'select(.message.role == \"assistant\") | .message.content[]? | select(.type == \"text\") | .text' <session>.jsonl | rg -i \"keyword\""
      },
      {
        "title": "Get total cost for a session",
        "body": "jq -s '[.[] | .message.usage.cost.total // 0] | add' <session>.jsonl"
      },
      {
        "title": "Daily cost summary",
        "body": "for f in ~/.openclaw/agents/<agentId>/sessions/*.jsonl; do\n  date=$(head -1 \"$f\" | jq -r '.timestamp' | cut -dT -f1)\n  cost=$(jq -s '[.[] | .message.usage.cost.total // 0] | add' \"$f\")\n  echo \"$date $cost\"\ndone | awk '{a[$1]+=$2} END {for(d in a) print d, \"$\"a[d]}' | sort -r"
      },
      {
        "title": "Count messages and tokens in a session",
        "body": "jq -s '{\n  messages: length,\n  user: [.[] | select(.message.role == \"user\")] | length,\n  assistant: [.[] | select(.message.role == \"assistant\")] | length,\n  first: .[0].timestamp,\n  last: .[-1].timestamp\n}' <session>.jsonl"
      },
      {
        "title": "Tool usage breakdown",
        "body": "jq -r '.message.content[]? | select(.type == \"toolCall\") | .name' <session>.jsonl | sort | uniq -c | sort -rn"
      },
      {
        "title": "Search across ALL sessions for a phrase",
        "body": "rg -l \"phrase\" ~/.openclaw/agents/<agentId>/sessions/*.jsonl"
      },
      {
        "title": "Tips",
        "body": "Sessions are append-only JSONL (one JSON object per line)\nLarge sessions can be several MB - use head/tail for sampling\nThe sessions.json index maps chat providers (discord, whatsapp, etc.) to session IDs\nDeleted sessions have .deleted.<timestamp> suffix"
      },
      {
        "title": "Fast text-only hint (low noise)",
        "body": "jq -r 'select(.type==\"message\") | .message.content[]? | select(.type==\"text\") | .text' ~/.openclaw/agents/<agentId>/sessions/<id>.jsonl | rg 'keyword'"
      }
    ],
    "body": "session-logs\n\nSearch your complete conversation history stored in session JSONL files. Use this when a user references older/parent conversations or asks what was said before.\n\nTrigger\n\nUse this skill when the user asks about prior chats, parent conversations, or historical context that isn't in memory files.\n\nLocation\n\nSession logs live at: ~/.openclaw/agents/<agentId>/sessions/ (use the agent=<id> value from the system prompt Runtime line).\n\nsessions.json - Index mapping session keys to session IDs\n<session-id>.jsonl - Full conversation transcript per session\nStructure\n\nEach .jsonl file contains messages with:\n\ntype: \"session\" (metadata) or \"message\"\ntimestamp: ISO timestamp\nmessage.role: \"user\", \"assistant\", or \"toolResult\"\nmessage.content[]: Text, thinking, or tool calls (filter type==\"text\" for human-readable content)\nmessage.usage.cost.total: Cost per response\nCommon Queries\nList all sessions by date and size\nfor f in ~/.openclaw/agents/<agentId>/sessions/*.jsonl; do\n  date=$(head -1 \"$f\" | jq -r '.timestamp' | cut -dT -f1)\n  size=$(ls -lh \"$f\" | awk '{print $5}')\n  echo \"$date $size $(basename $f)\"\ndone | sort -r\n\nFind sessions from a specific day\nfor f in ~/.openclaw/agents/<agentId>/sessions/*.jsonl; do\n  head -1 \"$f\" | jq -r '.timestamp' | grep -q \"2026-01-06\" && echo \"$f\"\ndone\n\nExtract user messages from a session\njq -r 'select(.message.role == \"user\") | .message.content[]? | select(.type == \"text\") | .text' <session>.jsonl\n\nSearch for keyword in assistant responses\njq -r 'select(.message.role == \"assistant\") | .message.content[]? | select(.type == \"text\") | .text' <session>.jsonl | rg -i \"keyword\"\n\nGet total cost for a session\njq -s '[.[] | .message.usage.cost.total // 0] | add' <session>.jsonl\n\nDaily cost summary\nfor f in ~/.openclaw/agents/<agentId>/sessions/*.jsonl; do\n  date=$(head -1 \"$f\" | jq -r '.timestamp' | cut -dT -f1)\n  cost=$(jq -s '[.[] | .message.usage.cost.total // 0] | add' \"$f\")\n  echo \"$date $cost\"\ndone | awk '{a[$1]+=$2} END {for(d in a) print d, \"$\"a[d]}' | sort -r\n\nCount messages and tokens in a session\njq -s '{\n  messages: length,\n  user: [.[] | select(.message.role == \"user\")] | length,\n  assistant: [.[] | select(.message.role == \"assistant\")] | length,\n  first: .[0].timestamp,\n  last: .[-1].timestamp\n}' <session>.jsonl\n\nTool usage breakdown\njq -r '.message.content[]? | select(.type == \"toolCall\") | .name' <session>.jsonl | sort | uniq -c | sort -rn\n\nSearch across ALL sessions for a phrase\nrg -l \"phrase\" ~/.openclaw/agents/<agentId>/sessions/*.jsonl\n\nTips\nSessions are append-only JSONL (one JSON object per line)\nLarge sessions can be several MB - use head/tail for sampling\nThe sessions.json index maps chat providers (discord, whatsapp, etc.) to session IDs\nDeleted sessions have .deleted.<timestamp> suffix\nFast text-only hint (low noise)\njq -r 'select(.type==\"message\") | .message.content[]? | select(.type==\"text\") | .text' ~/.openclaw/agents/<agentId>/sessions/<id>.jsonl | rg 'keyword'"
  },
  "trust": {
    "sourceLabel": "tencent",
    "provenanceUrl": "https://clawhub.ai/mohdalhashemi98-hue/mh-session-logs",
    "publisherUrl": "https://clawhub.ai/mohdalhashemi98-hue/mh-session-logs",
    "owner": "mohdalhashemi98-hue",
    "version": "1.0.0",
    "license": null,
    "verificationStatus": "Indexed source record"
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/mh-session-logs",
    "downloadUrl": "https://openagent3.xyz/downloads/mh-session-logs",
    "agentUrl": "https://openagent3.xyz/skills/mh-session-logs/agent",
    "manifestUrl": "https://openagent3.xyz/skills/mh-session-logs/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/mh-session-logs/agent.md"
  }
}