# Compile a skill from an existing session with reelier from-session

You already ran the workflow once — an agent pulled the data, checked the statuses, wrote the report, and you paid the tokens for it. `reelier from-session` reads that finished transcript and lifts the tool calls out of it into a `SKILL.md` you can replay forever, without re-running the agent or spending another token to get the skill.

This guide walks the whole thing: find the session transcript you already have, compile it with `from-session --name`, read the markdown file it wrote, and replay it. Every command is real and the compile output below is verbatim from an actual run.

Markdown twin of https://www.reelier.com/guides/from-session-compile — a step-by-step Reelier how-to. Every command below is a real Reelier command and every output block is verbatim, never a mockup.

## Before you start

- Reelier installed — `npm i -g reelier` (or drop `npx -y reelier@latest` in front of every command below).
- One finished agent session whose value was in its tool calls — a data pull, a status sweep, a report. Reelier compiles tool calls (`mcp__server__tool`, `http.get`/`http.post`); it filters out `Bash`/`Read`/`Edit`/`Write`/`Grep`, so a session that was mostly file edits has little to lift.
- Nothing else. No account and no API key — compiling a transcript never calls a model.

## 01 · Find the session you already ran

Claude Code writes every session to a JSONL transcript under `~/.claude/projects/<project>/<uuid>.jsonl` as it goes — so the run you want to freeze is already on disk. Pick the one whose worth was in its API or MCP calls, not its file edits. (Where each agent keeps its history, and why Cursor is wrap-proxy capture only, lives on the platform page — this guide stays on the how-to.)

If you are not sure which transcript holds the workflow, `reelier scan` lists the replayable ones and ranks the read-only sessions first. Once you know the file, you point `from-session` straight at it — that is the next step.

## 02 · Compile it with from-session --name

Point `from-session` at the transcript. It reads the recorded tool calls, keeps only the ones Reelier can deterministically replay, and writes a `SKILL.md`. The `--name` flag gives the skill a clean name instead of the transcript's raw UUID stem — here the compiled file becomes `pr-status-check.skill.md`.

The two calls in this session were read-only MCP data pulls, so both survive the honesty filter and land as steps. The compiler writes minimal assertions: each step that recorded a clean result gets exactly one shape assert (`status == 200`), and nothing brittle is pinned — `binds: 0` here, no value hard-coded from a prior response. It also tells you the truth before you schedule anything: `✓ all 2 steps are read-only — safe to replay repeatedly`.

The `Open questions` block is the part Reelier refuses to guess about. It spotted `seldonframe` and `reelier` repeated across both calls and suggested promoting them to `{{input}}` variables — a suggestion, not a silent rewrite. What skill compilation is, in full, is defined in the glossary; this is the command that does it.

```bash
reelier from-session 9f3c1e2a-7b04-4d1a-9c8e-2a4f6b0d1e77.jsonl --name pr-status-check
```

```
Scanned 9f3c1e2a-7b04-4d1a-9c8e-2a4f6b0d1e77.jsonl: 2 replayable call(s) found.


Wrote pr-status-check.skill.md
  steps:   2
  asserts: 2
  binds:   0
  MCP servers used: github

✓ all 2 steps are read-only — safe to replay repeatedly

Open questions (2):
  - Step 1: Value "seldonframe" appears literally in steps 1, 2 and was never found in any prior result — consider promoting it to an {{input}} variable instead of repeating it.
  - Step 1: Value "reelier" appears literally in steps 1, 2 and was never found in any prior result — consider promoting it to an {{input}} variable instead of repeating it.
```

## 03 · Read what it wrote

The output is plain markdown, checked into your repo — not a binary artifact. Open `pr-status-check.skill.md` and the two steps read straight across from the session: `action: list_pull_requests {"owner":"seldonframe","repo":"reelier","state":"open"}` with `assert: status == 200` and `effect: read`, then `action: list_issues {...}` on the same terms. The frontmatter stamps its provenance — `recorded_with: reelier v0.14.0` and the compile date — so the file says where it came from.

The `Open questions` from the compile are written into the file too, under their own heading, waiting for you. This is where you edit: promote `owner`/`repo` to `{{input}}` variables, tighten a title, add narration. Because a step with no recorded result never gets an assert, it would replay `unchecked` — never falsely `passed` — so you always know exactly what is being checked and what isn't.

## 04 · Replay the skill you just compiled

Now run it. MCP-tool steps replay against their server, so pass the same GitHub MCP server you recorded through `--wrap`. At the default Level 0 the LLM is never constructed — 0 tokens — and Reelier re-issues the two `list_` calls against the live server and checks each `status == 200`. That deterministic core is the whole replay; there is no model re-reasoning anything.

