/agentic-workflow:log-session [note to prepend to the entry]from agentic-workflow
Writes a structured session log entry recording what was done, files touched, decisions made, and next steps. Run before clearing or closing a session to preserve context without re-reading git history.
Ships in agentic-workflow. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Capture the why and the what-next of a working session — the context that git history alone never records. A commit says what changed; a session log says what you were trying to do, what you decided, and where to resume.
Deliberately cheap (use the cheapest available model, with reasoning/thinking off where the provider allows it — a quota-free tier when the plan offers one, so this skill pays in bytes, not quota): structured summarization, not judgment. It must never reach for an expensive model.
Load and verify the canonical Turn contract (11 boxes) before ending every turn; the entry write itself is the skill-specific commit box — the fragment carrier (issue #405) and the two-doors flow (#429) own where the entry lands, not an inline contract. Skill-specific additions (the docs-language and → Next: boxes are canonical-owned and not restated here):
✓ The entry was WRITTEN with accurate git facts: appended to docs/LOGS.md, or — when the fragment carrier `.agentic-workflow/journal/` exists (issue #405) — written as a new fragment there (the aggregator owns the journal; a direct append is refused)
✓ `runner session-close close` RAN and exited 0 (or 2, with the leftover paths named) — the entry is committed, not left riding along
✓ A stale entry, when one existed, was CORRECTED through `journal write --supersedes <fragment>` — never edited and never deleted; an entry already in `docs/LOGS.md` is a new append, because the journal is append-only
Missing reference → STOP. About to end the turn with any box unchecked? The turn is NOT done — complete the missing box first (weak models drop end-of-document duties; this list is first on purpose).
With @gtrabanco/pi-agentic-workflow loaded, /log-session is a command: the
handler records the invocation (.pi/.session-<id>.log-session), runs the writer
below and names the entry's exact target before this file reaches you; a settled
turn with no entry there is reported. The record is code's fact, the prose is
yours. Without the extension, or via /skill:log-session, every step below is
yours.
/clear (or your agent's context-reset equivalent) — you're about
to wipe context; capture it first.This is the manual, rich counterpart to the lightweight auto-logging hooks
the template/ ships (see template/.claude/). The hooks capture the
mechanical facts for free on every exit; this skill writes the thoughtful
entry when you want one.
Per the agent guide's Workflow conventions + documentation map, locate
the session log. Default path: docs/LOGS.md. If the documentation map names a
different location, use that. If no log file exists yet, create it from the
shape in template/docs/LOGS.md (a short header + the entry format below) and
say so.
If a session-start marker exists (.claude/.session-*.start, written by the
template's SessionStart hook), read it to bound the session precisely — it holds
the HEAD sha and start time at session open.
Establish the session boundary.
marker_sha..HEAD plus any
uncommitted work.git log of the recent
commits and git status / git diff --stat for uncommitted changes.Gather the mechanical facts (cheaply, with git):
git branch --show-current),git log --oneline <since>..HEAD),git diff --stat <since>..HEAD + uncommitted).Write the narrative — the part only you can add:
merged, closed, approved — any
claim about a PR/issue state is checked with the forge in the same turn
(gh pr view <N> --json state,mergedAt) before it is written. A log that
records a state the forge contradicts is a false record that the next
review must chase (fix #157's F14). Write the actual state: "PR #N open,
awaiting the human merge".Render and write the entry — the mechanical facts (timestamp, branch, commit count and range, files touched) are computed for you:
runner session-close render --summary "<what this session did>" \
--decisions "<key choices + why>" --next "<the concrete next step>"
It writes nothing: apply its output where the project opted in —
No fragment carrier (the default): append to the end of
docs/LOGS.md (append-only, chronological) with your editing tool.
Fragment carrier (.agentic-workflow/journal/ exists — issue #405):
hand the entry to its writer, never to docs/LOGS.md (the aggregator
owns that file):
runner journal write --kind narrative --summary "<summary>" \
--decisions "<choices + why>" --next "<next step>" [--session <id>]
It computes the timestamp, branch and name, renders the block, refuses
bytes the aggregator could not read, never overwrites, and refuses a
second entry of the same kind from a session that already registered one
(already registered — one entry per conversation per kind; re-running
this skill in the same conversation is the case it stops, while the
auto-log's mechanical entry is the same conversation's other kind and
does not block it) — the
filename is never composed here. Grammar:
journal-fragment-grammar@1 + journal-write-grammar@1 in
@gtrabanco/agentic-workflow's README; long prose: … render … | … journal write --kind narrative --content -.
The entry went stale mid-session (push state, gate verdict or merge
state moved since it was written): correct it, never edit it —
log-immutability refuses a fragment edit or delete and the journal is
append-only. Re-run the same writer with
--supersedes <the fragment it corrects>: it lands the correction as a
NEW fragment whose block names the one it corrects, the lint reads the
pair as one entry plus its correction, and the aggregator lands the
correction once. The already registered refusal names that flag when you
forget it. Once the entry is already in docs/LOGS.md there is no
fragment left to name — a new entry is the append the journal allows.
Omit --decisions / --next when there is nothing real to record — the script drops the line
rather than emitting an empty one. A user-supplied note is prepended to the
Summary.
Close the session — commit the entry and prove the tree is clean:
runner session-close close
It refuses unless the entry was written the way the project opted in —
docs/LOGS.md appended to (a rewritten or truncated log is not a session
entry), or, in fragment mode, new fragments added under
.agentic-workflow/journal/ with docs/LOGS.md untouched — commits that
surface alone as
docs(log): <the appended summary>, and reports every path still uncommitted:
exit 0 clean, 2 the named leftovers are still dirty, 1 refused. Do not
open a PR just for a log entry, and never git add -A here — a concurrent
conversation's work must not be swept into a log commit.
Two writers exist on purpose; neither mirrors the other:
docs/LOGS.md (this skill) is the human/team journal — what a session
set out to do, what it decided, where to resume. It travels with git, so a
teammate or a fresh clone reads it with no local state.mem_session_summary, and the lane's unit/<NN-slug>/doc topic)
is local decision and gotcha recall keyed by unit id, written by
unit-lane and execute-phase at unit boundaries. It stays on the machine.Engram never mirrors this log, and this log never mirrors Engram: team memory
travels with git, agent recall stays local. Write the journal half here; the
protocol half (boundaries, recall order, degradation) lives in the lane's
memory reference, ../unit-lane/references/MEMORY.md.
Preamble: owned by skills/orchestration-envelope/references/PORTABILITY.md — this skill's own fallbacks:
/clear — read it as your agent's context-reset / new-conversation
equivalent, in the triggers and in the closing block alike.model:/effort: — the intent stands: use the cheapest
available model for this. It's summarization, never judgment. Turn
reasoning/thinking off where the provider allows so the append pays zero
thinking tokens; a vendor preset (installed separately) may route this skill
to a quota-free tier automatically.template/'s SessionEnd hook (free, mechanical, automatic
on /clear and exit) and the opt-in SessionStart restore hook (re-injects
the last entry to resume context). This skill is the rich, manual entry.execute-phase's unit doc ## Progress log: that tracks progress
within a unit; the session log is cross-cutting — whatever you touched
this session, across units.A new entry is written the way the project opted in — appended to docs/LOGS.md, or added as a fragment under .agentic-workflow/journal/ — with at least Summary and Next.
The mechanical facts (branch, commits, files) are accurate to git.
The closing → Next: block is printed:
→ Next: /clear (or your agent's context reset) is now safe — the session is captured
· resume later → the command named in the entry's **Next** line
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub gtrabanco/agentic-workflow --plugin agentic-workflow33 skills in this plugin
/agentic-workflow-doctorUser-initiated batch ceremony-failure triage: mine this project's own journal and unit docs for its accumulated ceremony failures, apply a fixed discard/report rubric, render one anonymized bundle, and route it upstream to an existing or new agentic-workflow issue — with consent. Read-only; the user starts it. Triggers: "agentic-workflow-doctor", "aw-doctor", "why do my reviews keep blocking", "triage my ceremony failures", "report a workflow bug upstream".
/audit-docsAudit cross-document coherence: docs ↔ READMEs ↔ roadmap ↔ code ↔ fix index ↔ issues. Finds drift — features in docs/ not in the roadmap (or vice versa), fix-index entries already merged/closed, broken documentation-map links, dependency cycles, artifacts in the wrong language, naming-convention violations, project-charter coverage — and reports them ranked by severity, fixing only low-risk items on request. Model-agnostic: the skill inherits whatever model and effort your agent session is already using. Triggers: "check doc consistency", "are the docs in sync", "audit the docs", "doc coherence review", "did the docs drift", "validate the roadmap".
/audit-prAudit a whole PR against the delivery contract and return MERGE-READY or evidenced blockers with the full URL. Consumes the current review-change REVIEW-PASS receipt instead of re-running review axes; posts a SHA-bound ready comment; never edits or merges. Triggers: "audit-pr", "is this PR ready", "merge gate".
Other plugins' skills for the same job