harbor

Run Jobs

Loading Trajectories

Seed an agent's session from a previous run's trajectory and resume it

--load-trajectory takes a path to a trajectory recorded by a previous run and loads it as the agent's session before the first invocation, which then resumes the conversation instead of starting fresh:

harbor run -p path/to/task -a claude-code -m anthropic/claude-sonnet-5 \
  --load-trajectory path/to/<session-id>.jsonl

This is a run-level setting (agent.load_trajectory in a job or trial config), not a task field, so the same task can be evaluated with and without prior context. The file's suffix selects the format: .jsonl is a native trajectory, .json is an ATIF trajectory.

Native trajectories (often .jsonl)

A native trajectory is the agent's own session format. The resume is lossless, but the file can only be loaded by the same agent that recorded it. After a trial, the native file is stored in the trial's agent/sessions/ directory:

AgentNative trajectory file
claude-codeagent/sessions/projects/-app/<session-id>.jsonl
codexagent/sessions/<YYYY>/<MM>/<DD>/rollout-*.jsonl

You can copy the file anywhere, but keep its filename: agents locate and validate sessions by name.

ATIF trajectories (always .json)

An ATIF trajectory (the agent/trajectory.json Harbor writes after every trial) is portable: Harbor converts it into the loading agent's native session format on the fly, so a trajectory recorded by one agent can seed another. The trade-off is that the conversion keeps the conversation (messages, tool calls, tool results) but drops agent-specific session details, so it is not bit-for-bit lossless like a native load.

harbor run -p path/to/task -a codex -m openai/gpt-5.1 \
  --load-trajectory jobs/<job>/<trial>/agent/trajectory.json

Agents declare support per format (SUPPORTS_LOAD_NATIVE_TRAJECTORY, SUPPORTS_LOAD_ATIF_TRAJECTORY); today claude-code and codex support both. Unsupported agents, missing files, and invalid trajectory files fail fast before any environment is started.

What is restored

Only the conversation. The agent sees the full prior message history as context, but files the original run created do not exist in the new environment.

For multi-step tasks, the trajectory is loaded before the first step only; combined with --resume-trajectory, the per-step sessions are (load, resume, resume, ...) instead of (load, fresh, fresh, ...).

On this page