r/PiCodingAgent • • 3h ago

Resource developing a tool to ingest agent sessions

https://github.com/itama8/divya-drushti-dvdst.git

दिव्य-दृष्टी · Divya Drushti (dvdst)

"Divine vision": the ability to perceive what is beyond ordinary sight; clairvoyance.

I wanted my agent to review large batches of old transcripts without having to deal with raw jsonl files each time. Raw dogging it works once or twice, but if you want to build workflows on top of past session analyses, you'll be burning tokens and waiting all day, and the outputs are still meh.

So I started with some jq+ts scripts to let my agent pass in a transcript and get all human messages, agent responses, tool calls, injected context, and agent loaded context categorized and labelled. This worked really well and I thought it would make a good CLI tool. But it was fucking terrible to use as a human and I much preferred to let my agent use the scripts, so I decided to make this a tool primarily for agents.

This is vibe coded with love. It's not a single prompt `make a tool, no mistakes` kind of thing.

- It works with Pi, Claude Code, and Codex.

- It has clear instructions, examples, and a skill for your agent.

- It uses no LLM calls or API keys, so you can just hand this repo link to your agent and it will know what to do.

I have tried to push this tool to extremes and arrived at a shape of outputs that is easy to understand for both agents and humans. Some of the biggest wins:

  1. On a corpus of about 917 transcripts (mixed), dvdst reduced 1.87 GB of raw logs down to 11–23 MB of output, depending on what we kept (dropped images to abs paths, dropped auto loaded context, deduped full text for skills that were loaded more than once in a session, etc).

  2. The tool categorizes and labels edit, read, and bash calls separately. In worktree with many sessions, dvdst can replay supported edits and patches from a selected session into Git's index. It also flags possible file changes from shell commands for further review and staging.

  3. dvdst filters out harness-injected context (like `AGENTS.md` blocks and system messages) when you want just the conversation. It can also surface skill expansions and recorded skill-file reads, depending on what each agent logs.

Why I am posting it here:

I am not a developer and I don't know how to maintain an open source repo. I think this tool has real value and can be used as a foundation for really cool analyses+evals. I would love to get your agent's feedback on:

- if they found it easy to use

- if they got outputs in a shape that was better than just looking at the raw jsonl files

- whether dvdst made it easy for an agent (like Pi) to look at other agents' sessions (like Claude Code or Codex)

Please paste your agent's feedback as a comment here or as a GitHub issue, and leave out any transcript excerpts.

Here's how my agent would like to introduce this repo to your agent (copy paste the following part):

````

Here is a session transcript ingestion tool called divya-drushti-dvdst.

Set it up (Node 22+), then teach yourself the tool from the tool:

```

git clone https://github.com/itama8/divya-drushti-dvdst && cd divya-drushti-dvdst && npm ci --include=dev

node bin/dvdst.mjs capabilities --group exploration # commands, typed args, side effects

node bin/dvdst.mjs schema calls # output fields for tool-call rows

```

Read `AGENTS.md`, then `docs/agents.md`. From another repository, call it by absolute path; it keeps your working directory for project selection.

Discovery defaults to Pi sessions. If you are Claude Code or Codex, pass `--source claude|codex|all` or an exact transcript path.

- **Distill many sessions:** `messages --source all --project <name> --last 20 --kind human,agent --nonempty --full --fields session,line,kind,text --page --limit 100` gives you what was said, without AGENTS.md blocks, system reminders, skill expansions, notifications or tool-call-only turns. Start with one page and use `nextOffset` when you need more. Check `complete` and `failedSources` before drawing conclusions.

- **Drill into one:** `overview` → `calls` / `commands --contract exploration --page` / `files --contract exploration --page`, then `search` → `message --ref` → `call --ref` for the exact exchange and tool result.

- **Read other agents:** the same commands work on Claude Code and Codex sessions whatever agent you are. Use `--source all` for discovery, or pass an exact transcript path.

- **Shared worktree:** dvdst can stage supported edits and patches from one session into Git's index. Shell-command file changes are flagged for manual review, never staged. Read `docs/session-staging.md` and dry-run first. Staging changes the Git index, never commits, and only runs when your human asks.

Project with `--fields` and page with `--limit`/`--offset`. `--page` reports whether every source was read, and a nonzero exit means some weren't: check before concluding anything. Cite session and source line. Null means unknown. Inferred effects are evidence, not proof. Transcripts can contain credentials, so quote sparingly.

Demo it to your human on their own sessions: what you worked on recently, which commands failed, one correction they gave you and whether you followed it. Include a session from a different agent if one is available.

Then give your human candid feedback for the author: was dvdst easy to use, were its outputs better than reading raw JSONL, did reading another agent's sessions work, and what confused or broke. No transcript excerpts.

````

2 Upvotes

5 comments sorted by

1

u/Ambitious_Spare7914 2h ago

Who is your audience? You didn't that post yourself so who are you expecting to read it?

2

u/o_sht_hi 2h ago edited 2h ago

Bro I wrote the whole thing by hand except the message from my agent. The audience is anyone who is using agents and wants to analyse their transcripts

Why do you think the post is AI generated?

Also, what AI even generates prose in this style? It's clearly written by a human. Did you actually read it or saw the length and concluded that it must be AI?

That one kinda hurts, man. I spent a lot of time writing and rewriting to make sure my claims line up with what the repo does today 😔

1

u/Ambitious_Spare7914 2h ago

My mistake. Good luck

1

u/o_sht_hi 2h ago

❤️

1

u/Oshden 5m ago

Nice work man. I was thinking about creating something like this myself and it’s nice to see someone else already did it so I don’t have to start from scratch