Automatically captures what you learned, built, or discovered — then turns it into skills, rules, automations, and memories. Works even when you just close the tab.
/debrief anytime to trigger a full four-question assessment mid-session and build what's warranted immediately./command to ~/.claude/commands/ and adds it to your CLAUDE.md skills table.~/.claude/scripts/session-logger.py — create the folder if it doesn't exist.#!/usr/bin/env python3 # Session Activity Logger — clayparker-fullstackmarketer.vercel.app/session-debrief # Logs each session's activity to ~/.claude/session-log.jsonl for daily auto-debrief. import json, sys, os from datetime import datetime LOG_FILE = os.path.expanduser("~/.claude/session-log.jsonl") def main(): try: payload = json.loads(sys.stdin.read()) transcript_path = payload.get("transcript_path") session_id = payload.get("session_id", "unknown") except Exception: sys.exit(0) if not transcript_path or not os.path.exists(transcript_path): sys.exit(0) messages, tool_calls, user_messages = [], [], [] try: with open(transcript_path) as f: for line in f: line = line.strip() if not line: continue obj = json.loads(line) msg = obj.get("message", {}) role = msg.get("role", "") content = msg.get("content", "") if role == "user": if isinstance(content, str) and len(content) > 10: user_messages.append(content[:200]) elif isinstance(content, list): for b in content: if isinstance(b, dict) and b.get("type") == "text": t = b.get("text", "") if len(t) > 10: user_messages.append(t[:200]) if isinstance(content, list): for b in content: if isinstance(b, dict) and b.get("type") == "tool_use": n = b.get("name", "") if n and n not in tool_calls: tool_calls.append(n) messages.append(role) except Exception: sys.exit(0) if len(messages) < 4: sys.exit(0) # skip trivial sessions entry = { "session_id": session_id, "timestamp": datetime.now().isoformat(), "date": datetime.now().strftime("%Y-%m-%d"), "message_count": len(messages), "tools_used": tool_calls, "last_user_messages": user_messages[-5:], "transcript_path": transcript_path, } try: with open(LOG_FILE, "a") as f: f.write(json.dumps(entry) + "\n") except Exception: sys.exit(0) if __name__ == "__main__": main()
Only logs sessions with 4+ messages — filters out trivial one-off prompts.
~/.claude/settings.json. If you already have a Stop hook (e.g. for the Context Monitor), add the second command inside the same hooks array.{
"hooks": {
"Stop": [
{
"matcher": "",
"hooks": [
{
"type": "command",
"command": "python3 ~/.claude/scripts/session-logger.py"
}
]
}
]
}
}
Already have other Stop hooks? Add the command object to the existing hooks array — don't replace it.
~/.claude/commands/debrief.md. This gives you an on-demand /debrief command you can run anytime mid-session.--- name: debrief description: End-of-session debrief — assess what was done and decide if it should become a skill, rule, automation, or memory user_invocable: true --- # Session Debrief Review what was accomplished this session and extract anything worth capturing permanently. ## Step 1 — Reconstruct the session Look at what was done this session. Identify: - The main task(s) completed - Any corrections or course-changes the user made - Any friction points (wrong approach, wrong format, wasted steps) - Any repeatable workflows that emerged ## Step 2 — Run the four-question check **Is this a new skill?** Did we do something step-by-step and repeatable that the user will want to run again? If yes → write it to ~/.claude/commands/ and add to CLAUDE.md skills table. **Is this a new CLAUDE.md rule?** Did Claude make a mistake the user had to correct? Is there a permanent constraint to encode? If yes → edit CLAUDE.md directly under the most relevant section. **Is this worth automating?** Did we do something repetitive — scanning, reporting, reviewing? If yes → propose a schedule and create a scheduled task. **Is this worth saving to memory?** Did we learn something about the user's preferences, environment, or context? If yes → write to ~/.claude/projects/[project]/memory/ and update MEMORY.md. ## Step 3 — Present findings and build Output a summary, then immediately build anything that got a yes. Don't ask again — just do it. Confirm what was created and where.
## Session Debrief (always do this) At the natural end of any task — when the user says "done", "thanks", "looks good", "that's it", or similar — ask: > "Should this become a skill, rule, or automation? I can build it now." Then assess the completed work for: 1. New skill — repeatable workflow worth a /command 2. CLAUDE.md rule — correction or constraint worth encoding permanently 3. Automation — repetitive task worth scheduling 4. Memory — preference or context worth saving for future sessions If any answer is yes, build it immediately. Run /debrief to go deep.
Combine with the scheduled auto-debrief task for full coverage — explicit end signals + passive background capture.