End the current session: log what was done, update tasks, commit.
Resolve the journal path:
JORNAL="${JORNAL:-$HOME/para/areas/dev/gh/ak/journal}"Get today's date and time (date +%Y-%m-%d,
date +%H:%M). Derive the log path:
$JORNAL/areas/log/YYYY/YYYY-MM/YYYY-MM-DD.md
If the log file does not exist, create it with the daily log template:
# YYYY-MM-DD
## Focus
- what the day is about
## Log
## Tasks created
## DecisionsDetect the project slug from the current working directory (same
logic as /next):
git remote get-url origin 2>/dev/null | sed 's/.*\///' | sed 's/\.git$//'Fall back to basename $PWD, or general if
in $HOME.
Check $JORNAL/workqueue.md for entries matching the
detected slug across all dates — not just today. Match
lines of the form
^## \d{4}-\d{2}-\d{2} \d{2}:\d{2} — <slug>$ (line-end
anchor; slug must match exactly, not as substring). Each matching block
runs from that ## line to the next ---
separator. If entries exist, load them as prior-session context for the
synthesis in step 6.
Review the full conversation history (plus any workqueue entries from step 5) and write a concise session summary covering:
Append the summary to the ## Log section of today's
daily log. If ## Log does not exist in the file, append the
section header before the entry. If workqueue entries were present (step
5), N = count of workqueue entries + 1 (current session). Use the
multi-session heading:
### Sessions HH:MM (<slug> — N sessions)
- synthesized bullet points
- **Arc:** what changed across the sessions
- **Next:** what to pick up next time (if applicable)
Otherwise use the standard heading:
### Session HH:MM (<context>)
- bullet point summary entries
- **Next:** what to pick up next time (if applicable)Update project/area files if tasks were completed or created:
[x][ ][~] waiting items## Notes with decisionsIf any tasks or follow-ups came up that aren't in a project/area,
add them to inbox.md.
If workqueue entries for this slug were incorporated (step 5),
remove them from $JORNAL/workqueue.md. Removal
algorithm:
^## \d{4}-\d{2}-\d{2} \d{2}:\d{2} — <slug>$ exactly
(line-end anchor prevents journal from matching
journal-redesign).---
separator following the header.# Work Queue) and its
description + opening --- are never
removed.Commit:
cd "$JORNAL" && git add workqueue.md inbox.md areas/log/ projects/ areas/ && git commit -m "log: YYYY-MM-DD session notes"workqueue.md does not exist or has no entries for
this slug, proceed as a normal single-session close.