MIT License

技术解读

以下内容由 GitRead 中文社区 编辑团队基于项目 README 与官方资料整理, 结合中文开发者的常见使用场景补充技术选型建议。具体以项目官方文档为准。

深度剖析 jazzyalex/agent-sessions 项目

项目背景与痛点

在现代软件开发中,各种开发工具和 AI 辅助工具不断涌现,极大地提高了开发效率和代码质量。然而,随之而来的问题是工具之间缺乏良好的会话管理和协同机制。开发人员经常需要管理多个会话,追踪不同代理的实时数据指标,并手动处理这些问题,这无疑增加了开发人员的工作负担。Jazzyalex 开发的 agent-sessions 项目针对这一痛点,提供了统一的会话浏览器、代理控制台、实时分析和限制追踪功能。这对于使用 Codex CLI、GitHub Copilot、OpenClaw 和 Hermes 等工具的开发者来说,无疑是一个福音。

核心技术揭秘

架构与数据流

agent-sessions 的架构通过多层设计和模块化组件实现了高度的扩展性和灵活性。以下是其核心架构的概览图:

graph TD A[用户操作] --> B[Session Browser] B --> C{"Data Processing"} C -->|"解析和处理"| D[Analytics Engine] C -->|"存储数据"| E[Database] D --> F[Limits Tracker] E --> F D --> G[Agent Cockpit] F --> G H[External APIs] --> I{"Data Fetching"} I --> B I -->|"不同代理的数据"| E
设计理念与关键技术
  • 模块化设计:该架构利用模块化设计,将不同功能(如会话浏览器、代理控制台、分析引擎和限制追踪器)封装为独立的组件,便于后期扩展和维护。
  • 异步处理:通过异步处理,agent-sessions 能够高效地处理大量会话数据,确保用户操作的流畅性。
  • 实时数据流处理:使用实时数据流处理技术,可以快速响应用户请求,实时更新会话状态和数据指标。

数据存储与处理

数据存储方面,agent-sessions 使用了 SQLite 数据库来存储备份的用户会话数据。数据处理方面,其利用了现代的数据流处理框架,如 Apache Kafka 和 Spark Streaming,确保数据能够被快速解析和处理。

功能亮点与差异

与同类竞品相比,agent-sessions 在以下方面独树一帜:

  • 统一的会话管理和分析:将多个代理工具的不同会话统一展示,允许用户通过搜索和过滤功能快速定位历史会话,极大提升了工作效率。
  • 实时数据可视化的增强:提供实时的数据可视化和分析,可以展示当前各代理的使用情况及速率限制,帮助开发者实时掌握系统状态。
  • 灵活的扩展能力:通过插件机制,支持第三方开发的自定义代理工具集成,开箱即用。

应用场景与落地建议

适用场景

  • 多代理工具用户:在使用多个 AI 辅助工具或代理工具时,需要统一管理和查看不同会话的状态和历史数据。
  • 开发工具链整合:当团队试图整合多个开发工具链时,agent-sessions 可作为运维和监控的重要组件。
  • 实时监控需求:需要实时监控代理工具的使用情况及速率限制,确保系统的稳定性和可靠性。

落地建议

  • 在生产环境中使用时,应定期备份数据库,确保数据安全。
  • 按需配置资源,尤其是在高并发环境中,需要关注数据库的性能瓶颈。
  • 开发团队可以根据具体业务需求,开发自定义插件,在 agent-sessions 中集成特定的代理工具。

综合评价

优点

  • 高度的可扩展性和灵活性:模块化设计使得 agent-sessions 可以轻松集成新功能和代理工具。
  • 强大的数据处理与分析能力:通过实时数据流处理技术,能够快速响应和处理大量数据,确保高效性。
  • 用户友好的界面与操作:统一的会话管理和详细的代理数据追踪,极大提升了用户体验。

缺点

  • 性能优化空间:在极端高并发环境下,可能遇到数据库性能瓶颈,需要进一步优化。
  • 社区支撑方面需加强:虽然项目有着丰富的功能和强大的技术支撑,但是在社区活跃度和服务支持方面还有提升空间。

