name: session-log description: Generate timestamped hourly session log entries — idle-aware, only logs when changes were made disable-model-invocation: true argument-hint: "[optional: 'init' (start session timer), 'check' (log if changes exist), 'close' (final session summary)]" allowed-tools: ["Read", "Grep", "Glob", "Edit", "Write", "Bash", "Task"]
Session Log
Generate timestamped hourly log entries for active Claude Code sessions. Idle-aware: only creates log entries when files have actually been modified.
Input: $ARGUMENTS — init (start new session), check (hourly check), or close (end-of-session summary).
Key Paths
- Session log file:
$RB/quality_reports/session_logs/session_YYYY-MM-DD.md - QMD chapter:
$RB/replication_book/95_session_history.qmd - Timestamp marker:
$RB/quality_reports/session_logs/.last_log_timestamp
Where $RB is defined in CLAUDE.md → Shorthand Paths.
Modes
Mode 1: init — Start Session Timer
Create today's session log file (if it doesn't exist) and set the initial timestamp marker.
# Session Log: YYYY-MM-DD
> Auto-generated by `/session-log` skill. Hourly entries below.
**Session started:** HH:MM (local time)
**Session #:** [N] (increment from 95_session_history.qmd index)
---
Also write the current ISO timestamp to .last_log_timestamp.
Mode 2: check — Hourly Check (DEFAULT)
Read
.last_log_timestampto get the window start timeScan for modified files since that timestamp:
- Use
findwith-neweron the marker file - Include:
*.qmd,*.yml,*.do,*.R,*.tex,*.bib,*.mdin$RB/ - Also scan
.claude/skills/,.claude/agents/,.claude/rules/ - Exclude:
_book/,_freeze/,.quarto/,quality_reports/session_logs/(avoid self-referential logging)
- Use
If no modified files found: Do nothing. Output: "No changes since [last timestamp] — skipping log entry."
If modified files found: Launch the
session-loggeragent (haiku) with the timestamp window and file list. The agent returns a formatted log entry.Append the entry to today's
session_YYYY-MM-DD.mdfile.Update
.last_log_timestampto current time.
Mode 3: close — End-of-Session Summary
- Run a final
check(flush any remaining changes) - Read the full
session_YYYY-MM-DD.md - Generate a session summary block in the format expected by
95_session_history.qmd:
## Session [N]: YYYY-MM-DD — [Title derived from log entries]
### Goal
[Inferred from the log entries]
### Completed
- [Aggregated from hourly entries]
### Decisions
- [Aggregated, cross-ref to @sec-decisions if applicable]
### Problems
- [Aggregated, cross-ref to @sec-problems if applicable]
### Files Modified
- [Deduplicated list from all hourly entries]
### Next Steps
- [ ] [Inferred from incomplete work or user statements]
### Hourly Log
See `quality_reports/session_logs/session_YYYY-MM-DD.md` for timestamped detail.
- Insert this summary into
95_session_history.qmd(above the template section, below the last session entry) and update the Session Index table.
Idle-Awareness Logic
The skill is idle-aware by design:
checkmode does NOTHING if no files changed since the last timestamp- The orchestrator (or user) calls
/session-log checkperiodically - If the user hasn't interacted and Claude hasn't made autonomous changes, the file modification scan finds nothing → no log entry generated
- This means: long idle periods produce no log noise
Recommended Usage
- At session start:
/session-log init - Periodically (every ~hour of active work):
/session-log check - At session end:
/session-log close
The orchestrator can call check proactively after completing major tasks. The user can also invoke it manually at any time.
Manual Detail Override
The default logger agent runs on haiku (cheap, fast). If the user requests a more detailed log entry (e.g., documenting a complex decision or methodological choice), the orchestrator should spawn the session-logger agent on sonnet or opus instead. This is always a manual override triggered by user request — never auto-escalate.
Output
SESSION LOG: [mode]
Date: YYYY-MM-DD
Window: HH:MM – HH:MM
Changes detected: [count files] / No changes
Entry written to: quality_reports/session_logs/session_YYYY-MM-DD.md