Ryu0118

AgentSessions — AI skill for Claude Code

AI community

Swift library to read and parse sessions from AI coding agents (Claude Code, Codex, Cursor).

How to install AgentSessions

This entry records only its repository, not the path inside it, so there is no exact command to give. Open Ryu0118/AgentSessions and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

What AgentSessions does

Swift library to read and parse sessions from AI coding agents (Claude Code, Codex, Cursor).

Alternatives in AI

  • Osaurus — Own your AI. The native macOS harness for AI agents -- any model, persistent memory, autonomous execution, cry 5.1k ★
  • Claude Usage Tracker — Native macOS menu bar app for tracking Claude AI usage limits in real-time 2.2k ★
  • Swift Agent Skills — A curated directory of open-source AI agent skills for Swift and Apple platform development 1.5k ★

README

AgentSessions

A Swift library to read and parse conversation sessions from AI coding agents.

Supported Agents

  • Claude Code
  • Codex
  • Cursor
  • Kimi Code
  • GitHub Copilot CLI
  • ZCode (~/.zcode/cli/db/db.sqlite)
  • DeepSeek Harness (~/.dsh/sessions/.../session.v4.jsonl.zstd)

GitHub Copilot CLI sessions are read from `~/.copilot/session-state//events.jsonl`.

Usage

import AgentSessions

// List all sessions across all agents
let readers = SessionReaderFactory.make()
for reader in readers {
    let summaries = try await reader.listSessions()
    for summary in summaries {
        print("\(summary.source.rawValue): \(summary.id) — \(summary.lastUserMessage ?? "")")
    }
}

// Load a specific session
let conversation = try await readers[0].loadSession(id: "session-id")
for message in conversation?.messages ?? [] {
    print("[\(message.role.rawValue)] \(message.decodedContent(for: conversation!.source))")
}

Installation

Swift Package Manager

dependencies: [
    .package(url: "https://github.com/Ryu0118/AgentSessions.git", from: "0.1.0"),
]
.target(
    name: "YourTarget",
    dependencies: [
        .product(name: "AgentSessions", package: "AgentSessions"),
    ]
)

Requirements

  • Swift 6.0+
  • macOS 15+

License

MIT