综上所述,agent-sessions 是一款强大而灵活的开发会话管理和代理工具集成解决方案,适合多种业务场景的复杂需求,值得一试。

关于

GitHub 原始描述(英文)

Local-first macOS app to browse, search, analyze, and resume supported AI coding-agent session history across Codex, Claude Code, OpenCode, Cursor Agent, Hermes, OpenClaw, Copilot CLI, and more.

描述取自 GitHub 官方 API,保持仓库作者书写的原文。

语言占比

HTML
JavaScript
Python
Ruby
Shell
Swift

README

Agent Sessions for macOS

Build

Find the agent session you need

Search local conversations from Codex, Claude Code, Cursor, and 13 other coding agents in one Mac app. Read the transcript, find supported image outputs, and resume supported CLI sessions. For Codex and Claude, see which sessions are burning through your quota.

Open source. Your session history stays on your Mac. No telemetry.

Download Agent Sessions 6.3 · See the product page · All releases

brew install --cask jazzyalex/agent-sessions/agent-sessions

Agent Sessions showing searchable local coding-agent sessions and a floating Codex and Claude Quota Meter

Search 16 local agent histories, resume supported sessions, and track Codex and Claude quota burn.

What it does

  • Find past work. Search prompts, responses, tool calls, command output, errors, file paths, and supported image references across local agent histories.
  • Pick up where you left off. Copy a resume command or open a supported CLI session in Terminal.app, iTerm2, Warp, or Ghostty. Ghostty requires AppleScript support (verified with 1.4.0).
  • See which session is burning your quota. Track live per-session Codex and Claude burn against 5-hour and weekly windows, plus each OpenCode session’s token or cost rate; switch between quota, tokens, and estimated API-equivalent cost. Weekly local estimates show pace without a run-out time.
  • See what a session used. Session Info opens beside every supported agent transcript, showing immediate provider-neutral metadata and detailed model, token, activity, or pricing data when the source records it.
  • Keep transcripts on your Mac. Agent Sessions builds its search index locally and does not upload session history.

What’s New in 6.3

  • Resume in Ghostty. Choose Ghostty under Preferences → General → Terminal App, and Resume opens a new Ghostty window in the session folder, for Codex and the other supported CLIs. Requires a Ghostty build with AppleScript support (verified with 1.4.0). Contributed by @buildfolk.
  • Pressing Esc in OpenCode no longer hides its rate. An interrupted step with no output now counts as no usage, so the session keeps its Quota Meter rate and a complete Session Info total.

What’s New in 6.2

  • OpenCode sessions show their own burn rate. Each running OpenCode 2.x session in the Quota Meter shows its token rate, or its API-equivalent cost in the $ lens; free routes read Free. A row keeps its last rate for 5 minutes after a turn ends, with the same load bar as Codex and Claude.

What’s New in 6.1.2

  • OpenCode in the Quota Meter shows the session you are in. Each OpenCode terminal shows its open conversation by its real title, working or idle, and closed conversations no longer show as live. Setup is automatic; the plugin’s status is in Settings → OpenCode. Also: Codex limits recover within a minute after a connection drop.

What’s New in 6.1.1

  • Crash reports name only Agent Sessions crashes. A crash in a tool the app starts, such as a Claude Code hook, no longer shows up as ours, and each report shows its crash time. Stopped Claude replies are now marked in the transcript.

What’s New in 6.1

  • OpenCode in the Quota Meter. Running OpenCode sessions appear under the OpenCode logo, below Codex and Claude, each marked working or idle. Limits and burn rate are not there yet; if you use OpenCode Go and want to help add them, open an issue.
  • Fixes. A live session in a folder inside your home or temp folder keeps its own title, and crash reports you choose to send carry the exception message.