Because both steps are read-only, this is safe to run on a schedule or in CI: replaying it re-reads, it never re-writes. A recorded write step would not re-fire on replay unless you passed `--allow-writes` (idempotent writes only) — and a destructive step would still need `--yes` — which a read-only pull like this sidesteps entirely. To wire the replay into a zero-token scheduled check, see the sibling guide.

```bash
reelier run pr-status-check.skill.md --wrap "<your GitHub MCP server command>"
```

## The receipt

```
$ reelier from-session 9f3c1e2a-7b04-4d1a-9c8e-2a4f6b0d1e77.jsonl --name pr-status-check
Scanned 9f3c1e2a-7b04-4d1a-9c8e-2a4f6b0d1e77.jsonl: 2 replayable call(s) found.


Wrote pr-status-check.skill.md
  steps:   2
  asserts: 2
  binds:   0
  MCP servers used: github

✓ all 2 steps are read-only — safe to replay repeatedly

Open questions (2):
  - Step 1: Value "seldonframe" appears literally in steps 1, 2 and was never found in any prior result — consider promoting it to an {{input}} variable instead of repeating it.
  - Step 1: Value "reelier" appears literally in steps 1, 2 and was never found in any prior result — consider promoting it to an {{input}} variable instead of repeating it.
```

A whole skill lifted out of a session that already happened, verbatim: `reelier from-session` compiled a two-call Claude Code-style transcript into a read-only `pr-status-check` skill with two minimal asserts and zero binds. Produced on 2026-07-22 with `reelier` v0.14.0 in a scratch directory; the transcript held two read-only MCP calls (`list_pull_requests`, `list_issues`) shaped per `reelier/test/session.test.ts`. No model was constructed at any point; the absolute path in the `Wrote` line is shortened to the bare filename.

## FAQ

**Do I have to re-run the agent to get the skill?**

No — that is the point. `from-session` lifts the skill out of a transcript that already exists, so you pay the model tokens once (when the agent did the work) and never again to produce the skill. It builds steps only from calls that actually happened, never from instruction text.

**My session was mostly file edits and shell commands. Will it compile?**

Reelier replays MCP/tool calls plus the `http.get`/`http.post` builtins — not `Bash`/`Read`/`Edit`/`Write`/`Grep`. Those native tools are filtered out and reported as skipped. If a transcript has zero replayable calls, `from-session` refuses to compile rather than fabricate a skill. Pick a session whose value was in its API or MCP calls.

**It left open questions. Is the compiled skill broken?**

No. The skill replays as-is; the questions are Reelier declining to guess. Here it flagged two repeated literals to promote to `{{input}}` variables — resolve them when you want the skill parameterized, or leave them. Assertions stay minimal: only steps with a clean recorded result get one, so nothing is being over-claimed.

## Related

- [Skill compilation — what from-session does to a transcript, defined](https://www.reelier.com/learn/skill-compilation)
- [Reelier for Claude Code — where your session transcripts live, and how capture works](https://www.reelier.com/for/claude-code)
- [Guide: replay the compiled skill at Level 0 for 0 tokens](https://www.reelier.com/guides/replay-agent-workflow-zero-tokens)
- [Guide: compile a deterministic twin of an LLM-executed skill with --from-skill](https://www.reelier.com/guides/convert-agent-skill-deterministic)
- [MCP recording — how the tool calls got into the transcript in the first place](https://www.reelier.com/learn/mcp-recording)

## Sources

- [seldonframe/reelier — the open-source (AGPL-3.0) CLI every command here runs](https://github.com/seldonframe/reelier)
- [reelier on npm — the published package behind `npm i -g reelier`](https://www.npmjs.com/package/reelier)

Other guides: [How to snapshot-test a Claude Code workflow](https://www.reelier.com/guides/snapshot-test-claude-code-workflows) · [How to record MCP tool calls with a wrap proxy](https://www.reelier.com/guides/record-mcp-tool-calls) · [How to replay an agent workflow at 0 LLM tokens](https://www.reelier.com/guides/replay-agent-workflow-zero-tokens) · [How to gate CI on agent drift](https://www.reelier.com/guides/ci-gate-for-agent-drift) · [Replay an agent skill on every PR with the Reelier GitHub Action](https://www.reelier.com/guides/github-action-agent-replay) · [Test your MCP server for regressions by replaying a golden run](https://www.reelier.com/guides/test-mcp-servers) · [Run a deterministic cron agent by scheduling a recorded replay](https://www.reelier.com/guides/deterministic-cron-agents) · [Build an agent audit trail from Reelier run receipts](https://www.reelier.com/guides/agent-audit-trail-receipts) · [Configure BYOK escalation levels: L0, L1, and L2](https://www.reelier.com/guides/byok-escalation-levels) · [Diff two agent runs with reelier diff (exit 1 on drift)](https://www.reelier.com/guides/diff-two-agent-runs) · [Convert an LLM agent skill into a deterministic, assertion-checked skill](https://www.reelier.com/guides/convert-agent-skill-deterministic)
