Fix: session-start preview shows most recent state instead of oldest (#43)

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 <noreply@anthropic.com>
This commit is contained in:
Donchitos
2026-05-02 20:47:53 +10:00
committed by GitHub
parent 9a4243b373
commit a1697d670e

View File

@@ -62,8 +62,8 @@ if [ -f "$STATE_FILE" ]; then
echo "A previous session left state at: $STATE_FILE" echo "A previous session left state at: $STATE_FILE"
echo "Read this file to recover context and continue where you left off." echo "Read this file to recover context and continue where you left off."
echo "" echo ""
echo "Quick summary:" echo "Quick summary (last 20 lines):"
head -20 "$STATE_FILE" 2>/dev/null tail -20 "$STATE_FILE" 2>/dev/null
TOTAL_LINES=$(wc -l < "$STATE_FILE" 2>/dev/null) TOTAL_LINES=$(wc -l < "$STATE_FILE" 2>/dev/null)
if [ "$TOTAL_LINES" -gt 20 ]; then if [ "$TOTAL_LINES" -gt 20 ]; then
echo " ... ($TOTAL_LINES total lines — read the full file to continue)" echo " ... ($TOTAL_LINES total lines — read the full file to continue)"