Session Summary
Capture the key outcomes of this Claude Code session into a markdown file in the Obsidian vault, and link it from today's daily note.
Steps
- Resolve vault path
Run echo $OBSIDIAN_VAULT_PATH to get the Obsidian vault root directory. If empty, ask the user for the path before proceeding.
- Gather metadata
-
Date: Use today's date (YYYY-MM-DD format)
-
Branch: Run git branch --show-current in the current working directory
-
Repo: Derive from the working directory (e.g. olivoil/obsidian from /home/olivier/Code/github.com/olivoil/obsidian )
-
Session ID: Find the most recently modified .jsonl file in the project's .claude/projects/ directory. Extract the UUID from the filename (the part before .jsonl ) and use the first 8 characters.
- Generate the summary
Review the full conversation and extract:
-
One-line summary: A single sentence describing what was accomplished
-
Decisions: Key decisions made during the session (bullet list)
-
Open questions: Unresolved items or things that need further investigation (bullet list)
-
Follow-ups: Next steps or tasks to do later (checklist with - [ ] )
-
Files changed: Run git diff --name-only $(git merge-base HEAD main)..HEAD 2>/dev/null || git diff --name-only HEAD to get changed files on this branch. If there are unstaged changes, also include output from git diff --name-only and git diff --name-only --cached . Deduplicate the list.
If a section has no items, omit it entirely.
- Write the session file
Path: $OBSIDIAN_VAULT_PATH/Coding/{date}--{repo-name}--{branch}.md
Use just the repo name (e.g. om-skills from olivoil/om-skills ). If the branch name contains / , replace them with - (e.g. feature/foo becomes feature-foo ).
If a file already exists at that path (same branch, same day), append a counter: {date}--{repo-name}--{branch}--2.md , {date}--{repo-name}--{branch}--3.md , etc.
Format:
date: {date} branch: {branch} repo: {repo} session: {session-id}
Session: {branch}
{one-line summary}
Decisions
- Decision 1
- Decision 2
Open Questions
- Question 1
Follow-ups
- Task 1
- Task 2
Files Changed
- path/to/file1.ts
- path/to/file2.md
- Link from the daily note
Path: $OBSIDIAN_VAULT_PATH/Daily Notes/{date}.md
If the daily note doesn't exist, create it.
Look for an existing ### Coding Sessions section. If found, append the new link under it.
If not found, insert a new ### Coding Sessions section. The daily note typically has this structure:
-
Hours list (lines like - [[Project]] - task - duration )
-
Done today (### Done today — dataview or plain markdown of completed tasks)
-
Open todos (### Open todos — dataview query of unchecked project todos)
-
Coding Sessions ← insert here
-
Journal (### Journal — timestamped entries)
-
Other notes sections (e.g. ### [[Technomic]] , ### [[Khov]] , etc.)
To find the right insertion point: look for the first --- horizontal rule or ### heading that comes after the ### Open todos section. Insert the Coding Sessions block just before it. If there's no ### Open todos , look after ### Done today . If neither exists, insert before the first ### heading. If there are no other sections at all, append to the end.
The block to insert:
Coding Sessions
- [[{date}--{repo-name}--{branch}]] - {one-line summary}
If the section already exists, just append the new bullet:
- [[{date}--{repo-name}--{branch}]] - {one-line summary}
- Confirm
Tell the user:
-
The path of the created session file
-
That the daily note was updated
-
A brief preview of the summary