session-log

Installs a Claude Code Stop hook that appends session exchanges to markdown logs.

1|Updated Mar 18, 2026
One-click install
npx skills add https://github.com/psw7205/skills --skill session-log-psw7205
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: session-log
Source: https://github.com/psw7205/skills/tree/main/skills/session-log
Command: npx skills add https://github.com/psw7205/skills --skill session-log-psw7205

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires jq, and includes scripts (resource) components.

What problem does it solve? Claude Code transcripts expire and are hard to retrieve later, so valuable conversation context disappears. This Skill installs a Stop hook that mechanically appends the last user prompt and assistant response to a per-session markdown file after every response, with zero LLM calls and zero token cost. ## Core Features & Use Cases - Automatic incremental logging: On every Stop event, a bash script extracts the final user/assistant exchange from the transcript via jq and appends it to ~/.agents/session-logs/{project}/{date}-{session_id}.md. - Crash-safe and deduplicated: Each entry carries a <!-- stop:UUID --> marker so re-fired Stop events never duplicate entries, and logging works even if the terminal is killed. - Install and uninstall management: Registers or removes the hook in ~/.claude/settings.json under hooks.Stop, skipping entries that already exist and never touching accumulated log files. - Use Case: Ask to install the session log hook, then work normally for a week; later, feed the raw per-session markdown files to a summarization skill to recover decisions from expired transcripts. ## Quick Start Install the session log hook so every Claude Code response is automatically appended to a per-session markdown file.

Frequently Asked Questions about session-log

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I automatically log Claude Code conversations to a file?▼

Install a Stop hook that runs a bash script on every response end. The script reads the transcript path from stdin JSON, extracts the last user prompt and assistant text with jq, and appends them to a per-session markdown file under ~/.agents/session-logs.

How to install a Stop hook in Claude Code settings?▼

Add an entry to hooks.Stop in ~/.claude/settings.json with type "command" pointing to the script's absolute path. The skill registers it automatically and skips if the same script filename is already present. Changes apply from the next new session.

Does automatic session logging cost tokens or slow down Claude Code?▼

No. The hook performs only jq extraction on the local transcript file with no LLM calls, so token cost is zero. If jq is missing or input is malformed, the script exits silently with code 0 so logging failures never block the session.

Why does the session log use Stop instead of SessionEnd hooks?▼

Stop fires after every response, creating crash-safe incremental records, while SessionEnd fires once and is not guaranteed when the terminal is force-killed. The tradeoff is handled with UUID markers that deduplicate re-fired Stop events.

What happens to session logs when using claude --resume?▼

Resuming may create a new session_id, which starts a new log file named with the first 8 characters of the new id. The file header records the full session_id, cwd, and date so related files can be traced back to the same work session.