From a1697d670e56d83561c42566532b1af5c7c21622 Mon Sep 17 00:00:00 2001 From: Donchitos <150119193+Donchitos@users.noreply.github.com> Date: Sat, 2 May 2026 20:47:53 +1000 Subject: [PATCH] Fix: session-start preview shows most recent state instead of oldest (#43) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace head with tail so the quick summary surfaces the last 20 lines of active.md — where all skills append their session extracts — rather than the first 20 lines which grow stale as the file accumulates history. Fixes #39 Co-authored-by: Claude Sonnet 4.6 --- .claude/hooks/session-start.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.claude/hooks/session-start.sh b/.claude/hooks/session-start.sh index eba3e16..05687d1 100644 --- a/.claude/hooks/session-start.sh +++ b/.claude/hooks/session-start.sh @@ -62,8 +62,8 @@ if [ -f "$STATE_FILE" ]; then echo "A previous session left state at: $STATE_FILE" echo "Read this file to recover context and continue where you left off." echo "" - echo "Quick summary:" - head -20 "$STATE_FILE" 2>/dev/null + echo "Quick summary (last 20 lines):" + tail -20 "$STATE_FILE" 2>/dev/null TOTAL_LINES=$(wc -l < "$STATE_FILE" 2>/dev/null) if [ "$TOTAL_LINES" -gt 20 ]; then echo " ... ($TOTAL_LINES total lines — read the full file to continue)"