log-session
Skill23 starsChanged 50 days agoMITView on GitHub
Append a structured entry to the project's session log (`docs/LOGS.md`): what was done this session, files touched, decisions taken, and the next step — so the next session (or another person) can pick up the thread without re-reading git history. Run it before `/clear`, before closing your agent session, or at any natural stopping point. Model-agnostic: the skill inherits whatever model and effort your agent session is already using. Triggers: "log this session", "log-session", "write a session log", "journal what we did", "record this session before I clear", "save the session summary".
3 other projects use a version of this.
Adopted by
Most recently taken up by
- thiagofinch/mega-braintheir own version, first seen Oct 8, 2026
- Faaz17/Agents-and-Skillstheir own version, first seen Sep 8, 2026
- jmarek41/surf-guidetheir own version, first seen Jul 24, 2026
Other versions3 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 3
- thiagofinch/mega-brain★ 95same name
- Faaz17/Agents-and-Skills★ 1same name
- jmarek41/surf-guide★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository30 other files it gives its agents.
- AGENTS.mdAGENTS.md
- template/AGENTS.mdAGENTS.md
- audit-docsSkill
- audit-prSkill
- batch-schedulerSkill
- discover-repository-stateSkill
- execute-phaseSkill
- fold-findingsSkill
- init-workspaceSkill
- orchestration-envelopeSkill
- phase-contractSkill
- pre-execution-reviewSkill
- product-auditSkill
- resolve-repository-stateSkill
- review-a11ySkill
- review-brandSkill
- review-changeSkill
- review-codeSkill
- review-debtSkill
- review-designSkill
- review-implementationSkill
- review-perfSkill
- review-securitySkill
- review-seoSkill
- review-verifySkill
- skill-lintSkill
- triage-issueSkill
- unit-laneSkill
- verification-contractSkill
- workflow-statusSkill
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 3 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 76
If a session-start marker exists (.claude/.session-*.start, written by the template's SessionStart hook), read it to bound the session …
- Very specific: line 83
If a marker is present, the session spans marker_sha..HEAD plus any uncommitted work.
- Distinctive: line 184
One file, append-only: Don't fan session logs across files.
- Distinctive: line 195
Run it before ending every session, and bound the session with git alone (Process step 1's no-marker path).
- Distinctive: line 212
Not part of the PR gate — it's a working-memory aid, not a merge artifact.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Log Session
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 (qwen3.6/reasoning_config: none — unlimited; the NaN
cluster models carry no token counter, so this skill pays in bytes, not
quota): structured summarization, not judgment. It must never reach for an
expensive model.
Turn contract — verify before ending the turn
✓ 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)
✓ `bun scripts/session-close.mjs close` RAN and exited 0 (or 2, with the leftover paths named) — the entry is committed, not left riding along
✓ No past entry was edited
✓ Artifact language: explicit user instruction > the project's declared docs language > English. The CONVERSATION language never decides — a Spanish prompt still produces English PRs/issues/commits/SPECs unless one of the first two says otherwise
✓ The closing `→ Next:` block is printed as the ABSOLUTE last outputAbout 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).
Two doors, one behaviour (#429)
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.
When to use
- Before
/clear(or your agent's context-reset equivalent) — you're about to wipe context; capture it first. - Before closing your agent for the day.
- At a natural stopping point — a feature paused mid-way, a thread you want to be able to resume cold.
- After a long session with several decisions worth remembering.
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.
Step 0 — Discover the project (always first)
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.
Process
- Establish the session boundary.
- If a marker is present, the session spans
marker_sha..HEADplus any uncommitted work. - Otherwise, use your own conversation context as the source of truth for
what happened this session, and corroborate with
git logof the recent commits andgit status/git diff --statfor uncommitted changes.
- If a marker is present, the session spans
- Gather the mechanical facts (cheaply, with git):
- branch (
git branch --show-current), - commits this session (
git log --oneline <since>..HEAD), - files touched (
git diff --stat <since>..HEAD+ uncommitted).
- branch (
- Write the narrative — the part only you can add:
- Summary: 1–3 sentences on what this session set out to do and what actually got done.
- Decisions: the non-obvious choices made and why (the rationale that would otherwise be lost). Link related docs/issues.
- Next: the concrete next step(s) — the command to run, the unfinished thread, the open question. Write it so a cold reader knows exactly where to resume.
- Status words are forge-verified.
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:
bun scripts/session-close.mjs 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 todocs/LOGS.md(the aggregator owns that file):agentic-workflow 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, and never overwrites — the filename is never composed here. Grammar:
journal-fragment-grammar@1+journal-write-grammar@1in@gtrabanco/agentic-workflow's README; long prose:… render … | … journal write --kind narrative --content -.
Omit
--decisions/--nextwhen 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.- No fragment carrier (the default): append to the end of
Close the session — commit the entry and prove the tree is clean:
bun scripts/session-close.mjs closeIt refuses unless the entry was written the way the project opted in —
docs/LOGS.mdappended to (a rewritten or truncated log is not a session entry), or, in fragment mode, new fragments added under.agentic-workflow/journal/withdocs/LOGS.mduntouched — commits that surface alone asdocs(log): <the appended summary>, and reports every path still uncommitted: exit0clean,2the named leftovers are still dirty,1refused. Do not open a PR just for a log entry, and nevergit add -Ahere — a concurrent conversation's work must not be swept into a log commit.
The canonical split — this skill's half (feature 66, D2)
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.- Engram (
mem_session_summary, and the lane'sunit/<NN-slug>/doctopic) is local decision and gotcha recall keyed by unit id, written byunit-laneandexecute-phaseat 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.
Guardrails
- Never use an expensive model for this. It's summarization;
qwen3.6(reasoning_config: none→ zero thinking tokens) is the natural ceiling on the cluster plan, and the hooks do the free mechanical version. - Don't invent facts. Decisions and next steps come from the actual session (your context + git), not plausible-sounding filler. If a section has nothing real, omit its line rather than padding.
- Append, never rewrite. Past entries are a historical record — don't edit or "tidy" them. Same reasoning as not rewriting a delivered feature's planning artifacts.
- One file, append-only. Don't fan session logs across files.
Portability (agents other than Claude Code)
The workflow is the contract; Claude Code features are conveniences. On an agent that lacks one, apply the fallback — never skip the step the feature enables:
- No Claude Code hooks — the template's auto-logging hooks (SessionStart marker, SessionEnd entry) don't run on other agents, so there is no marker file and no free mechanical entry: this skill is the only journal writer. Run it before ending every session, and bound the session with git alone (Process step 1's no-marker path).
- No
/clear— read it as your agent's context-reset / new-conversation equivalent, in the triggers and in the closing block alike. - No per-skill
model:/effort:— the intent stands: use the cheapest available model for this. It's summarization, never judgment. On NaN the cluster models (qwen3.6, gemma4) carry no token counter — setreasoning_config: noneso the append pays zero thinking tokens.
Relationship to other skills
- Complements the
template/'s SessionEnd hook (free, mechanical, automatic on/clearand exit) and the opt-in SessionStart restore hook (re-injects the last entry to resume context). This skill is the rich, manual entry. - Pairs with
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. - Not part of the PR gate — it's a working-memory aid, not a merge artifact.
Done when
- 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
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

