ClawedBack oc-session
Load and save conversation session state. Use internally when processing messages to maintain context across the chat. Do NOT invoke directly.
install
source · Clone the upstream repo
git clone https://github.com/reedmayhew18/ClawedBack
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/reedmayhew18/ClawedBack "$T" && mkdir -p ~/.claude/skills && cp -r "$T/.claude/skills/oc-session" ~/.claude/skills/reedmayhew18-clawedback-oc-session && rm -rf "$T"
manifest:
.claude/skills/oc-session/SKILL.mdsource content
Session Manager
Manages conversation state so Claude Code maintains context across messages received through the web chat queue.
Session File
Session state is stored at:
$PROJECT_ROOT/data/sessions/conversation.json
Schema
{ "last_updated": 1700000000.0, "message_count": 42, "summary": "User is working on a Python data pipeline. Recently asked about pandas performance.", "recent_messages": [ {"role": "user", "content": "...", "timestamp": 1700000000.0}, {"role": "assistant", "content": "...", "timestamp": 1700000001.0} ], "user_preferences": {}, "active_tasks": [], "pending_approvals": [] }
How to Use
Loading Session
Read
data/sessions/conversation.json. If it doesn't exist, start fresh.
Updating Session
After processing each message:
- Append the user message and your response to
recent_messages - Keep only the last 20 messages in
(sliding window)recent_messages - Update
if the conversation topic shifted — this summary survives the windowsummary - Update
timestamplast_updated - Write the file back
Summary Strategy
The
summary field is your long-term memory. Update it when:
- The user starts a new topic
- Important context is about to leave the 20-message window
- The user states a preference or correction
Keep the summary under 500 characters. Focus on: what the user is working on, key decisions made, and stated preferences.
Active Tasks
Track ongoing work the user mentioned:
{"task": "fix the login bug", "status": "in_progress", "created": 1700000000.0}
Pending Approvals
Track operations waiting for user approval:
{"id": "abc123", "action": "bash", "command": "rm -rf old/", "requested": 1700000000.0}
For workflow chain approvals, the object also includes
workflow_id, workflow_name, step, and total_steps. See /oc-approve for details.
Active Workflows
Multi-step approval chains are tracked in a separate file:
data/sessions/workflows.json. This file persists across crashes and restarts. See /oc-approve for the full schema and lifecycle. The session's pending_approvals list handles individual step approvals; workflows.json tracks the overall chain state.