Skip to main content
devin-history

tests

OpenSSF Scorecard License: MIT Python 3.10+ GitHub stars Last commit devin-* ecosystem PRs welcome

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 — after devin-search, before devin-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 by devin-internals-spec.
  • This project ports two proven scripts that lived in the orchestrator workspace (legacy/): devin-history-export.py (DB → Obsidian notes) and audit_sessions.py (lifetime audit → CSV + report). They are rewritten as library modules — same logic, real tests.
  • You can also just run sqlite3 queries 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: metadata notes (slug, workspace, folders, lastUpdated) +
# index.json — the GUI keeps no local transcript, so metadata is all there is
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.db schema v15–v17 is accepted; anything newer fails loudly rather than misreading (update devin-internals-spec first).
  • Opaque payloads. chat_message and tool_call_*_json inner 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 are metadata-only. export-gui exports the session↔workspace bindings kept in state.vscdb (slug, label, folders, timestamps) — the GUI stores no transcript locally. GUI transcripts under User/acp-messages/*.db, session locks and log correlation are planned for M2.
  • 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-search on top of the same database.
  • You need GUI session transcripts — export-gui exports the metadata bindings in state.vscdb; the acp-messages/*.db transcript stores are M2.
  • Your sessions.db schema is newer than v17 — the tool refuses loudly instead of misreading it; update devin-internals-spec first.

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.1

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

Source distribution (sdist)

Source distribution for devin-history 0.1.1
File Size Uploaded Provenance Actions
devin_history-0.1.1.tar.gz 46.3 kB With provenance Details for devin_history-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for devin-history 0.1.1
File Interpreter ABI Platform Actions
devin_history-0.1.1-py3-none-any.whl Python 3 none any Details for devin_history-0.1.1-py3-none-any.whl

Total release size: 79.6 kB

Release files / devin_history-0.1.1.tar.gz

Download URL devin_history-0.1.1.tar.gz
Size 46.3 kB
Tags Source
SHA-256 checksum
How to use checksums
93cf58aa2e21d6b491d4b669277f18d7e1262ce05f1e62f43fdded952176e646
BLAKE2b-256 checksum
How to use checksums
ce0191ba53b957855559eb049c32ddcf06e3909941f148cf85e54831fa341c10
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 20, 2026.

Transparency log

Release files / devin_history-0.1.1-py3-none-any.whl

Download URL devin_history-0.1.1-py3-none-any.whl
Size 33.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ad35d7d20bd6e3201c4539a37eb61e167c5b429014f0d2ab68d9bc40e2a9697c
BLAKE2b-256 checksum
How to use checksums
40f5f2b950b2999e7ce02300be373b3b78fc1517b7d3b3b71a3aa5662dfbbdb4
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 20, 2026.

Transparency log

Security for devin-history 0.1.1

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.

Select from 2 files

Attestation for devin_history-0.1.1.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 20, 2026.

Transparency log

A 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.

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