跪拜 Guibai
← All articles
Frontend · JavaScript · Backend

Agent Session Sync 1.3.2: visual triage for the AI sessions eating your disk

By code_Bo ·
Read original on juejin.cn ↗ Google Translate ↗ Alt translation

Local AI session directories routinely grow into gigabytes, and clearing them safely means knowing which stores are file-per-session and which are shared databases. This app packages that triage into a GUI on one parser shared with the CLI and MCP, keeping cleanup bounded and Agent data read-only.

Summary

Agent Session Sync's new desktop app puts a visual layer over the local AI agent session data its CLI and MCP package already read. The Electron UI shows every installed agent, how much disk each consumes, and which repos chat the most, then lets you click into a project, open a session, and page through user input, full message info, or agent conclusions in searchable tabs. Cleanup is optional and bounded: only file-typed sessions (one file or directory per session) move to the trash, while shared SQLite stores for Cursor, OpenCode, Trae, and similar stay untouched so a whole database cannot be nuked.

Parsing is inherited from the CLI rather than reimplemented. An Electron window talks over a narrow preload API to a main process, which spawns the same runtime/cli.js as a child process under ELECTRON_RUN_AS_NODE=1 and consumes JSON only. The UI stays vanilla JavaScript with no framework. Agent session directories are read-only; decisions, tasks, and aliases land in ~/.local/share/agent-session-sync, while display names go to a separate desktop-aliases.json without renaming anything on disk.

The practical notes show where the engineering effort went. Cursor's session store is big enough that the Overview page needs a --fast flag, caching, and background warmup to avoid a 15-second first paint. Counts mislead unless the app pulls full data instead of trusting a default limit=15 result. The macOS build had to sign at afterPack, before assembling the DMG, or users hit false "damaged" warnings. The doc is blunt about the unsigned install path: right-click Open, xattr -cr, and SmartScreen's "Run anyway" are the price of skipping Developer ID.

Takeaways
— Desktop app v1.3.2 (Electron) reads the same local session directories as the cross-agent-sync CLI/MCP package; parsing is inherited from a child-process run of runtime/cli.js, not reimplemented.
— Five entry pages: Overview, Project, All Projects, Cleanup, and Settings.
— Agent session directories are held read-only; decisions, tasks, and aliases write only to ~/.local/share/agent-session-sync.
— Cleanup only moves file-typed sessions (one file or directory per session) to the trash; shared SQLite stores for Cursor, OpenCode, Trae, and Lingma are excluded.
— customAgents editing happens through a Settings form that writes ~/.config/agent-session-sync/config.json, shared with the CLI.
— Builds are unsigned on both platforms: macOS needs right-click Open or xattr -cr for false "damaged" reports, Windows needs a SmartScreen override.
— The app does not run `ass install`, so Electron paths never end up in MCP config.
— Cursor's large session store is handled with --fast, caching, and background warmup so the first scan does not stall the UI for 15 seconds.
— Card counts can disagree with page counts because of a default limit=15; the desktop pulls the full dataset explicitly.
— macOS signing must happen at afterPack, before assembling the DMG, or the build reports false "damaged" errors.
Conclusions

Splitting context handoff (CLI/MCP, inside the conversation) from inspection and cleanup (desktop GUI) lets a single parser serve two very different job shapes without either surface bloating.

The read-only source rule plus the exclusion of shared SQLite stores is the safety boundary that makes cleanup a plausible feature; a wiper that deletes inside a shared database is one small bug away from losing a whole store.

Scan cost and count alignment, not chart drawing, turned out to be the hard parts of a "simple GUI wrapper", which says a lot about where this kind of tooling actually gets expensive.

Documenting the unsigned-install workarounds as a normal part of setup treats distribution friction as a real cost, not something to paper over.

Concepts & terms
customAgents
A mapping that tells a tool how to read sessions from non-built-in AI agents by their storage format (jsonl, json, or sqlite); Agent Session Sync edits it through a Settings form into a config shared with the CLI.
ELECTRON_RUN_AS_NODE
An environment variable that runs Electron's bundled Node.js runtime without the GUI, so an Electron app can spawn a plain Node child process.
Shared SQLite
A session store where all of an agent's conversations live in one SQLite database (Cursor, OpenCode, Trae, Lingma); deleting one session there cannot be isolated to a single file, so the tool excludes these sources from cleanup.
From the discussion
Featured comments
组合搭配函数

That hard rule about read-only source data is spot-on. Agent session files are each vendor's own territory; the tool only writes in its own directory, so when something goes wrong, responsibility is clear. That counting-consistency pitfall bit me too — the card says 31, clicking in shows only 9, and the default limit truncates without a peep. Explicitly pulling the full set and then aligning by keys really fills the hole. One question: for the shared-SQLite vendors that can't be deleted in the desktop app, how does the cleanup page tell the user — does it just hide the option, or grey it out with an explanation?

code_Bo

Greyed out.

组合搭配函数  → code_Bo

I'll accept the grey-out. For those shared-SQLite vendors, you can't delete in the desktop app anyway; being clickable but non-deletable would be the real trap. But grey-out alone isn't enough — better to write plainly next to the button, "shared libraries aren't deleted in the desktop app," otherwise the user's first reaction is that the UI froze and they'll keep clicking. Are you only greying it out now, or is the reason included as well?

See top comments, translated →
Source: juejin.cn ↗ Google Translate ↗ Backup ↗