---
name: session-logger
description: Log all session activity to a timestamped log file. Use automatically at the start of every session, and when the user says "log this session", "start logging", or "session log".
---

# Session Logger

## Instructions

1. **At session start**, create a log file at `~/.openclaw/workspace-main/logs/${SESSION_ID}.log`
2. **Write a SESSION START block**: timestamp, working directory, user's initial goal
3. **Throughout the session append events**:
   - `[ACTION]` — What you're doing
   - `[COMMAND]` — Shell commands executed
   - `[DECISION]` — Key choices made
   - `[ERROR]` — Issues encountered
   - `[NOTE]` — Important context
4. **At session end** (user says "done", "wrap up", "end session"), write SESSION END block: accomplished, decisions, unresolved, next steps

## Log Format

```
================================================================================
SESSION START: ${SESSION_ID}
Timestamp: ${ISO8601}
Working Directory: ${PWD}
Initial Goal: ${USER_GOAL}
================================================================================

[ACTION] Started task analysis
[COMMAND] ls -la ~/.openclaw/
[DECISION] Using deterministic script approach
[NOTE] User prefers concise updates
...

================================================================================
SESSION END: ${SESSION_ID}
Timestamp: ${ISO8601}
Duration: ${MINUTES}m
Accomplished:
- Item 1
- Item 2

Key Decisions:
- Decision 1

Unresolved:
- Item to follow up

Next Steps:
- What to do next
================================================================================
```

## Auto-Trigger

This skill loads automatically at session start. Call `log_session_start()` implicitly.
