# Drafts

> A draft is the project code.extension.dev saves to your account as you work, with its conversation, so you can reopen it on any browser.

Canonical: https://docs.extension.dev/code/drafts
This page as Markdown: https://docs.extension.dev/code/drafts.md
Section: Code
Siblings: [AI generation](https://docs.extension.dev/code.md) · [Terminal](https://docs.extension.dev/code/terminal.md) · [Chat mode](https://docs.extension.dev/code/chat-mode.md) · [Starters and templates](https://docs.extension.dev/code/starters.md) · [Live preview](https://docs.extension.dev/code/preview.md) · [Select to edit](https://docs.extension.dev/code/select-to-edit.md) · [The Code tab](https://docs.extension.dev/code/code-tab.md) · [Build console](https://docs.extension.dev/code/build-console.md) · [Checkpoints](https://docs.extension.dev/code/checkpoints.md) · [Firefox engine](https://docs.extension.dev/code/firefox-engine.md) · [Download and run locally](https://docs.extension.dev/code/download-and-run.md) · [Share links](https://docs.extension.dev/code/share.md) · [Publish and import](https://docs.extension.dev/code/publish.md) · [Generation allowance](https://docs.extension.dev/code/allowance.md) · [Settings and sign-in](https://docs.extension.dev/code/settings.md)
Map of every page: https://docs.extension.dev/llms.txt · Whole corpus: https://docs.extension.dev/llms-full.txt

---

# Drafts

A draft is a project before it becomes a repository, saved to your account
as you work. Reach for `/drafts` when you want to reopen, switch, delete or
restore one.

## Quick start

Open `code.extension.dev/drafts`. **Cloud drafts** lists what your account
holds, and each row opens at `/drafts/<id>`. The project switcher in the
header offers **New project**, and a search box reading **Find a project**
filters your drafts by name.


## How it works

### What syncs

Every change to the files is pushed to your account, and the terminal
conversation is pushed with it, parked branches included. Open the same
draft on another browser and the terminal resumes where it stopped. Chat
mode's history travels inside the draft the same way.

Sync needs a sign-in. Signed out, the work stays in this browser only. If
your session ends mid-work, a notice reads **Your session expired** with the
time of the last saved edit and a **Sign in and keep saving** button.

### The draft in this browser

The browser also keeps the open draft in the tab that made it. Each tab
holds its own database, which sends a heartbeat every 10 seconds. A database
whose heartbeat is 45 seconds old is swept on a later start. Closing the tab
is not a save. The draft on your account is.

### Three lists

| Section | What it holds |
| --- | --- |
| **Cloud drafts** | Drafts synced to your account, each with **Delete** |
| **Recently deleted** | Deleted drafts and their conversations, kept 30 days, each with **Restore** |
| **In this browser** | The draft this browser has open right now |

### The project switcher

The control in the header that shows the project's slug opens the switcher.
**New project** starts a fresh extension. A row that names the template
the project is based on offers **Start another project from the same
template** and opens `/?template=<slug>`. **Find a project** filters your other cloud drafts
by name or slug.

### Older addresses

Links of the shape `/s/<id>` still open and are rewritten to `/drafts/<id>`
on the first render. The canonical address also carries the engine, such as
`/drafts/<id>/chromium`.

## Reference

| Limit | Value |
| --- | --- |
| Drafts per account | 100 |
| Size of one draft | 4 MB |
| Files in one draft | 300 |
| New drafts per UTC day | 300 |
| Deleted drafts kept | 30 days |
| Tab heartbeat | Every 10 seconds |
| Tab database swept after a stale heartbeat of | 45 seconds |

## When it fails

- **A notice reads "Your account has no room for this draft".** The account
  holds 100 drafts. Edits since the time shown are saved only in this
  browser. Delete drafts you no longer need from `/drafts`, then the next
  change saves again.
- **The server answers that the draft is too large.** A draft holds 4 MB. Ask
  the agent to drop generated or binary files, or download the source and
  continue on your machine.
- **Too many new drafts today.** The account created 300 drafts this UTC day.
  The notice names the minutes until the window opens again.
- **Work disappeared when you reopened the browser.** The copy in this
  browser belongs to one tab and is swept once that tab is gone. Open the
  draft from `/drafts`, where your account keeps it.
- **A deleted draft is gone from Recently deleted.** Deleted drafts are kept
  30 days, then removed.

## Next

- [Checkpoints](/code/checkpoints) for what stays in this browser
- [Publish and import](/code/publish) for turning a draft into a repository
- [Starters and templates](/code/starters) for starting another project from
  the same template
