Generate timestamped hourly session log entries — idle-aware, only logs when changes were made
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).
$RB/quality_reports/session_logs/session_YYYY-MM-DD.md$RB/replication_book/95_session_history.qmd$RB/quality_reports/session_logs/.last_log_timestampWhere $RB is defined in CLAUDE.md → Shorthand Paths.
init — Start Session TimerCreate 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.
check — Hourly Check (DEFAULT)Read .last_log_timestamp to get the window start time
Scan for modified files since that timestamp:
find with -newer on the marker file*.qmd, *.yml, *.do, *.R, *.tex, *.bib, *.md in $RB/.claude/skills/, .claude/agents/, .claude/rules/_book/, _freeze/, .quarto/, quality_reports/session_logs/ (avoid self-referential logging)If no modified files found: Do nothing. Output: "No changes since [last timestamp] — skipping log entry."
If modified files found: Launch the session-logger agent (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.md file.
Update .last_log_timestamp to current time.
close — End-of-Session Summarycheck (flush any remaining changes)session_YYYY-MM-DD.md95_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.
95_session_history.qmd (above the template section, below the last session entry) and update the Session Index table.The skill is idle-aware by design:
check mode does NOTHING if no files changed since the last timestamp/session-log check periodically/session-log init/session-log check/session-log closeThe orchestrator can call check proactively after completing major tasks. The user can also invoke it manually at any time.
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.
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