Part of the DEVIN ecosystem
Track: Understand · Nature: product
For: Local-first ops, End users, Data Scientists
Interface: CLI
Path: Data Scientists · step 3/4 — afterdevin-search, beforedevin-metrics
devin-history
Unofficial community project. Not affiliated with, endorsed by, or sponsored by Cognition AI. "Devin" is a trademark of Cognition AI.
Linux · Personal Windows · Corporate Windows
Part of the awesome-devin ecosystem: the curated hub for the devin-* tools.
Export and audit Devin Desktop session history — turns the local
sessions.db into Obsidian-ready Markdown notes, a searchable JSON dump,
and an audit report. GUI session metadata (state.vscdb) exports as
metadata notes too.
The problem
Devin Desktop keeps your session history in a local SQLite database
(%APPDATA%/devin/cli/sessions.db on Windows, or
$XDG_DATA_HOME/devin/cli/sessions.db on Linux; default
~/.local/share/devin/cli/sessions.db) — and nowhere else. There is no export
button: once a session scrolls out of the UI (or is pruned by the app), the
prompts, replies and tool calls are effectively gone. You can't search old
sessions, can't answer "what did I ask Devin to do last month", and can't
audit how the agent has been used across projects.
Prior art
- tokmesh and UniSessions document/parse
sessions.db; the schema itself is tracked bydevin-internals-spec. - This project ports two proven scripts that lived in the orchestrator
workspace (
legacy/):devin-history-export.py(DB → Obsidian notes) andaudit_sessions.py(lifetime audit → CSV + report). They are rewritten as library modules — same logic, real tests. - You can also just run
sqlite3queries by hand — but then you guess the schema on every Devin update.
What makes it Devin-native
It understands Devin's real stores instead of raw-SQL guessing: it opens
sessions.db through devin-internals-spec's typed parsers and refuses
loudly when the schema version is one it has never seen (the store has
had 17 migrations already). The export knows about hidden sessions,
interrupted threads (last node = user), tool_call_state failures and
epoch-millisecond timestamps — details a generic SQLite dump misses.
Install
Python ≥ 3.10 required; install with uv (recommended) or pipx.
uv tool install devin-history
or with pipx (alternative):
pipx install devin-history
Usage
# quick session table (auto-detects %APPDATA%/devin/cli/sessions.db)
devin-history list
# one Obsidian note per session + index.md — safe to re-run (incremental)
devin-history export --out ~/ObsidianVault/Sessions
# searchable JSON dump instead of Markdown
devin-history export --out dump/ --format json
# audit: status/type/project/period groupings + anomalies, optional CSV
devin-history audit --csv audit.csv
# GUI sessions: session↔workspace bindings + redacted transcripts from
# acp-messages/*.db → one note each + index.json
devin-history export-gui --out ~/ObsidianVault/Sessions/gui
# everything has --json; point at a specific DB with --sessions-db/--vscdb
devin-history audit --sessions-db path/to/sessions.db --json
devin-history export-gui --vscdb path/to/state.vscdb --out gui-notes/
No Devin installed? Try it on a synthetic fixture (stdlib-only, no Devin data involved):
pipx install "devin-internals-spec==0.3.0"
devin-inspect make-fixture /tmp/fx
devin-history export --sessions-db /tmp/fx/cli/sessions.db --out /tmp/notes
Notes are idempotent: each file embeds the session's last_activity
marker, so re-runs skip unchanged sessions (--all forces a rewrite,
--dry-run previews). The index.md/index.json at the root carries a
stats block — total sessions, date span, per-project and user/assistant/tool
message totals — alongside the grouped links.
Every exported note, JSON record and index.json entry carries the
SESSION-EVIDENCE anchor triple from
devin-internals-spec
(docs/SESSION-EVIDENCE.md): surface (devin-cli for sessions.db
sessions, devin-chat for state.vscdb GUI bindings), native_id (the
store's own session id) and ref — the SESSION-SURFACES §4 canonical id
<surface>:<workspace-hash>:native:<id> when a workspace identity exists,
else the ephemeral <surface>:ephemeral:<index> display key (position in
the full ordered listing, stable under --session-id/--since filters).
The workspace hash is sha256[:16] of the normalized seed; the path itself
is never part of the anchor. Notes written by older versions are healed on
the next run — an unchanged last_activity marker without ref is not
treated as up-to-date.
export-gui reads the Electron state.vscdb store (auto-detected under
User/globalStorage/ of the Devin config dir, override with --vscdb)
and writes one note per windsurfSpace.sessionWorkspace/* binding: slug,
label, backend, workspaceId, folders, lastUpdated, and lastAccessed
when derivable via windsurfSpace.resourceToSpace + windsurfSpace.metadata.
It is read-only on state.vscdb, embeds the same provenance
(machine_id/profile), and writes an index.json index.
Works with Devin alone (Devin-only mode)
Everything devin-history does happens on your machine: it reads
sessions.db and writes Markdown/JSON exports to a folder you choose. No
network, no external service — the Obsidian-style note layout is just a
format, Obsidian itself is not required.
One caution for restricted machines: exports contain raw prompts, paths and
commands, which may include secrets. Keep the export folder private, define a
retention rule, and run
devin-redact before sharing an
export.
Platform support
Tested on Windows and Linux (windows-latest + ubuntu-latest in CI).
The CLI session database is auto-detected: %APPDATA%/devin/cli/sessions.db
on Windows and $XDG_DATA_HOME/devin/cli/sessions.db on Linux (default
~/.local/share/devin/cli/sessions.db). A legacy ~/.config/devin location
is also checked. macOS uses ~/Library/Application Support/devin/. Override
with --sessions-db (see Usage). The GUI state.vscdb is auto-detected
under <config>/User/globalStorage/state.vscdb (Devin/devin dir names);
override with --vscdb.
Incremental export from a hook (HI-2 — no daemon)
export --session-id ID exports a single session (unique prefix ok) and
merges its entry into the existing index instead of rebuilding it.
export --from-hook reads {"session_id": ...} from the stdin payload a
SessionEnd hook pipes in — fail-soft (no payload → exit 0, nothing
written). Register once via the hooks dispatcher:
python tools/hooks_dispatch.py register SessionEnd history-export \
"devin-history export --out ~/notes/devin-history --from-hook"
Each ended session then lands as a note automatically; a periodic full
export keeps the index complete.
Limitations
- Schema-gated. Only
sessions.dbschema v15–v17 is accepted; anything newer fails loudly rather than misreading (updatedevin-internals-specfirst). - Opaque payloads.
chat_messageandtool_call_*_jsoninner formats are undocumented and unstable — decoding is best-effort and tolerant, not contractual. - Inferred status. The DB has no final-state column; "completed" /
"interrupted" / "abandoned" are heuristics (see
docs/SPEC.md§4). - No billing. Token/cost data is not stored locally; only
num_tokens_preceding(context size) exists. - GUI sessions export their real transcript, redacted.
export-guireads the session↔workspace bindings instate.vscdb, then correlates each slug withUser/acp-messages/*.dbtranscript stores (meta session-id → filename stem → title). Transcript text is redacted withdevin-redactbefore rendering — a redaction failure means the note is simply not written (andexport-guiexits non-zero), never an unredacted file.--no-transcriptsfalls back to the metadata-only notes;--vscdb noneexports orphaned acp transcripts on their own. audit --fail-on-anomaly Nexits non-zero when the anomaly count reaches N. Anomalies are the three existing audit checks:orphan(rows inmessage_nodes/tool_call_state/prompt_historyreferencing a session absent fromsessions),empty(a session row with no message nodes) andlong-running(active ≥ 480 min). Without the flagauditalways exits 0.- Read-only by design — the tool never writes to Devin's stores.
Development
pip install -e ".[dev]"
pytest
Fixtures are generated at test time by devin_internals.fixtures (real v17
DDL, synthetic rows) — no binary fixtures are committed.
Adapters (MCP server, Devin skill, plugin)
devin_history.mcp_server exposes two tools via the
devin-history-mcp entry point (pip install 'devin-history[mcp]'):
history_list (same JSON as devin-history list --json) and
history_export (same JSON as devin-history export --json — writes
only inside the given out_dir, never to the source stores).
adapters/ is a self-contained Devin plugin root
(adapters/.devin-plugin/plugin.json +
adapters/skills/devin-history/SKILL.md), installed with
devin plugins install Icaro0310/devin-explore#packages/history/adapters — it ships in the
repo, not inside the wheel. The manifest launches the server through
uvx --from 'devin-history[mcp]' devin-history-mcp, which resolves the
published PyPI release — no local install needed. To run the server
from a source checkout instead, install it editable
(pip install -e '.[mcp]') and call devin-history-mcp directly, or
point a local manifest copy at the checkout
(uvx --from './packages/history[mcp]' devin-history-mcp).
MCP host configs
Same stdio server in other hosts — server name devin-history:
Zed — context_servers in ~/.config/zed/settings.json:
{ "context_servers": { "devin-history": { "command": { "path": "devin-history-mcp", "args": [] } } } }
JetBrains AI Assistant — Settings → Tools → AI Assistant → Model Context Protocol → Add:
{ "mcpServers": { "devin-history": { "command": "devin-history-mcp" } } }
Antigravity — ~/.gemini/config/mcp_config.json:
{ "mcpServers": { "devin-history": { "command": "devin-history-mcp" } } }
When to use this
- You want your Devin session history out of the app before sessions scroll away or are pruned — there is no built-in export button.
- You keep an Obsidian vault (or any Markdown folder) and want one note per
session plus an
index.md, idempotent across re-runs. - You need a lifetime audit: groupings by status, task type, project and period, plus anomaly detection (empty, orphan, long-running sessions).
- You want a deterministic, read-only export you can schedule — nothing is ever written back to Devin's stores.
When NOT to use this
- You need instant ranked search rather than a static export — use
devin-searchon top of the same database. - You need unredacted GUI transcripts —
export-guialways runsdevin-redactover transcript bodies; for raw forensics read theacp-messages/*.dbstores directly. - Your
sessions.dbschema is newer than v17 — the tool refuses loudly instead of misreading it; updatedevin-internals-specfirst.
FAQ
What is devin-history? A CLI that exports Devin's local sessions.db
into Obsidian-ready Markdown notes, a JSON dump, or an audit report. It
auto-detects the database on Windows, Linux and macOS and never writes to
Devin's stores.
Is it safe to re-run the export? Yes. Each note embeds the session's
last_activity marker, so unchanged sessions are skipped on re-runs.
--all forces a rewrite and --dry-run previews without writing.
Does it send my session data anywhere? No. Everything happens on your
machine: it reads the local database and writes files to a folder you
choose. Note that exports contain raw prompts and paths — keep the output
folder private or run devin-redact before sharing.
Why does it refuse to read my database? Because the schema version is outside the supported v15–v17 range. The store has had 17 migrations already; devin-history fails loudly on unknown versions rather than silently misparsing your history.
License
MIT — see LICENSE.
Metadata
Release files for devin-history 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| devin_history-0.1.2.tar.gz | 54.2 kB | With provenance | Details for devin_history-0.1.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| devin_history-0.1.2-py3-none-any.whl | Python 3 | none | any | Details for devin_history-0.1.2-py3-none-any.whl |
Total release size: 93.9 kB
Release files / devin_history-0.1.2.tar.gz
| Download URL | devin_history-0.1.2.tar.gz |
|---|---|
| Size | 54.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0dadecf3e185c069f38fc234b1aaa92ebe17de919aa2b97f43260199a09f4b83
|
|
BLAKE2b-256 checksum How to use checksums |
76d96876a2a9ce52fcdf3e0a9c3f51c0d97f8d7c9b7398bb15d741239fa9ac6c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 30, 2026.
Transparency logRelease files / devin_history-0.1.2-py3-none-any.whl
| Download URL | devin_history-0.1.2-py3-none-any.whl |
|---|---|
| Size | 39.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
516a55062574ff2b7fd1ea5e2f7e966db76ba607f2f42399f666fc3d7804f52f
|
|
BLAKE2b-256 checksum How to use checksums |
68094dc0e9ac910371fde30fb8b33269a06e7986f79c633326f959394256a908
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 30, 2026.
Transparency logSecurity for devin-history 0.1.2
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.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for devin_history-0.1.2.tar.gz
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 30, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.