by letta-ai
Convert sessions across harnesses to a unified trajectory format - designed to be consumed by agents (e.g. for memory formation, dreaming, search)
# Add to your Claude Code skills
git clone https://github.com/letta-ai/trajectorytrajectory is an open-source ai agents skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by letta-ai. Convert sessions across harnesses to a unified trajectory format - designed to be consumed by agents (e.g. for memory formation, dreaming, search). It has 58 GitHub stars.
trajectory's catalog security scan is still queued. You can run an instant dependency and prompt-injection check now with the "Scan for vulnerabilities" button above.
Clone the repository with "git clone https://github.com/letta-ai/trajectory" and add it to your Claude Code skills directory (see the Installation section above).
trajectory is primarily written in TypeScript. It is open-source under letta-ai on GitHub, so you can review or fork the full source.
Yes. SkillsLLM lists many other AI Agents skills you can browse and compare side by side. Open the AI Agents category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh trajectory against similar tools.
No comments yet. Be the first to share your thoughts!
Unlocks once the catalog security scan passes (runs nightly).
The deep catalog scan for this skill is still queued. Run an instant dependency check now instead.
Normalize agent transcripts from different runtimes into one validated, model-ready record format.
Agent tools represent the same concepts—messages, reasoning, tool calls, and
tool results—in incompatible native formats. trajectory provides one
TypeScript API that turns those formats into deterministic,
structured records for training, evaluation, analysis, and inference.
The caller supplies a transcript string and its source. The one exception is
Deep Agents, whose sessions normalizeCheckpoint reads from its local
LangGraph SQLite store by thread ID; see
src/adapters/deepagents/.
The TypeScript package is published as
@letta-ai/trajectory:
npm install @letta-ai/trajectory
import { normalizeTranscript } from "@letta-ai/trajectory";
const { records, diagnostics } = normalizeTranscript({
source: "codex",
transcript: rawJsonl,
});
records contains the normalized trajectory. diagnostics is always present
and is empty when the transcript required no recoverable cleanup.
{
"records": [
{ "role": "meta", "source": "codex" },
{
"role": "user",
"content": "Check the current directory.",
"timestamp": "2026-07-10T12:00:00.000Z"
},
{
"role": "assistant",
"content": null,
"tool_calls": [
{
"id": "call_1",
"name": "exec_command",
"args": "{\"cmd\":\"pwd\"}"
}
],
"timestamp": "2026-07-10T12:00:01.000Z"
},
{
"role": "tool",
"tool_call_id": "call_1",
"content": "/workspace",
"timestamp": "2026-07-10T12:00:02.000Z"
}
],
"diagnostics": []
}
source |
Accepted input format | Normalized meta.source |
|---|---|---|
claude-code |
Native Claude Code JSONL | claude-code |
codex |
Native Codex rollout JSONL | codex |
hermes |
Session-store message-row array or a { "session": {...}, "messages": [...] } envelope |
hermes |
letta-code |
Letta Code client transcript.jsonl |
letta-code |
openclaw |
Native OpenClaw session JSONL (pi-agent session format) | openclaw |
openhands |
JSON event array or an events-API { "items": [...] } envelope |
openhands |
pi |
Native pi-coding-agent session JSONL | pi |
deepagents |
Deep Agents CLI LangGraph SQLite store plus threadId |
deepagents |
Each adapter lives in its own folder under src/adapters/
with a README documenting the exact input contract, decoding behavior, and
what the adapter drops.
listTrajectories() enumerates the sessions in a source's standard local
store, newest first, with cursor pagination. It is a discovery layer beside
normalization — normalizeTranscript() itself never touches the filesystem.
import { listTrajectories } from "@letta-ai/trajectory";
let cursor: string | undefined;
do {
const page = await listTrajectories({ source: "claude-code", limit: 100, cursor });
for (const item of page.items) {
// item.id, item.path, item.updatedAt?, item.title?, item.sizeBytes?
}
cursor = page.nextCursor;
} while (cursor);
A trajectory is an ordered array containing:
meta record identifying the source and available session
metadata.user and assistant prose records.reasoning records when the source exposes reasoning.tool records linked to earlier calls by tool_call_id.Every conversational record has an ISO timestamp. The complete contract is
available as both runtime validation and
schema/trajectory-v1.schema.json.
The public function is:
normalizeTranscript(input: NormalizeInput): NormalizeResult
Each native format is implemented as a focused adapter that decodes source events into the shared internal message/tool contract. Common validation, linking, repair, timestamp handling, and bounds remain in the normalization core.
Use prompts/add-source.md with a coding agent to add
a source from a local transcript corpus. The prompt covers privacy-safe corpus
inspection, sanitized fixtures, compatibility checks, and the transcript-only
API boundary.
Requires Node.js 20+ and Bun for development:
bun install
bun run check
bun run check runs typechecking, the complete test suite, and the package
build. It also regenerates the JavaScript runtime embedded in the Python wheel
and fails if the committed bundle was stale. Run the Python parity suite with:
PYTHONPATH=python/src python3 -m unittest discover -s python/tests -v
See PARITY.md for compatibility checks performed against real
transcript corpora and production source adapters.
See SOURCE_VERSION_AUDIT.md for the privacy-safe
source-version inventory, observed format families, and current decoder gaps.
Apache-2.0. See LICENSE.