openclaw-session-header-fix

Prepend missing session headers to OpenClaw session JSONL files.

18|1|Updated Jan 29, 2026
One-click install
npx skills add https://github.com/castle-x/skills-x --skill openclaw-session-header-fix
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: openclaw-session-header-fix
Source: https://github.com/castle-x/skills-x/tree/main/skills/openclaw-session-header-fix
Command: npx skills add https://github.com/castle-x/skills-x --skill openclaw-session-header-fix

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill resolves issues where OpenClaw session JSONL files are missing the crucial session header, leading to session overwrites and context loss.

Core Features & Use Cases

  • Identify Missing Headers: Detects if the first line of a session file lacks the required type: "session" field.
  • Backup and Repair: Creates a backup of the corrupted file and prepends the necessary header to restore session integrity.
  • Use Case: If your OpenClaw sessions are consistently short, get overwritten after each conversation, or openclaw doctor reports missing transcripts, this skill can automatically fix the underlying file structure.

Quick Start

Use the openclaw-session-header-fix skill to repair the session file for session ID 'your-session-id-here'.

Frequently Asked Questions about openclaw-session-header-fix

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I fix OpenClaw session JSONL files missing the session header?

OpenClaw sessions get overwritten or lose context when the session JSONL file lacks the required 'session' header as the first line, causing the application to fail tracking the conversation state and eventually report missing transcripts during diagnostic checks.

Why does openclaw doctor report sessions missing transcripts?

OpenClaw doctor reports sessions missing transcripts because the session JSONL file lacks the required 'session' header as the first line, causing the application to fail tracking the conversation state and eventually report missing transcripts during diagnostic checks.

What causes unusually low line counts in OpenClaw session files?

Unusually low line counts in OpenClaw session files happen when the 'session' header is missing, causing the file to be overwritten with each new conversation instead of appending data, resulting in only assistant messages remaining in the history.

What information do I need to repair a corrupted OpenClaw session file?

You need the specific session ID and the exact file path of the corrupted JSONL file to execute the repair script, which creates a backup before inserting the missing 'session' header to restore the session structure.

Does repairing OpenClaw session headers delete my conversation history?

No, repairing OpenClaw session headers does not delete conversation history. The repair script creates a backup of the corrupted JSONL file before prepending the missing 'session' header, ensuring existing assistant messages and context are preserved.