Toolpath
The story of how we got here.
Toolpath is an open format for coding-agent sessions: one schema that
records what an agent did, why, what it tried that didn't work, and
what it cost, independent of which agent did it.
Every agent writes its own undocumented session log. Claude Code keeps
rotating JSONL chains, Codex writes rollout files, Gemini has chat
directories, Copilot an event stream, opencode a SQLite database,
Cursor a composer store, Pi session trees. Toolpath reads them all into
one format and writes them back. With everything in one format you can:
- Portability. Share a session and resume it on another machine or
in another harness. A session started in Claude Code can be picked up
in Codex.
- An archive you control.
path p cache sync incrementally ingests
every session on the machine into plain JSON under ~/.toolpath/.
- Unified tooling. A tool written against one schema works for
every harness at once, instead of needing a parser per agent.
path query is the built-in example: it searches and aggregates
across every session on the machine, whoever wrote them, using jq
filters.
- Token accounting. Real session totals, per-step attribution where
the source reports it, and reasoning breakdowns, even though every
provider reports usage differently.
- Provenance. Who changed what, why, and what was tried and
abandoned. The record that git collapses at merge time.
Supported harnesses
| Harness | Read | Write | Resume | Notes |
|---|
| Claude Code | ✓ | ✓ | ✓ claude -r | Rotated session files merged into one chain; projected sessions load in Claude Code |
| Gemini CLI | ✓ | ✓ | ✓ gemini --resume | Sub-agent sessions folded in; reasoning tokens round-trip losslessly |
| Codex CLI | ✓ | ✓ | ✓ codex resume | Real unified diffs on every file change; per-step token attribution |
| Copilot CLI | ✓ | ✓ | ✓ copilot --resume | Preview; projected sessions verified to resume in copilot 1.0.67 |
| opencode | ✓ | ✓ | ✓ opencode --session | File diffs recovered from opencode's git snapshots |
| Cursor (IDE) | ✓ | ✓ | ✓ opens workspace | Projected composers render in Cursor.app's chat sidebar |
| Pi | ✓ | ✓ | ✓ pi --session | Branching session trees preserved as DAGs |
Read means path p import, path p list, and path show. Write means
path p export. Resume means path resume, which projects the session
into the harness's on-disk layout and execs its resume command. Any
readable session can be projected into any writable harness; a
cross-harness conformance matrix in CI exercises the pairs.
Beyond sessions
Agent sessions are one kind of path. Toolpath is a general format for
how artifacts change across the development lifecycle, so the session
that wrote a change, the pull request that reviewed it, and the release
that shipped it can share one graph. path p import git derives paths
from commit history and path p import github from GitHub pull
requests, review threads, CI runs and comments included; path p merge
combines documents into a single Graph.
Install
# Prebuilt binary (macOS arm64, Linux x86_64/arm64)
curl --proto '=https' --tlsv1.2 -fsS https://toolpath.net/install.sh | bash
# From source
cargo install path-cli
Both install a binary called path.
Claude Code users can skip the manual install entirely: the Toolpath plugin
bundles the CLI (downloaded and installed globally on first use) and adds
/path:share and /path:query slash commands:
/plugin marketplace add empathic/toolpath
/plugin install path@toolpath
See plugins/claude-code for details.
Quick start
# Archive every agent session on this machine (all harnesses, incremental)
path p cache sync
# Query across all of them with a jq filter, regardless of which agent
# produced them: dead ends, expensive turns, and so on
path query 'map(select(.dead_end)) | length'
path query --source claude 'map(select(any(.change[].structural.token_usage; .input_tokens > 50000)))'
# Share a session: interactive picker across every installed harness,
# sessions from the current project ranked first
path share
# Resume a shared session, in the original harness or a different one
path resume https://pathbase.dev/alex/pathstash/path-pr-42
path resume claude-<session-id> --harness codex -C /path/to/project
Each of those is built from lower-level plumbing commands you can
compose yourself:
# Import a specific session into the local cache (~/.toolpath/documents/),
# or straight to stdout for shell composition
path p import claude --project /path/to/project --session <id>
path p import codex --no-cache | path p render md --detail full
# Derive from git history or a GitHub PR
path p import git --repo . --branch main
path p import github https://github.com/owner/repo/pull/42