Treeship
Integrations

OpenClaw

Integrate Treeship with OpenClaw agents using the TREESHIP.md skill file. Zero code changes, drop-in instrumentation.

OpenClaw agents pick up skills from markdown files in their skills directory. The TREESHIP.md skill file instructs any OpenClaw agent to produce verifiable session receipts with zero code changes.

Integration pattern

OpenClaw uses the instruction boundary pattern: the agent reads TREESHIP.md as a skill and follows the instructions to wrap commands, set environment variables, and manage session lifecycle. No SDK, no middleware, no dependency. One file.

This is also the universal fallback for any agent framework that accepts instruction files. If an agent can read markdown and run shell commands, it can produce Treeship receipts.

Setup

Install Treeship CLI

curl -fsSL treeship.dev/install | sh
treeship init

Add the TREESHIP.md skill

Copy TREESHIP.md from the Treeship repo root into your OpenClaw skills directory:

cp TREESHIP.md /path/to/openclaw/skills/

Or download it directly:

curl -o skills/TREESHIP.md \
  https://raw.githubusercontent.com/zerkerlabs/treeship/main/TREESHIP.md

Run your agent

The skill instructs the agent to manage session lifecycle automatically:

# Agent starts session, wraps commands, closes with narrative, uploads receipt
# All handled by the TREESHIP.md instructions

After the agent completes its task, check the receipt:

treeship package inspect .treeship/sessions/<session_id>.treeship
treeship package verify .treeship/sessions/<session_id>.treeship

What the skill instructs

The skill covers three scenarios:

Session start: the agent runs treeship session start --name "<task>" and sets TREESHIP_MODEL, TREESHIP_TOKENS_IN, TREESHIP_TOKENS_OUT, TREESHIP_COST_USD environment variables.

Command wrapping: every shell command is prefixed with treeship wrap --. This creates a signed artifact for each command and records it in the session timeline.

Session close: the agent calls treeship session close with --headline, --summary, and --review flags for a meaningful narrative, then treeship session report to upload.

What appears in the receipt

SectionContentCapture method
Agent identityAgent name, model, hostTREESHIP_MODEL env var [AUTO]
TimelineEvery wrapped command in ordertreeship wrap events [AUTO]
CommandsFull command strings with exit codesProcess events [AUTO]
Cost and tokensModel, input/output tokens, cost per wrapEnv vars [EXPLICIT]
NarrativeHeadline, summary, reviewCLI flags at close [EXPLICIT]
File operationsCreated/modified/deleted filesFile snapshot diff [AUTO]
Merkle proofCryptographic commitmentAutomatic [AUTO]
Sensitive reads.env, .ssh, .aws file accessDaemon atime detection [EXPLICIT]
Network connectionsExternal API callstreeship session event [EXPLICIT]

[AUTO] means captured automatically by treeship wrap. [EXPLICIT] means the agent or operator must set an env var, run a command, or start the daemon for this data to appear.

Subagent support

If your OpenClaw agent spawns subagents, each subagent should use a different --actor URI:

# Main agent
treeship wrap --actor agent://openclaw-main -- research "topic"

# Subagent
treeship wrap --actor agent://openclaw-researcher -- fetch "papers"

# Handoff between agents
treeship session event --type agent.handoff \
  --actor agent://openclaw-researcher \
  --destination agent://openclaw-main \
  --artifact-id art_abc123

All receipts chain together automatically via the .last file. The receipt agent graph shows each subagent as a separate node.

Works with any agent

The TREESHIP.md skill is not OpenClaw-specific. Any agent that reads markdown instructions can use it:

  • OpenClaw: drop in skills/TREESHIP.md
  • Claude Code: add to CLAUDE.md or reference as a project file
  • Custom agents: include in the system prompt or instructions
  • CI/CD: source the instructions in your pipeline script