---
title: Code in Ysra's cloud
description: "Run Code in Ysra's cloud on a GitHub repository or a new cloud project: the machine each thread gets, your plan's limits, cloud environments, and what to do when a thread won't start."
new_in: "3.5"
---

A **cloud thread** is a Code thread that works on a machine in Ysra’s cloud
instead of on your computer, so your computer can be closed while it works.
Use it for a GitHub repository you don’t have checked out, or for something
new with no repository at all (a **cloud project**). This page covers the two
kinds, the machine’s life, the limits and the environments; previews are on
[Previews](previews.md).

## The rule

Each turn of a cloud thread gets a private machine of its own. The files the
work saves outlive the machine: when a machine stops or is deleted, the next
turn starts a fresh one from the saved files. Nothing leaves the machine
unless you download, publish, deploy, push or add a repository.

## On your computer or in the cloud

| | On your computer | In Ysra’s cloud |
|---|---|---|
| Works on | A folder on your computer or a device | A GitHub repository, or a cloud project |
| Start it from | The desktop app or the CLI | The web app or the desktop app |
| Machine | Yours | A cloud machine, set by a [cloud environment](#cloud-environments) |
| Costs | Credits for the model | Credits for the model, plus cloud time: about 41 credits an hour (standard), about 67 (large) |
| Needs | The app running on that computer | A plan with cloud, and cloud on for the account |

## Cloud threads and cloud projects

| | On a GitHub repository | A cloud project |
|---|---|---|
| What it is | A copy of your repository, on a branch of its own | An empty folder that Ysra keeps between turns |
| Pick it under **Where** | The repository, in the **Ysra’s cloud** group | **New cloud project** (“No repository needed”) |
| Needs | GitHub connected ([GitHub](../integrations/github.md)) | Nothing |
| Where the files are kept | Your repository and the thread’s branch | Ysra keeps them; each turn starts from the last saved files |
| Internet from the machine | GitHub and the package registries the repository uses | npm and PyPI to begin with; then the registries the project uses |
| Delivering | Push, or open a pull request | **Download project**, **Publish**, **Deploy**, or **Add repository…** |
| Commit and push | Through delivery: Ysra commits and pushes the thread’s branch when you deliver | No: “This project is kept in Ysra’s cloud, so there's nothing to push. Add a repository to send it to GitHub.” |
| The first-time notice | About copying your code to a private machine | “Your project lives in Ysra's cloud: each time you ask, a private machine of its own builds it, and your files are kept between turns. …” |

Both kinds show the same plan, steps, checks and changes as a thread on your
computer, and are listed in Code with your other threads, marked
**Ysra cloud**. Both can be [previewed](previews.md), reviewed with
[Mayz](mayz.md), and deployed ([Publish or Deploy](publish-and-deploy.md)).

### Adding a repository to a cloud project

**Add repository…**, in the project’s panel, sends the project’s files to one
of your GitHub repositories; from then on the thread works as a repository
thread. To use a new repository, create it on GitHub, connect it to Ysra,
then add it.

### Download project

**Download project** saves the latest saved files as a zip, without `.git` or
installed packages such as `node_modules`. It is for cloud threads only; on
your computer the files are already yours.

## Starting a cloud thread

<div class="steps" markdown>

### Choose where

In Code’s start box, “What do you want to build?”, open **Where** and pick
**New cloud project** or a repository. If GitHub isn’t connected, the list
offers **Connect GitHub…**.

### Choose the environment

**Cloud environment** says which machine the thread works on, such as
**Default · Trusted**. Keep it, choose another, or **Set up an environment…**.

### Send

Describe the work and send. The first time, a short notice explains the
cloud: choose **Continue**.

</div>

Without cloud on for the account, the start box lists no repositories, no
cloud project and no environments.

## The machine’s life

| Moment | What happens |
|---|---|
| A turn starts | A machine starts, restores the files (or clones the repository), runs the setup script, then works. A failed start is not charged. |
| The app needs a database | PostgreSQL is available on the machine and starts when the work needs it. There is nothing to set up. |
| The cloud is busy | The thread waits for a machine: “Ysra’s cloud is busy right now. Your task starts as soon as a machine frees up.” |
| The task ends | The machine pauses. The saved files stay. |
| 24 hours after its tasks end | The paused machine is deleted. The saved files stay; the next turn starts a fresh machine. |
| The machine is lost mid-task | The task is picked up again on a new machine. See [How a Code thread works](how-a-thread-works.md#the-machine-is-lost). |
| A [preview](previews.md) runs | It opens through Ysra on a private link; the machine's own address isn't public. It stops after 15 minutes with nobody looking, and gives way when a task needs the machine. |

## Limits

Today’s limits per plan; they may change. Without a plan there is no cloud.

| Limit | Starter | Pro | Max | Team (per seat) |
|---|---|---|---|---|
| Machine sizes | Standard | Standard, Large | Standard, Large | Standard, Large |
| Cloud threads running at once | 1 | 2 | 4 | 2 |
| Longest single task | 1 hour | 2 hours | 4 hours | 2 hours |
| Cloud hours a month | 20 | 80 | 250 | 40 |
| Machine starts an hour | 6 | 15 | 30 | 15 |

Standard is 4 vCPU and 8 GB; large is 8 vCPU and 8 GB. Every limit is also on
[Limits and costs](../workspace/limits.md#cloud-machines).

### Daily limits per thread

Each cloud thread also has daily limits on how long its machines run and how
much cloud compute it uses, counted over the last 24 hours. A thread that
reaches one stops cleanly and says so; ask again once a day has passed since
its earlier work, or run it on your own computer. Your other threads aren't
affected.

### When your credit runs out

Cloud work stops when your credit can't pay for more cloud time: “Stopped:
your credit can't pay for more cloud time. Add credit in Billing and ask again
to carry on from here.” The work and the saved files are kept.

## Cloud environments

An environment is the machine a cloud thread works in. **Ysra’s Default**
can’t be changed: “Make a new environment to set its own access, variables or
setup.”

| Setting | What it does |
|---|---|
| **Name** | For example “Node 22 with Postgres” |
| **Internet access** | **Trusted**: “Package registries, GitHub and common SDKs.” **None**: “Only your repository’s git host.” |
| **Environment variables** | One `NAME=value` per line. “Anyone using this environment, and Ysra, can read these. Don’t put secrets here.” |
| **Setup script** | Commands run when the machine starts, such as installing dependencies |
| **Secrets** | Tokens and keys the machine needs. By default only the setup script can read them. See [Secrets](#secrets). Added once the environment is created |
| **Skills** | **All my skills**, or **Only these**. See [Skills](../integrations/plugins.md#skills) |
| **MCP servers** | All your servers, or **Only these**. See [Plugins](../integrations/plugins.md) |

**Make default** makes an environment the one new cloud threads use.
**Archive** retires it; environments are never deleted.

### Secrets { #secrets }

A secret is a value you don't want written down in plain sight, such as a
token for a private package registry. Each secret is listed with who can
read it.

| Secret's switch, **Ysra's commands can read it** | Who can read it |
|---|---|
| Off (the default) | Only the setup script, while the machine starts. The setup script can use it to install private packages, and nothing Ysra runs afterwards sees it. |
| On | The setup script, and the commands Ysra runs while it works. |

Turn the switch on only for a secret the work itself needs, such as a test
account's key. The switch says why: “Off: only the setup script can read it.
On: Ysra’s commands can read it too, and it could leave the machine through
allowed sites.” You can change it at any time without entering the value
again; the next machine the thread starts uses the new setting.

!!! warning "A secret Ysra can read can leave the machine"
    Anything Ysra's commands can read could be sent to a site the machine is
    allowed to reach. Use a key with the least access the work needs, and
    keep the switch off for everything else.

## If it doesn’t work

| Message | Why | What to do |
|---|---|---|
| “Ysra’s cloud comes with a plan. Pick one in Billing, or run this on your own computer.” | No plan, so no cloud. | Choose a plan in [Billing](../workspace/billing.md), or run it on your computer. |
| “Your plan runs 1 cloud task at a time. This one starts when one finishes, …” | The plan’s at-once limit. | Wait for the other thread, or run it on your computer. |
| “That’s a lot of cloud tasks in an hour. Try again in a few minutes, …” | The machine starts an hour. | Try again in a few minutes. |
| “This month’s 20 cloud hours are used. They come back on the 1st; your own computer still works.” | The month’s cloud hours (20 on Starter). Running work stops too. | Wait for the 1st, change plan, or run it on your computer. |
| “Stopped: this thread has used its cloud hours for today.” or “… its cloud compute for today.” | The thread’s [daily limits](#daily-limits-per-thread). | Ask again once a day has passed since its earlier work, or run it on your computer. |
| “Stopped: your credit can't pay for more cloud time. …” | Your credit ran out. | Add credit in [Billing](../workspace/billing.md), then ask again. |
| “Ysra’s cloud is busy right now. …” | Every machine is in use. | Send again shortly. |
| “Cloud work is switched off for this account. Write to support@ysra.ai.” | Cloud was switched off for the account. | Write to support. |

## Related

- [Previews](previews.md) — running the thread’s site or app while it works.
- [Publish or Deploy](publish-and-deploy.md) — putting a cloud project online.
- [How a Code thread works](how-a-thread-works.md) — task states and what is kept.
- [Mayz reviews](mayz.md) — a review can run in the cloud too.
- [Limits and costs](../workspace/limits.md#cloud-machines) — cloud time and every cap.
