Skip to main content

Turn your Claude Code conversation history into a searchable markdown library + SQLite database

Project description

promptvault

PyPI CI License Stars Python 3.10+ Zero Dependencies

Your Claude Code conversations, searchable forever.


The Problem

Claude Code stores conversations in ~/.claude/history.jsonl — not searchable, not browsable, not persistent. Claude compacts and deletes old sessions without warning.

pv turns that history into a searchable markdown library + SQLite database. Browse in Obsidian, search from the terminal with fzf. Zero dependencies. Pure stdlib.

pv in action


Quick Start

# recommended — fast, isolated, always on PATH
uv tool install promptvault-py

# alternative — same idea, traditional tool
pipx install promptvault-py

pv-sync                        # sync your Claude Code history
pv                             # browse conversations
pv search "database migration" # full-text search

# upgrade to latest version
uv tool upgrade promptvault-py   # or: pipx upgrade promptvault-py

Don't have uv? curl -LsSf https://astral.sh/uv/install.sh | sh (docs)

Don't have pipx? brew install pipx or pip install --user pipx (docs)

Both tools install pv into an isolated virtualenv and symlink the executable to ~/.local/bin/, so it's available globally — no environment activation needed.

pv is the short alias. promptvault / promptvault-sync also work.

Optional: install fzf for the interactive UI (brew install fzf / apt install fzf). Without it, pv falls back to plain text.


How It Works

How pv works

pv-sync reads history.jsonl, groups prompts by conversation, and generates:

  1. Markdown vault — One .md per conversation, YYYY/MM/ structure, YAML frontmatter. Drop into Obsidian.
  2. SQLite database — FTS5 full-text search with BM25 ranking. Millisecond queries.

The sync is idempotent — always rebuilds from source, impossible to reach a bad state. Resolves pasted-text placeholders, deduplicates prompts, filters slash commands, cleans whitespace.


Commands

All commands launch fzf by default (split pane: conversation list + live preview). Add --no-fzf for plain text.

Command Description
pv Browse all conversations interactively
pv search "query" Full-text search ranked by relevance
pv recent [N] Last N conversations (default 20)
pv list [--date DATE] [--project NAME] Filter by date or project
pv stats Vault overview
pv-sync Rebuild vault + database

Controls:

Key Action
Enter Open in $EDITOR (returns to fzf)
Ctrl-O Open in $EDITOR (exits fzf)
Ctrl-T Toggle conversation / prompt view
Ctrl-P Cycle project filter
Ctrl-D Cycle date range (all/today/week/month)
Ctrl-B Toggle bookmark on selected conversation
Ctrl-G Show only bookmarked conversations
Ctrl-Y Copy to clipboard
Ctrl-E Export to file (save dialog)
Ctrl-X Exclude from results
Ctrl-/ Toggle preview
Tab Multi-select
Esc Quit

Full documentation: docs/usage.md


Shell Widget

Insert a previous prompt directly into your command line with Alt-P:

# Add to your shell config:
eval "$(pv shell-init zsh)"    # or bash

Customise the key with PROMPTVAULT_WIDGET_KEY (default: \ep = Alt-P).


Real-Time Capture

A Claude Code hook captures prompts the moment you send them — no sync needed.

Add to ~/.claude/hooks.json:

{
  "hooks": {
    "UserPromptSubmit": [{
      "hooks": [{
        "type": "command",
        "command": "python3 /path/to/promptvault/promptvault/hook.py",
        "timeout": 5000
      }]
    }]
  }
}

Fast (<50ms), silent (no stdout), safe (errors swallowed). Captures to ~/.claude/prompt-library/capture.jsonl.

Windows: use python instead of python3 and backslash paths.


Markdown Vault

Each conversation becomes an Obsidian-compatible .md with YAML frontmatter:

~/.claude/prompt-library/vault/
├── _index.md
├── 2026/
│   └── 03/
│       ├── 2026-03-25__c792e74f__refactor-user-auth.md
│       └── ...

Open as an Obsidian vault. The Calendar plugin works well for browsing.


Environment Variables

Variable Default
PROMPTVAULT_HISTORY ~/.claude/history.jsonl
PROMPTVAULT_OUTPUT ~/.claude/prompt-library
PROMPTVAULT_DB ~/.claude/prompt-library/prompts.db
PROMPTVAULT_VAULT ~/.claude/prompt-library/vault
PROMPTVAULT_PROJECTS ~/.claude/projects
PROMPTVAULT_CAPTURE_LOG ~/.claude/prompt-library/capture.jsonl

Contributing

Contributions welcome! See CONTRIBUTING.md. 340 tests, all synthetic data.

git clone https://github.com/reidemeister94/promptvault.git
cd promptvault
uv tool install --editable .   # global "pv" that tracks your local source
make setup-dev-env
make test && make lint

License

MIT


If pv saves your prompts, save us a Star on GitHub

Report an issue · Contribute

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

promptvault_py-0.0.8.tar.gz (55.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

promptvault_py-0.0.8-py3-none-any.whl (26.9 kB view details)

Uploaded Python 3

File details

Details for the file promptvault_py-0.0.8.tar.gz.

File metadata

  • Download URL: promptvault_py-0.0.8.tar.gz
  • Upload date:
  • Size: 55.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for promptvault_py-0.0.8.tar.gz
Algorithm Hash digest
SHA256 cf68aa2f723b018da999d9026e1ae0b9059383c1153a914b6ecbc3601c49a280
MD5 af7a50b7c23f0d2f1331d37aca3169d4
BLAKE2b-256 6ea3831ebd632076877de66f6e9f7160bdf36901334fd99d4c9b301bb691b462

See more details on using hashes here.

Provenance

The following attestation bundles were made for promptvault_py-0.0.8.tar.gz:

Publisher: publish.yml on reidemeister94/promptvault

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file promptvault_py-0.0.8-py3-none-any.whl.

File metadata

  • Download URL: promptvault_py-0.0.8-py3-none-any.whl
  • Upload date:
  • Size: 26.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for promptvault_py-0.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 74f9181f0dad7df640d4c9206c7ec092069c4921e9f8520fb7ebfbb6d4d52e2a
MD5 96a74b6a42b5226fa16b0a3ffa6813e0
BLAKE2b-256 d407ba6ed08bac5fc5df14bf19168cec5d9448074c2c484da63a74c622fa3389

See more details on using hashes here.

Provenance

The following attestation bundles were made for promptvault_py-0.0.8-py3-none-any.whl:

Publisher: publish.yml on reidemeister94/promptvault

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page