/vault-pkm:pkm-session-endfrom vault-pkm
Captures session work into devlog entries and maintains the project knowledge graph. Run by the pkm-capture agent during session wrap-up.
Ships in vault-pkm. 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.
If you are not the pkm-capture agent, stop here. Dispatch pkm-capture in the background with the user's request (and any focus note) and do nothing else. /vault-pkm:pkm-session-end works the same way, through the agent.
Workflow for session wrap-up, run by the pkm-capture agent. Its capture context supplies the project (Project: line) and the boundary of what to capture (New activity: file); the agent's Step 0 reads both before this workflow begins.
Each Claude Code session has its own note in <project>/development/devlog/. Add one section to it per capture. <project> is the vault path from the Project: line (e.g. 01-Projects/MyApp), without the (via ...) part; <Project> is its last segment, the project folder's name (MyApp). devlog.md is a hub that embeds a table of those notes: never append or write to devlog.md, except to create it once when it is missing (below).
Read the Devlog: line of your capture context and act on its form:
Devlog: <note vault path> (add a section): the session's note exists. Append to it.
Devlog: new note <folder>/<prefix> <Title>.md (session: <id>): no note yet. Replace <Title> with a title of 3 to 6 words (letters, digits, spaces and hyphens) that names the session's work, then create the note:
vault_write({
template: "devlog-session",
path: "<folder>/<prefix> <Title>.md",
frontmatter: { tags: ["devlog"], project: "<Project>", session: "<id>" }
})
Never rename a note later. If vault_write fails with "File already exists", pick another title.
Devlog: unavailable (<reason>); ...: the plugin could not look. Find this session's note first:
vault_query({ folder: "<project>/development/devlog", custom_fields: { session: "<id>" } })
If it returns a note, append to it. Otherwise create one as above at <project>/development/devlog/<YYYY-MM-DD HHmm> <Title>.md, with the current local time as <YYYY-MM-DD HHmm>.
Then append exactly one section at the end of the note (vault_append with no heading):
vault_append({
path: "<note vault path>",
content: "\n## YYYY-MM-DD HH:mm <short heading>\n\n### Summary\n- <what was accomplished>\n\n### Decisions\n- <decisions made, link to ADRs if created>\n\n### Blockers\n- <problems encountered, or \"None\">\n\n### Next steps\n- <what remains>\n"
})
Use the actual local date and time and fill in real content from the session. The short heading says what this capture covers. Keep sections concise but specific. Read back any multi-line vault_append section and fix literal \n sequences left in the text.
Missing hub: if <project>/development/devlog.md doesn't exist, create it once:
vault_write({
template: "devlog",
path: "<project>/development/devlog.md",
frontmatter: { tags: ["devlog"], project: "<Project>" },
variables: { devlog_folder: "<project>/development/devlog" }
})
Wikilinks in devlog sections: Include [[wikilinks]] to tasks, ADRs, research notes, and other vault notes that were completed, created, or significantly updated during the session. For example: - Completed [[task-api-refactor]] or - Decided on caching strategy ([[ADR-003-caching]]). Link only notes that exist in the vault, never repo files or agent memory.
The New activity: file from the capture context is the boundary for what counts as this capture: a condensed transcript of the session since the last capture. Capture only work that appears in it, plus any earlier activity file the delegation prompt names (the range a failed capture missed), which is inside the boundary too. The activity log is a discovery aid for files you may have missed, not a scope definition.
If the capture context says New activity: unavailable, fall back to the activity log for this session plus git log and git diff --stat.
Query the activity log to find files touched:
vault_activity({ limit: 1 })
The response header shows current session: <id> (an 8-character prefix). Filter to the same session for full file history:
vault_activity({ session: "<id-from-header>", limit: 50 })
Cross-reference the touched files against the new-activity file. Files that never appear in it, or that earlier devlog entries already cover, are not yours to capture again.
Review the new activity for significant work that only exists in chat history. Most exchanges produce nothing worth capturing beyond the devlog entry in Step 1. When in doubt, don't capture — a missed capture is better than vault noise.
Skip entirely if the session was purely mechanical (config changes, minor fixes). A small docs-only or mechanical change gets the devlog entry only: no task note just to track a PR awaiting review.
Notes already written during the session are not created again. Check they read cleanly and link them from the devlog entry.
For each PKM-worthy item independently, determine whether to update an existing note or create a new one:
For each item, search the vault:
vault_semantic_search({ query: "<topic/title>", limit: 5 })
If it is unavailable or returns an error (for example, a disabled index), use vault_search with key terms + vault_query with matching tags.
Route based on results. Read scores on the compressed scale described in the vault_semantic_search tool description.
vault_read and confirm it's actually about the same topic before routing — a 0.5 score can be a real duplicate or a same-domain neighbor. If same topic: go to 3b (update). If neighbor: go to 3c (create with links).When a note already covers this topic, enrich it rather than creating a duplicate:
vault_read the existing note to understand its current contentvault_append to add new findings, with a date-stamped section if the note uses chronological entriesvault_edit to update outdated information (e.g., refining a decision's rationale, adding a new root cause to a troubleshooting log)vault_update_frontmatter to update status or other metadata if changedvault_suggest_links to discover new connections worth addingFollow the pkm-write skill workflow for duplicate checking, template selection, location (its table lists every content type) and linking. <project> is the vault path from the capture context's Project: line.
When a task's status, priority, or details changed during the session:
vault_query({ type: "task", custom_fields: { project: "<Project>" } }) to find the taskvault_update_frontmatter to update status/priorityvault_append to add context about what changedvault_add_links resolves target by file basename only — #heading suffixes in target are not parsed and the call will fail with not found. To link to a specific session section, use vault_append to add an inline wikilink in the task body. Use the note's path under the devlog folder (<project>/development/devlog/<note name>) rather than the bare basename, since vaults can have several notes with similar names:
vault_append({
path: "<task-path>",
content: "\n**Status change**: pending → done on YYYY-MM-DD HH:mm. See [[<project>/development/devlog/<note name without .md>#YYYY-MM-DD HH:mm <short heading>]] for the session that completed this."
})
Substitute the actual project path, note name and the section heading from Step 1. This produces a clickable heading-anchored backlink that Obsidian renders correctly. Bidirectional traceability: the devlog section links to the task (Step 1), the task body links back to the specific session section.Read back each note created in Step 3 using vault_read. Verify:
Fix any issues with vault_edit. If a note is entirely placeholder text, delete it with vault_trash — an empty note is worse than no note.
Run a targeted link health check on files touched during this session:
vault_link_health({ folder: "<project-folder>", checks: ["orphans", "broken"] })
Act only on notes this session touched. For any orphan notes found (no connections), add links using vault_add_links. Broken links (pointing to non-existent files) may self-resolve if the missing notes were created earlier in this session — confirm a "broken" target is really missing before changing anything, and otherwise note it for manual review. For deeper audit (weak connections, ambiguous links, full vault scan), delegate to the link-auditor agent separately.
Check and update if changed during the session:
_index.md: add links to new ADRs under ## Architecture Decisions and update Current Status in place. Add no other links.What SKILL.md sets; muted values are Claude Code's defaults
6 skills in this plugin
/add-taskUse when you want to quickly capture a new task in the vault from a title, with optional priority and due date./pkm-exploreUse when researching what the vault knows about a topic — performs graph + semantic exploration with gap analysis to map existing knowledge and find missing connections. Primarily used via the vault-explorer agent. Not for routine session-start context loading (hooks handle that)./pkm-writeUse when creating a new note in the vault: checks for duplicates, picks the template and location, fills it in and links it into the graph./tackle-taskUse when starting work on a specific vault task, when a task title or path is mentioned, or when coming from triage output./triage-tasksUse when you want to review and batch-update open vault task statuses for the current project or across all projects.Generated from the plugin's indexed repository (adrianv101/obsidian-pkm-plugin) — no native marketplace selected
npx claudepluginhub p/adrianv101-obsidian-pkmOther plugins' skills for the same job