session-log

star 0

Generate timestamped hourly session log entries — idle-aware, only logs when changes were made

naj2r By naj2r schedule Updated 2/26/2026

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: $ARGUMENTSinit (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)

  1. Read .last_log_timestamp to get the window start time

  2. Scan for modified files since that timestamp:

    • Use find with -newer on the marker file
    • Include: *.qmd, *.yml, *.do, *.R, *.tex, *.bib, *.md in $RB/
    • Also scan .claude/skills/, .claude/agents/, .claude/rules/
    • Exclude: _book/, _freeze/, .quarto/, quality_reports/session_logs/ (avoid self-referential logging)
  3. If no modified files found: Do nothing. Output: "No changes since [last timestamp] — skipping log entry."

  4. If modified files found: Launch the session-logger agent (haiku) with the timestamp window and file list. The agent returns a formatted log entry.

  5. Append the entry to today's session_YYYY-MM-DD.md file.

  6. Update .last_log_timestamp to current time.

Mode 3: close — End-of-Session Summary

  1. Run a final check (flush any remaining changes)
  2. Read the full session_YYYY-MM-DD.md
  3. 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.
  1. 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:

  • check mode does NOTHING if no files changed since the last timestamp
  • The orchestrator (or user) calls /session-log check periodically
  • 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

  1. At session start: /session-log init
  2. Periodically (every ~hour of active work): /session-log check
  3. 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
Install via CLI
npx skills add https://github.com/naj2r/claude-econ-paper-template --skill session-log
Repository Details
star Stars 0
call_split Forks 0
navigation Branch main
article Path SKILL.md
More from Creator