Skip to content

Beats and AI drafts

A scene beat is a card inside a scene where you describe what happens next. Codex sends your AI provider the beat, the text before it and the context entries you add. It shows the reply as a draft under the beat, and nothing reaches the scene until you apply it. You need an AI provider connected first. See AI settings.

Address: /books/<id>/write. Beats and drafts are in Write. A link ending in #scene=1.2 opens that scene.

Scene 1.2 of Salt and Signal in Write, with a scene beat and, under it, an AI draft with the buttons Show what was sent, Apply, Retry and Discard.Scene 1.2 of Salt and Signal in Write, with a scene beat and, under it, an AI draft with the buttons Show what was sent, Apply, Retry and Discard.

A waiting draft shows in two places besides the scene. On Plan, the scene card has a Draft pending tag. In Write, the minimap highlights the scene’s tick. Open the scene to review the draft.

A draft panel has the model’s name, its word count, and four buttons. It appears under the beat that produced it.

To read what the model was given, select Show what was sent. The panel lists the template, the model and the provider, the entries sent as context, the token counts, and the full prompt. Select the button again to close the list.

The draft panel with Show what was sent open, listing the template, model, context, tokens and the prompt text.The draft panel with Show what was sent open, listing the template, model, context, tokens and the prompt text.

To put the draft in the scene, select Apply. The draft text goes into the scene below the beat, and the book bar shows Saving… then Saved. A message at the bottom reads Applied 12 words, with an Undo link.

Scene 1.2 after Apply, with the draft text under the beat and a message reading Applied 12 words with Undo.Scene 1.2 after Apply, with the draft text under the beat and a message reading Applied 12 words with Undo.

Select Undo in that message to take the text out of the scene again. The draft panel comes back under the beat.

Scene 1.2 after Undo, with the draft panel back under the beat.Scene 1.2 after Undo, with the draft panel back under the beat.

To throw the draft away, select Discard. A message reads Draft discarded with an Undo link, and Undo brings the draft back.

Scene 1.2 after Discard, with no draft panel and a message reading Draft discarded with Undo.Scene 1.2 after Discard, with no draft panel and a message reading Draft discarded with Undo.
Scene 1.2 after Undo on the discard message, with the draft panel back.Scene 1.2 after Undo on the discard message, with the draft panel back.

Apply replaces the text under the beat. If the beat already has text under it, the panel says how much. For example, Apply replaces the 90 words below. The current text is kept in history. That text covers every paragraph up to the next beat or the end of the scene. To get it back once the Undo message has gone, open the scene’s version history. See Write.

Retry asks for a new draft with the same settings. The new draft says attempt 2, and the old one goes away once the new one is under way.

While a draft waits, Generate prose reads Regenerate. Regenerate uses the template and model now chosen on the beat. Retry uses the ones that wrote the draft.

This is the full path, in a scene that already has text.

  1. Put the caret in the scene where the beat should go and press Enter to start a new line. Type /scene and choose Scene beat from the AI group of the / menu. A beat card appears.
  2. Type what happens in the box on the card, for example Tobias Venn explains to Edith Marrow why the Fresnel lens turns so slowly. Codex saves the instruction when you leave the box or generate. You can also give the beat a title.
A new scene beat at the end of scene 1.1 with the instruction typed in and the Generate prose button under it.A new scene beat at the end of scene 1.1 with the instruction typed in and the Generate prose button under it.
  1. Choose a target length. Select 200, 400 or 600, or select the pencil, type any whole number of words and press Enter. With no length chosen, Codex asks for 400 words. Select + Context to add Knowledge base entries the model should know about, such as Tobias Venn. Select an entry’s chip to remove it again.
The beat with 400 chosen as its length and a chip for Tobias Venn beside the Context button.The beat with 400 chosen as its length and a chip for Tobias Venn beside the Context button.
  1. Select the name of the template and model beside Generate prose. A list opens with the prompt templates on the left and your provider’s models on the right. Choose a template such as Write in Joel’s voice, then choose a model. The list closes after you choose a model. Codex remembers the choice for this beat until you reload the page.
The template and model list open on the beat, with the templates Continue writing, Write in Joel's voice and Paraphrase and the model fake-model.The template and model list open on the beat, with the templates Continue writing, Write in Joel's voice and Paraphrase and the model fake-model.
  1. Select Generate prose, or press Ctrl+Enter in the instruction box. The button stays dimmed until Codex saves the instruction, which happens when you leave the box. While the model writes, a panel titled Generating… streams the text in. Select Stop to end generation early and keep the text received so far. The panel reads Stopped until you reload the page. If no text has arrived, Stop leaves no draft. When the model finishes, the panel becomes a draft with the four buttons.
The beat with Write in Joel's voice chosen and, under it, the AI draft.The beat with Write in Joel's voice chosen and, under it, the AI draft.
  1. Select Retry if you want another try. The line beside AI draft now reads attempt 2.
The draft panel after Retry, with attempt 2 beside the AI draft title.The draft panel after Retry, with attempt 2 beside the AI draft title.
  1. Select Apply. The draft text goes in under the beat.
