Running a Live Session via the CLI

How to use Claude Code and the Archivist to narrate, capture, and broadcast during a live game session, including dice rolls, pictures, voices and game time.

Updated 17 November 2026

What this gives you

When you run a session with Claude Code connected to TxTavern, three things happen automatically:

  • Narration goes to your players, once you approve it. When you ask for a room description or dramatic moment, the Archivist drafts it and waits for you. Say “yes” or “post it” and it lands in the session Feed, where players watching the session page see it arrive live.
  • Significant events get logged. The Archivist flags combat outcomes, reveals, and player decisions as they happen. Confirm them and they’re written down – ready to become the session recap.
  • Nothing leaves the session lost. The live log file is a running record of everything: internal planning, narrated prose, captured events. Post-session, it’s the raw material for your recap and wiki update.

Before the session

1. Create a game session in the app

Go to your campaign and create a session for today’s game. The session needs to exist so Moments have somewhere to land.

Note the session ID from the URL – you’ll use it if the Archivist can’t find it automatically.

2. Open two windows

Window What it’s for
Archivist Your Claude Code terminal – planning, lore, rulings, narration
Scribe Either bin/session-log (tailing the live log) or the session page in your browser

The Scribe window lets you glance at what’s been captured without switching context.

3. Start the live log

The Archivist will create story/sessions/prep/session-NNN-live.md when the session begins. You can also run:

bash bin/session-log # tail the latest session's live log bin/session-log 36 # tail session 36 specifically


During the session

Internal work (stays in the conversation)

Talk to the Archivist normally. Ask questions, plan what’s coming, look up lore, work through rulings. None of this goes to the players – it’s your thinking space.

“What does Marta know about the missing merchant? What’s the most interesting version of this scene?”

Getting narration to your players

When you’re ready to read something aloud, use /txt-narrate:

/txt-narrate The party enters the abandoned mill

Or just ask naturally:

“Give me the room description for when they open the cellar door.”

The Archivist will: 1. Write atmospheric, present-tense, read-aloud prose grounded in your world’s lore, as a single draft 2. Wait for your approval. Nothing reaches the players until you say yes 3. Once approved, deliver it to the Feed (kind: narration) and append it to the live log, marked with >

You read it aloud. The players read it on their screens. The session record has it.

Capturing significant events

The Archivist will flag things that matter:

  • A PC drops to 0 HP
  • An enemy dies
  • A nat 20 lands
  • A secret is revealed
  • The party makes a major decision

When it flags something, confirm to log it:

“Yes, log that.”

It is delivered as a player note and written to the live log. If it’s not significant, just ignore the flag and move on.

You always have the final say. The Archivist never writes canon without confirmation.


After the session

Tell the Archivist the session is over. It will offer to:

  1. Review the live log – walk through what was captured and confirm what’s canon
  2. Draft the session recap – structured write-up from the live log entries
  3. Run the wiki ingest – fan out from the recap and update every NPC, location, and plot thread it touched

The live log already has everything organised: internal notes, narrated passages, flagged events. Post-session work is reviewing, not reconstructing.


Rolling dice in the Feed

Ask your AI to roll and the table sees the dice land in the Feed, with the reason, the individual results and the total.

“Roll Perception for Khorr. Advantage, plus five.”

Your AI uses the roll_dice tool. A few things to know:

  • Notation. Write it the usual way: 1d8+3, 2d20kh1+5 for advantage (keep the highest), 2d20kl1 for disadvantage (keep the lowest), 4d6dl1 to drop the lowest die, or 2d6+1d4-1 to mix dice.
  • The reason is the title of the roll, such as “Perception check”. Players read it, so keep it free of difficulty numbers and other hidden mechanics.
  • Modifiers and an explanation. Ask for labelled modifiers (Dexterity +2, Proficiency +3, Bless +1d4) and they show as chips under the dice. A one-line explanation appears in muted italics, such as “Danny leaps the collapsed shelf.”
  • Crits and fumbles. A natural 20 on a single d20 earns a gold Critical badge. A natural 1 earns a red Fumble.
  • Who rolls. The server rolls the dice, so the result can be trusted. If you rolled at the table, tell your AI the faces and it records those instead.

Showing the outcome or the difficulty

You can give a roll a difficulty class for your own record. Players never see it unless you say so:

  • Say nothing, and players see only the roll.
  • Ask to reveal the outcome, and they see Success or Failure without a number.
  • Ask to reveal the difficulty, and they see both, such as “Failure (DC 15)”.

Hidden rolls

Ask for a hidden roll and it is saved to the session but never sent to players. You see it dimmed, with a Hidden from players badge. Use the show toggle on the moment when you want to reveal it. Players see it the next time they load the page.

Only you can roll into the Feed. Players cannot, and the session form has no way to create a roll.


Anyone at the table can put a picture into the Feed: a photo of the battle mat, a handout, a sketch of the room.

  1. In the Feed form, choose Add a picture and pick a JPEG, PNG, WebP or GIF of up to 10 MB.
  2. Write a note if you like. A picture can go up with no text at all.
  3. Press Send.

The picture appears inside the moment, and a click opens the full-size original in a new tab. Players post pictures as player notes. You can attach one to any kind of moment.

Every picture also lands in the campaign Gallery tab, a grid any member can browse. As DM you can press Remove on a picture to take it out of the gallery. The note stays in the Feed, without its picture. If you hide a moment from players, its picture is hidden from their gallery too.


Voices in the Feed

A line of dialogue can be heard as well as read. When the speaker has a voice, their card in the Feed shows a play button. Anyone at the table can press it, and the line plays while each word lights up as it is spoken. Click any word to jump to it.

To make someone the speaker, start the line with their name in double square brackets:

[[Marta Vance]]: "You came," she says. [[Kaial]]: "Then we go tonight."

The name can be an NPC article or a player character in the campaign. The card shows their picture and name, with an NPC or PC badge.

Giving an NPC a voice

  1. Open the NPC’s article and press Edit.
  2. In Feed Voice, choose a voice from the list.
  3. Press Listen to hear a sample, then save.

You can also ask your AI, for example “find a gravelly old voice for Marta”. It searches the wider voice library with search_voices and sets the voice on her article. A voice it picks from outside your list shows as Current voice in the form.

Choosing your own character’s voice

Players pick the voice for their own character.

  1. Open your character and press Edit.
  2. In Voice, choose a voice from the list.
  3. Press Listen to hear a sample. Try a few until one sounds right.
  4. Save the character.

From then on, any line the DM posts for your character can be played in that voice. The DM can set or change it too. Choose No voice to remove it.


Game time in the Feed

When your campaign has a game date, a strip across the top of the Feed shows the time in your world’s own words, and each moment is stamped with the time it happened. You can hide it from players and move it on with a button. The full guide is Game Time.


Quick reference

What you want How to do it
Narrate to players /txt-narrate or ask for a read-aloud description
Check what’s been captured bin/session-log in a second terminal
Log a significant event Confirm when the Archivist flags it
See players’ live view Session show page in the browser
Roll dice for the table Ask your AI to roll, with a reason
Share a picture Add a picture in the Feed form
Move the game clock The buttons under the time strip
Start post-session review Tell the Archivist “session over”

Requirements

  • TxTavern MCP connected (see Connecting Your AI)
  • Claude Code CLI with the Archivist agent (claude --agent archivist)
  • A GameSession record created in the app before the session starts
  • story/_status.md updated with the current session number (or pass it as an argument to /txt-narrate)