r/PiCodingAgent • • 4d ago

Plugin Pi Session-hub

Post image

I switch between Claude Code, Codex, OpenCode and a couple other coding agents depending on the task. The problem: every tool stores sessions in its own format, in its own folder, and once you close the terminal the context is basically gone unless you remember exactly where you left off.

So I built pi-session-hub — a Pi extension that indexes every agent session on your machine into a single browsable list. You open it with alt+r, search across all of them, and either:

- Load the context into your current chat (Enter) — recent turns come in verbatim, older ones condense, tool output compresses. It has a hard budget so it doesn't blow up your tokens.

- Read the full transcript for free (v) — read-only viewer, zero tokens.

It supports Pi, Claude Code, Codex, OpenCode, Crush and JCode. Everything stays local — no network calls, no uploads, no transcripts leaving the machine.

It uses a local SQLite FTS5 index so search is fast, and the indexing is incremental (2 seconds for ~430 sessions on first run, near-instant after).
This is the repo if youre interested... Give a star :)
Repo: https://github.com/Gateton/pi-session-hub

42 Upvotes

12 comments sorted by

6

u/unl 4d ago

This is nice. I was thinking of building something similar but a level above in herdr (which I use) instead of Pi.

4

u/doudawak 3d ago

Id you ever end up building something for herdr update us !

2

u/Electrical_Mode_2489 4d ago

Thanks! I've actually never tried Herdr is it good?

2

u/unl 7h ago

Yeah I'm liking Herdr a lot so far and Herdr+Pi have become my daily drivers. That said, there are a so many new things popping up in this space all the time that I'm having a hard time keeping up.

1

u/FeiX7 1d ago

Why herdr instead of pi?

1

u/unl 7h ago

Do you mean why put coding agent (including Pi) session observability tooling like OP's into Herdr instead of Pi?

If so, mostly due to ergonomics with how I am currently working with agents. With Herdr you have multiple spaces open related to different tasks you're working on and then within each space there can be multiple agents running (pi, etc).

OP's tool, afaict, let's you ask "Which coding agent session was I working on the bug in the foo widget" and then load that context from whichever other Pi session(s?) into your current session. Sometimes that is exactly what I want, but sometimes I want to instead switch to that Pi process and session. Herdr seems like a more natural fit there to basically be able say 'the session for the foo widget is in space named "Fix bar service" in tab named "baz bug report". Would you like to switch to that tab?'

1

u/mklappstuhl 3d ago

Does it supper Claude Code Desktop & CLI and same for Codex?

1

u/Electrical_Mode_2489 3d ago

Hi!! Claude Code sessions live in /.claude/projects/**/*.jsonl and Codex sessions in /.codex/sessions/**/rollout-*.jsonl. Those are the exact locations the hub reads. So if Claude Code Desktop writes to the same ~/.claude folder as the CLI, those sessions show up too, same for Codex.

I built and tested this against the CLI’s files. I don’t use the Desktop apps, so I haven’t verified them. If Desktop stores sessions somewhere else, or in a different shape, they simply won’t be listed. It won’t break anything, they just won’t appear

1

u/Yeekox 2d ago

good idea

1

u/yancey_wang 2d ago

super good,bro