What’s New in 6.0.1

  • Every agent’s latest format, checked. Current Codex, Claude Code, OpenCode, Copilot, Cursor, Hermes, OpenClaw, Kimi, Pi, Grok, Cline and DeepSeek Harness sessions read cleanly. OpenClaw 2026.10.5 sessions are back, Claude transcripts stop repeating each turn, and fx 0.0.8+ sessions open.

What’s New in 6.0

Quota Meter in the MacBook notch: Codex and Claude weekly levels beside the camera open into the full meter with per-session burn rates on hover

  • Quota Meter in the notch. Codex and Claude limits sit beside the MacBook camera, or in a small virtual notch on displays without one. Hover and it opens into the full Quota Meter with live session burn; move away and it folds back. Pick Notch, Desktop or Automatic, and Wings or Minimal, in Settings.
  • OpenCode 2.x sessions. Sessions started in OpenCode 2.0 and later now reach the list, and sessions carried over from 1.x keep their full history.
  • Also: the notch takes over the menu bar limits item, free models read as Free in Session Info, and OpenCode prompts that recorded file changes no longer go missing.

What’s New in 5.7

  • Compressed Codex sessions stay in the list. The Codex desktop app now packs sessions idle for 7 days into .jsonl.zst files and deletes the originals. Agent Sessions reads them as before: transcripts, search, Session Info, images, stars and pins keep working, and the files are never changed.
  • API-equivalent cost for eight more agents. Session Info prices OpenCode, OpenClaw, Hermes, Kimi, Cline, Qwen, Antigravity and DeepSeek Harness sessions from first-party list prices, and says why when a session lacks the evidence.
  • Fixes. The Codex usage meter no longer stalls on Codex’s update prompt, Claude 5.5 prices are corrected, and Copilot cache tokens are counted once.

What’s New in 5.6

  • Session Info for every agent. Open the inspector beside any supported agent transcript. Provider, current model or configuration, and title metadata appear immediately when recorded, with detailed telemetry staying honest about each source’s limits.
  • Broader provider detail. Antigravity, Kimi, Grok, fx, Cline, Droid, DeepSeek Harness, Cursor, Qwen Code, and Devin now contribute their audited Session Info fields where their local records support them.
  • Clearer loading and empty states. Indexing, transient refresh, failures, filters, and a genuinely empty library are now distinct, and slow detailed scans time out with a retry path.

What’s New in 5.5.3

  • Session Runway recognizes GPT-6.1 Sol. Published rates cover cached input, fast mode, and long context, so mixed Sol/Astra activity contributes to dollar estimates and shared weekly calibration.

What’s New in 5.5.2

  • Current agent formats stay compatible. Agent Sessions recognizes the latest observed session fields from Claude 2.1.285, Copilot 1.0.89, Kimi 2.1.1, and Codex 0.159.
  • DeepSeek Harness 0.2 histories remain browseable. Native v4 sessions open alongside v0-v3 history, including developer messages and first-class tool results.
  • More transcript detail survives parsing. OpenClaw shows current tool arguments and nested results, while role-less Cursor turn failures appear as visible errors.

What’s New in 5.5

  • DeepSeek Harness history browsing. The local, read-only integration discovers immutable session directories, selects the highest supported generation, and browses/searches supported v0-v3 plain JSONL and independently framed, checksum-validated Zstandard histories. Incomplete or corrupt artifacts stay invisible. Compatibility evidence comes from checked-in sanitized fixtures, the pinned event catalog, and a local manual UI smoke test; broad real-world coverage remains unverified.
  • A clearer weekly Session Runway. The Quota Meter combines measurable active-session burn with an estimate of time left at that pace, keeps the weekly reset visible, and reports measuring, unavailable, or exhausted states instead of inventing a value.
  • Codex runway follows the configured sessions root. The meter honors the Preferences override, process-inherited CODEX_HOME, and the default path, with a GUI-launch caveat for shell-only environment settings.

