anysession
anysession (formerly agent-sessions) — a cross-tool session browser for
AI coding agent CLIs. One fzf picker over every resumable session on your
machine — searchable by title, path, and full conversation content — with
the right resume command run for you.
No daemon, no background process. Pure Python stdlib (including sqlite3)
that scans each tool's own on-disk session store, shows you an fzf picker,
and execs the right resume command when you pick one.
Supported tools
| Tool | Source read | Resume command |
|---|---|---|
| Claude Code | ~/.claude/projects/*/*.jsonl |
claude --resume <id> |
| Codex | ~/.codex/session_index.jsonl + ~/.codex/sessions/** |
codex resume <id> |
| OpenCode | ~/.local/share/opencode/opencode.db (SQLite) |
opencode --session <id> |
| Hermes | ~/.hermes/state.db (SQLite) |
hermes --resume <id> |
Command Code (cmd) |
~/.commandcode/projects/*/*.jsonl |
cmd --resume <id> |
Antigravity CLI (agy) |
~/.gemini/antigravity-cli/history.jsonl |
agy --conversation <id> |
| Antigravity desktop | ~/.gemini/antigravity/conversations/*.db |
listed only — no known CLI resume path yet |
Titles come natively from the tool where available (Codex, OpenCode, Hermes); for tools that don't store one (Claude Code, Command Code), the title is the first real user message in the transcript.
Not currently wired up: OpenClaw, Freebuff — no resumable session ID mechanism found for either. PRs welcome once one exists.
Install
Requires Python 3.10+ and fzf.
pip install anysession
# fzf, if you don't have it:
brew install fzf # macOS
# or a static binary for Linux: https://github.com/junegunn/fzf/releases
This installs both command names — anysession and the legacy alias
agent-sessions — so existing muscle memory and scripts keep working.
Run from a source checkout instead, if you prefer:
git clone https://github.com/toshon-jennings/anysession
python3 -m anysession # from inside the checkout
Use
anysession
Type to search — it matches against titles, working directories, and the full text of every conversation, not just what's shown in the list. The preview pane below shows the matched excerpt in context. Enter resumes the selected session in its original directory; Esc cancels.
Safety
Every resume goes through an allow-list (RESUME_POLICY in
__main__.py): the tool name must be one of the six known CLIs, the argv
shape is pinned to exactly [tool, flag, id], the session ID must match a
strict character pattern, and the executable is resolved with shutil.which
before execvp. A tampered or hand-crafted cache cannot smuggle extra
arguments or an unexpected program onto the exec line.
How it works
Every invocation does a fresh, read-only scan of each tool's session store
(files or SQLite, opened mode=ro) and writes a small cache to
~/.cache/agent-sessions/index.json — rebuilt on every launch, used only to
make live search-as-you-type fast without rescanning disk on every
keystroke. Nothing is written back to any tool's own data.
Portability
Paths are all $HOME-relative and read with plain Python stdlib, so this
should work unmodified on macOS as long as the same tools are installed
there. Not yet verified on macOS — if something's off, please file an issue
or send a PR.
License
MIT — see LICENSE.
Release files for anysession 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| anysession-1.0.0.tar.gz | 10.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| anysession-1.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 21.2 kB
Release files / anysession-1.0.0.tar.gz
| Download URL | anysession-1.0.0.tar.gz |
|---|---|
| Size | 10.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4cf885b36f17d20399864894bba647ec6325d4af8af8ebdecf60c91d48898a7e
|
|
BLAKE2b-256 checksum How to use checksums |
3501cfcdd58937e91e1792aaa492890020b4ede55f017544944320e6217b7aef
|
| 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 Sep 14, 2026.
Transparency logRelease files / anysession-1.0.0-py3-none-any.whl
| Download URL | anysession-1.0.0-py3-none-any.whl |
|---|---|
| Size | 10.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7880071beaaa04cc79bb63d0d2a25a4386acef69b0d0464942c11c54cc7a3bc6
|
|
BLAKE2b-256 checksum How to use checksums |
465d0d8f0b5e5232925c2236405a4f2c302a1208603ea22c677ecbced6b57b22
|
| 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 Sep 14, 2026.
Transparency log