Introduction

opentine is git for agent runs: it records native agent executions and supported external CLI harnesses as local, portable .tine artifacts.

A saved run is a content-addressed graph of model calls, tool calls, outputs, errors, transcript state, cache provenance, policy metadata, and an integrity checksum. You can inspect the graph, verify the file body, fork from a known-good step, replay recorded work, rerun through an explicit harness, and diff the branch that worked against the branch that failed.

Installation

Terminal
pip install opentine

pip install "opentine[anthropic]"
pip install "opentine[openai]"
pip install "opentine[google]"
pip install "opentine[compat]"

Quick Start

quickstart.py
1from opentine import Agent
2from opentine.models.anthropic import Anthropic
3from opentine.tools.search import search
4from opentine.tools.web import fetch
5
6agent = Agent(
7    model=Anthropic("claude-sonnet-4-20250514"),
8    tools=[search, fetch],
9)
10
11run = agent.run_sync("Research the current state of solid-state batteries")
12run.save("battery_research.tine")
Terminal
tine show battery_research.tine
tine verify battery_research.tine
tine fork battery_research.tine --from-step 2 --save retry.tine
tine replay battery_research.tine --mode cache --save replayed.tine
tine diff battery_research.tine retry.tine

Core Ideas

  • Run graphs: A run stores graph.steps as full SHA-256 step IDs mapped to step objects, plus graph.orderfor stable display and compatibility.
  • Content-addressed steps: Step IDs hash the immutable payload: kind, parent_ids, inputs, outputs, model/tool metadata, and error payload. Timing and cost are recorded, but they do not define identity.
  • Versioned artifacts: Current files use format_version: 1. Run.load() rejects missing, old, or future versions instead of guessing.
  • Checksums, not signatures: Run.verify_integrity() and tine verify recompute the SHA-256 digest stored in metadata.integrity. This detects accidental or unsanctioned body edits, but it is not tamper-proof signing.
  • Scoped compatibility: Native opentine agents get full replay and resume primitives. External harnesses are recorded and can be forked or rerun through explicit harness commands; resume works only when a manifest declares support.

What's Next

Start with the Quickstart, then read Serialization for the .tine format and CLI Reference for the current command surface.