Skip to main content

session-to-obsidian

CI PyPI Python License: MIT

Turn a Claude Code or GitHub Copilot Chat session into an Obsidian note that is organized by topic, easy to browse, good for writing from, and useful as a memory layer your AI can recall after a context compaction.

繁體中文說明見 README.zh-TW.md.

Not a verbatim log dump. It splits one session into coherent topic threads (not time slices). Under each topic: what you asked + the assistant's full narrative + the tools/files/screenshots involved, with a table of contents on top — plus a cross-session INDEX.md.

Why

One AI coding session often does several unrelated things (fix a bug, tweak some UI, detour into something else). Later you want to find "how did I solve that thing" — and a timeline is useless, because what you remember is the topic, not the timestamp. This tool uses an LLM to cluster steps into topics so the note is organized the way you remember it.

The first audience is the author's own future self (a tool you keep using); open source is a bonus.

Install

pipx install session-to-obsidian

Topic clustering calls your local claude CLI (Claude Code) in headless mode — no API key, uses your existing subscription. No Claude Code? It still works, clustering just degrades to time-slicing (see below).

Usage

# A Claude Code session (jsonl lives in ~/.claude/projects/<proj>/<uuid>.jsonl)
s2o import ~/.claude/projects/myproj/abc123.jsonl --vault ~/Obsidian

# A Copilot Chat session (VS Code's chatSessions/<uuid>.jsonl append-log)
s2o import "~/…/workspaceStorage/<hash>/chatSessions/<uuid>.jsonl" --vault ~/Obsidian

# Output language (labels + generated titles). Default: en
s2o import <file> --vault ~/Obsidian --lang zh-TW

# No LLM — pure time-segmentation (offline / no Claude Code)
s2o import <file> --vault ~/Obsidian --cluster time

# Rebuild the index only
s2o index --vault ~/Obsidian

Source (Claude native / Copilot append-log) is auto-detected. Output goes to <vault>/90-Meta/sessions/<date>-<source>-<title>/ with a .md (recap) and .canvas (topic-grouped node graph). Set S2O_VAULT to skip --vault; S2O_LANG to set a default language. Re-importing the same session replaces the previous note (deduped by an originSessionId stored in frontmatter). When a session has continued since the last import, s2o keeps its folder name and existing topic grouping and only clusters the new steps, so topic names stay stable across syncs; with no new steps it makes no model call at all. Use --recluster to re-cluster the whole session, or --rename to rename the folder from the new title.

How it works

detect source → adapter restores steps → extract "ask + files + first-line gist"
   → cluster (LLM) → render .md/.canvas → update INDEX.md

Clustering only feeds the LLM the ask list + each step's touched filenames + the assistant's first line (never the full transcript), so token use is bounded. Compound asks go to their dominant topic; topics may be non-contiguous in time; each step keeps its original number.

Limitations

  • Topic clustering needs the local claude CLI (Claude Code). Without it, use --cluster time.
  • Images are not extracted by default (--images to enable). By Obsidian convention images live under _attachments/ (gitignore them; sync via Syncthing to avoid bloating git).
  • Topic names / titles are LLM-generated; quality depends on the model. Re-run a single session to regenerate.

Development

pip install pytest -e .
pytest

License

MIT — see LICENSE.

Metadata

Release files for session-to-obsidian 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for session-to-obsidian 0.3.0
File Size Uploaded
session_to_obsidian-0.3.0.tar.gz 34.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for session-to-obsidian 0.3.0
File Interpreter ABI Platform
session_to_obsidian-0.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 61.8 kB

Release files / session_to_obsidian-0.3.0.tar.gz

Download URL session_to_obsidian-0.3.0.tar.gz
Size 34.7 kB
Tags Source
SHA-256 checksum
How to use checksums
35eeac38586380c97495ea7e3f82859e71e0c6a9806418f1d7a43d217b20df14
BLAKE2b-256 checksum
How to use checksums
ed3cbe7c41afa2143f6afc3494c637828f1a5c04425557fb6c4e438df71cff98
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 13, 2026.

Transparency log

Release files / session_to_obsidian-0.3.0-py3-none-any.whl

Download URL session_to_obsidian-0.3.0-py3-none-any.whl
Size 27.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b4ced7acd710ff5df3bf3fa9a0ec0724553430bac0ea141580a3e132ae2c4f1c
BLAKE2b-256 checksum
How to use checksums
943e1a9796b94d40473dda5791724e3f69532687b53883a13b375e3067260105
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 13, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page