What’s New in 5.4

  • Cline CLI and Cline Desktop support. Browse and search local prompts, responses, thinking, and tool activity from both Cline surfaces, with clear origin labels and Cline-specific Settings controls.
  • More reliable session retrieval. Project filtering distinguishes same-named clones, active searches refresh cleanly, displayed titles remain searchable, and cache hydration preserves confirmed sessions when a source is temporarily unavailable.
  • Clearer session titles. Claude, OpenClaw, OpenCode, and Droid keep recognizable source-aware titles after full transcript loading and search prewarming.

Supported sources

The current source registry contains 16 active agent formats plus legacy Droid sessions. Agent Sessions 5.6 adds Session Info for every source; capabilities differ by source and installed CLI version.

Source Browse and search Resume
Codex Yes Supported sessions
Claude Code Yes Supported sessions
Cursor Yes Supported sessions
GitHub Copilot CLI Yes Supported sessions
OpenCode Yes Supported sessions
Antigravity Yes Supported sessions
Pi Yes Supported sessions
Kimi Code Yes Supported sessions
Grok CLI Yes Supported sessions
Hermes Yes Supported sessions
OpenClaw Yes No
Qwen Code Yes Active sessions; end-to-end unverified
Devin CLI Yes Supported active sessions
fx Yes Command plan tested; interactive reopen unverified
Cline CLI and Desktop Yes No
DeepSeek Harness Yes No
Droid Legacy sessions No active monitoring

DeepSeek Harness support is an independent integration, not an official partnership or endorsement. Its checked-in decoder vendors the selected official Zstandard 1.5.7 decompression/common sources under the upstream BSD license; provenance and the archive checksum are recorded in ThirdParty/DSHZstd/README.md.

Format-maintenance owners, verification dates, and tested versions are in STEWARDS.md. Session-Bench compares ten agents across 20 evidence-backed format gates.

Quota Meter

An account meter can tell you that 60% is used. Agent Sessions shows which active Codex or Claude session is spending it.

  • Per-session burn against available 5-hour and weekly windows.
  • Four views: 5-hour, weekly, tokens per hour, and estimated API-equivalent dollars per hour.
  • Per-model pricing when one session uses more than one model.
  • Explicit unavailable states when a provider does not expose a usable limit.

The dollar view is an API-equivalent estimate, not your subscription bill.

Quota Meter showing weekly burn rates for active Codex sessions and a Claude session

Session Info

Open Session Info beside any supported agent transcript with ⇧⌘I or the gauge button in the toolbar. It starts with provider-neutral metadata from the loaded session row, then reads the session’s own records when detailed telemetry is supported.

  • Quick info for every source — provider, current model or configuration, and title when recorded.
  • Detailed telemetry where available — price at published API rates, total tokens, request count, token mix, model history, and activity.
  • Honest boundaries — unsupported cost, quota, token, and history fields stay labeled unavailable instead of being inferred.

The price is an API-equivalent estimate, not your subscription bill.

Session Info beside a Codex transcript, showing price at API rates, a 98% cached token mix, model and thinking effort, activity, and a history of model and effort changes

Install

Download AgentSessions-6.3.dmg, open it, and drag Agent Sessions.app into Applications.

Or use Homebrew:

brew install --cask jazzyalex/agent-sessions/agent-sessions

Updates are signed, notarized, and delivered through Sparkle.

Local-history guides

See the changelog, privacy policy, and security notes.

Privacy and network access

  • Transcript discovery, parsing, indexing, search, and navigation happen locally.
  • Agent session folders are read rather than rewritten.
  • Explicit actions can open resume commands or manage saved copies.
  • Optional network access checks for signed Sparkle updates and fetches a public model-price list. Neither request contains transcript data.

Contributing

Missing your agent? Use the new source form. You can contribute a sanitized fixture without writing Swift, adopt an existing format as a steward, or follow the contribution guide.

Build locally with Xcode 16 or later:

xcodebuild -project AgentSessions.xcodeproj -scheme AgentSessions -configuration Debug -destination 'platform=macOS' build

Run the stable test wrapper:

./scripts/xcode_test_stable.sh

Found a session you thought you had lost? Star Agent Sessions to help other developers find it.

License

MIT. See LICENSE.

评论

暂无评论