Close Session
End the current session: log what was done, update tasks, route durable knowledge to ~/.whisper/, commit and push, clear context.
Uses $JOURNAL_PATH for the daily log journal, and ~/.whisper/ for accumulated operational knowledge. Agent shells run non-interactive and never source .bashrc, so the environment may be missing these exports — resolve both values per step 1 (env → shell config → convention → legacy fallback).
Steps
Pull the journal repo:
# Non-interactive shells never source .bashrc, so $JOURNAL_PATH etc. are # usually unset here. Source the config in a throwaway shell — bash itself # handles comments, quotes, and nested vars ($JORNAL) — then fall back. shellval() { bash -c 'source ~/.bashrc >/dev/null 2>&1; printf "%s\n" "${'"'$1'"'}"' 2>/dev/null; } JOURNAL="${JOURNAL_PATH:-$(shellval JOURNAL_PATH)}" [ -n "$JOURNAL" ] || JOURNAL="$(shellval JORNAL)" [ -n "$JOURNAL" ] || JOURNAL="$HOME/para/areas/jornal" # JORNAL convention [ -d "$JOURNAL/.git" ] || JOURNAL="$HOME/dev/status" # legacy clone; flag this fallback in the reply LOG_SUBDIR="${JOURNAL_LOG_SUBDIR:-$(shellval JOURNAL_LOG_SUBDIR)}" [ -n "$LOG_SUBDIR" ] || LOG_SUBDIR="areas/log" cd "$JOURNAL" && git pullGet today's date and time (
date +%Y-%m-%d,date +%H:%M). Derive the log path:$JOURNAL/$LOG_SUBDIR/YYYY/YYYY-MM/YYYY-MM-DD.mdIf the log file does not exist, create it with the daily log template.
Review the full conversation history and write a concise session summary covering:
- What was worked on (key topics, files, repos)
- Decisions made
- Tasks completed or created
- Any unresolved items or next steps
Append the summary to the
## Logsection of today's daily log:### 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:
- Mark completed tasks
[x] - Add new tasks as
[ ] - Add/update
[~]waiting items - Update
## Noteswith decisions
- Mark completed tasks
If any tasks or follow-ups came up that aren't in a project/area, add them to
inbox.md.Route durable knowledge to
~/.whisper/. Scan the session for anything worth keeping and route by scope (skip this step entirely if nothing durable was learned):- Branch-specific finding →
bd note <beads-epic>or~/.whisper/repos/<repo>/branches/<slug>/notes.md - Repo-wide infra fact →
~/.whisper/repos/<repo>/env.md - Universal agent behavior rule →
bd rememberor~/.whisper/rules.md - Worktree setup fact →
~/.whisper/repos/<repo>/worktrees/<name>/env.md - No secrets anywhere: never write tokens, keys, or PII
- Extend, don't duplicate: append to existing notes rather than creating new ones
- Branch-specific finding →
Commit and push. Stage only the files this session touched, explicitly by name:
cd "$JOURNAL" && git add <log-file> [<files>] && git commit -m "log: YYYY-MM-DD session notes" && git pushAs the very last step, run
/clearto reset the conversation context.
Rules
- Do NOT ask the user any questions. Summarize automatically from conversation context.
- Keep the summary concise — bullet points, not paragraphs.
- If today's log already has content, append to it; never overwrite existing entries.
- Always pull before reading and push after committing.