Skip to main content

Archive and browse agentic coding sessions

Project description

Agent Archive

Archive and browse agentic coding sessions. Parses session logs from multiple agents and generates a searchable MkDocs static site.

Agent Archive screenshot

Supported agents: Claude Code, Gemini CLI, Pi, OpenCode, GitHub Copilot

Requirements

  • Python 3.10+

Installation

Install as a standalone CLI with uv:

uv tool install agent-archive

Or with pip:

pip install agent-archive

For development (from a local clone):

uv sync

Usage

Quick start

The run command syncs, builds, and serves the archive in one step:

agent-archive run --output ~/ai-sessions

This is equivalent to running sync, build, and serve in sequence. It accepts all the same flags as the individual commands:

agent-archive run --output ~/ai-sessions \
  --claude-path ~/.claude \
  --pi-path ~/.pi/agent \
  --opencode-db ~/.local/share/opencode/opencode.db \
  --gemini-path ~/.gemini/tmp \
  --copilot-path ~/.copilot \
  --port 9000 \
  --no-browser

Individual commands

Use the individual commands when you need more control — for example, to sync on one machine and serve on another, or to rebuild without re-syncing.

Sync

Parse agent logs and write Markdown files into <output>/docs:

agent-archive sync --output ~/ai-sessions

Agent log directories are auto-discovered at their default locations. Override any of them:

agent-archive sync --output ~/ai-sessions \
  --claude-path ~/.claude \
  --pi-path ~/.pi/agent \
  --opencode-db ~/.local/share/opencode/opencode.db \
  --gemini-path ~/.gemini/tmp \
  --copilot-path ~/.copilot

Only sessions that have changed since the last sync are re-parsed (incremental).

Secret redaction is on by default — API keys, tokens, and env var values are replaced with REDACTED in the rendered output. To disable:

agent-archive sync --output ~/ai-sessions --no-redact

Build

Generate the MkDocs config and build the static HTML site into <output>/site:

agent-archive build --output ~/ai-sessions

Serve

Start a local HTTP server and open the archive in a browser:

agent-archive serve --output ~/ai-sessions

A local server is required because the site uses JavaScript for search. Default port is 8000.

agent-archive serve --output ~/ai-sessions --port 9000 --no-browser

Sharing across multiple machines

You can point all your machines at the same output directory synced via Dropbox, Syncthing, or similar. Each machine maintains its own .sync_state.<hostname>.json file in the output directory so they never interfere with each other.

On each machine, run sync independently:

agent-archive sync --output ~/Dropbox/ai-sessions

Sessions from all machines accumulate in the shared archive. To browse from any machine, build and serve:

agent-archive build --output ~/Dropbox/ai-sessions
agent-archive serve --output ~/Dropbox/ai-sessions

Or use the shortcut:

agent-archive run --output ~/Dropbox/ai-sessions

Development

Run tests:

uv run pytest

Project Structure

src/agent_archive/
  cli.py              # Typer CLI (run, sync, build, serve)
  models.py           # Pydantic models (Session, Message)
  redactor.py         # Secret redaction
  renderer.py         # Markdown + MkDocs site generation
  site_builder.py     # mkdocs.yml config and build
  state.py            # Incremental sync state (per-machine)
  parsers/
    base.py           # Abstract BaseParser
    claude_code.py
    gemini.py
    pi.py
    opencode.py
    copilot.py

Adding a Parser

Subclass BaseParser to support a new agent log format:

from pathlib import Path
from agent_archive.parsers.base import BaseParser
from agent_archive.models import Session

class MyAgentParser(BaseParser):
    def discover(self) -> list[Path]:
        # Return all log file paths for this agent
        ...

    def parse(self, filepath: Path) -> list[Session]:
        # Parse the log file and return Session objects
        ...

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

agent_archive-0.2.1.tar.gz (1.2 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

agent_archive-0.2.1-py3-none-any.whl (24.0 kB view details)

Uploaded Python 3

File details

Details for the file agent_archive-0.2.1.tar.gz.

File metadata

  • Download URL: agent_archive-0.2.1.tar.gz
  • Upload date:
  • Size: 1.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.18 {"installer":{"name":"uv","version":"0.11.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for agent_archive-0.2.1.tar.gz
Algorithm Hash digest
SHA256 95f2dbe16fe0d47812178aecd9958d99d75eb95a8aba29e896ec82f48dc79afe
MD5 4bc2f78db9fe884faad0fae65e27a1ba
BLAKE2b-256 1cdf35f8f5e8ecdbf53f6aaa9f0e0b614dd71bd8e7cc3d8aca83f692f13e33cc

See more details on using hashes here.

File details

Details for the file agent_archive-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: agent_archive-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 24.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.18 {"installer":{"name":"uv","version":"0.11.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for agent_archive-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1c175ef79820df5493e2c4daf6d8fb0bbf6cc4ffaf7a25c5fcea5a320bed5eb7
MD5 a54b566d0c3a83daef4114ff6139b3ba
BLAKE2b-256 454f5cfb29917698e447c9b2c4bf283b71819a386d1a8a7e187ca90d03b4281e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page