Scene 1.1 after Apply, with the 12 draft words under the beat and a message reading Applied 12 words with Undo.Scene 1.1 after Apply, with the 12 draft words under the beat and a message reading Applied 12 words with Undo.
  1. Edit the text by hand. Applied text has no marker in the scene, so you edit it like text you typed.
Scene 1.1 with the sentence Tobias had counted them twice added by hand after the applied text.Scene 1.1 with the sentence Tobias had counted them twice added by hand after the applied text.
  1. To read the scene without the beat cards, select Format in the book bar. In the Scene beats row, select Hide. The beats stay in the scene and the text under them stays. A waiting draft hides with its beat.
The Format list open with the Scene beats row showing Show and Hide.The Format list open with the Scene beats row showing Show and Hide.
Scene 1.1 with the beat cards hidden and only the scene text showing.Scene 1.1 with the beat cards hidden and only the scene text showing.

To hide a single beat, select Hide on its card. A hidden beat shrinks to one line with a Show button. Select Show to bring the card back. Use the ⋮ menu on a beat to move it up or down, or to delete it with or without the text under it. Drag the grip on the left to move a beat, or press Alt with Up or Down while the grip has focus. Clear beat empties the instruction.

Use this when a scene has only a summary. The steps use a new scene in chapter 1 of Salt and Signal.

  1. On Plan, select New scene in chapter 1. Type a summary in the new card. Type @Fres and choose Fresnel lens to mention it. Select Label on the card and choose a label such as Needs research. The summary saves when you click away. The label saves when you choose it.
The Plan with a new scene 3 in chapter 1, with a summary that mentions Fresnel lens, the label Needs research, and the text Not written.The Plan with a new scene 3 in chapter 1, with a summary that mentions Fresnel lens, the label Needs research, and the text Not written.
  1. On the scene card, select the ⋮ menu, then Open in Write. Write opens at the scene, with the same summary and label in the gutter.
Write at the new scene 3, with its summary and label in the gutter and an empty editor.Write at the new scene 3, with its summary and label in the gutter and an empty editor.
  1. Type /scene in the empty scene and choose Scene beat. Type the instruction in the card.
The new scene with a scene beat and the instruction Tobias Venn shows the new keeper how to read the lens and what to log.The new scene with a scene beat and the instruction Tobias Venn shows the new keeper how to read the lens and what to log.
  1. Select Generate prose. A draft appears under the beat. Review it, then apply, retry or discard it as above.
The new scene with a draft under the beat and the buttons Show what was sent, Apply, Retry and Discard.The new scene with a draft under the beat and the buttons Show what was sent, Apply, Retry and Discard.

To get a draft from the end of a scene, with no beat, start a new line in the scene, type /cont and choose Continue writing. Codex writes from where the text stops. The draft panel appears at the end of the scene. Apply adds the draft to the end of the scene. Codex uses the template Continue writing and your default provider.

The end of scene 2.1 with an AI draft panel below the last paragraph.The end of scene 2.1 with an AI draft panel below the last paragraph.

Without a provider, a beat shows a link, Connect an AI provider in Settings, where Generate prose and the template and model button would be. Select it to open the AI settings. A draft that was already waiting stays under the beat. Apply and Discard still work. Retry fails with AI integration not found., because the provider that wrote the draft is gone.

A beat with the link Connect an AI provider in Settings where Generate prose would be, and a waiting draft below it.A beat with the link Connect an AI provider in Settings where Generate prose would be, and a waiting draft below it.

If you choose Continue writing with no provider, Codex shows a message reading Connect an AI provider in Settings to draft prose.

Scene 2.1 after choosing Continue writing with no provider, with the message Connect an AI provider in Settings to draft prose.Scene 2.1 after choosing Continue writing with no provider, with the message Connect an AI provider in Settings to draft prose.

An agent that asks for a draft with no provider connected gets Connect an AI provider in Settings → AI to write drafts. The app shows the link instead of sending that request, so you see this text only from an agent.

If the provider rejects your key, the draft panel reads Draft failed, with the message <provider> rejected the API key. Check it in Settings → AI. and the buttons Retry and Dismiss. Fix the key in AI settings, then select Retry.

A rate limit looks different by provider. With an Anthropic provider, the panel reads Rate limited. Try again in 30 s, and Retry stays dimmed until the count reaches zero. An OpenAI-compatible or OpenRouter provider reads <provider> is busy right now. Try again in a moment., and Retry works at once.

Drafts need the Edit role or higher. With the View or Comment role, a beat shows its title and instruction, with no grip, no menu, no buttons and no draft panel. See Sharing a book.

Scene 1.2 for a reader with the View role, showing the beat card with its title and instruction and no draft panel.Scene 1.2 for a reader with the View role, showing the beat card with its title and instruction and no draft panel.
Keys What happens
Ctrl+Enter in a beat’s instruction Generates a draft, as Generate prose does.
Alt and Up or Down on a beat’s grip Moves the beat one place.
Esc in the template and model list Closes the list.

Every other key is in Keyboard shortcuts.