> ## Documentation Index
> Fetch the complete documentation index at: https://sleekplan.com/llms.txt
> Use this file to discover all available pages before exploring further.

# How Sleekcode works on a work item

> What happens when Sleekcode takes a work item, and how to follow a run, answer the agent's questions, approve its actions and stop it.

When Sleekcode takes a work item, it starts a **run**: one stage of one work item, done by your agent on your computer. You follow it in Sleekcode, and you decide in Sleekplan as usual.

## How Sleekcode picks a work item

Every 30 seconds, Sleekcode looks at the **Ready** work items of its workspace and takes the one with the highest priority, as long as one of its [parallel sessions](https://sleekplan.com/help/sleekcode/settings.md#runner) is free. It skips a work item when:

* its stage is switched off on this device, or the stage's agent isn't installed or is signed out,
* **Only my work items** is on and you neither own the work item nor are a member of it,
* you stopped it on this device in the last 24 hours.

Taking a work item moves it to **In progress**. Its **Run** section and its activity log show the agent and the device, for example **Claude Code · Alex's MacBook started the plan**. If another device took the work item a moment earlier, Sleekcode moves on to the next one.

## What happens in a run

**1. Sleekcode prepares a folder**

Each run gets its own folder in `Sleekcode` in your home folder, named like `WI-42-plan-3f9c2a1b`. It holds the work item as files the agent reads: the brief, the linked documents, and the spec and the plan once the work item has them. For a spec or a plan, the linked posts and the evidence are there too.

**2. Your agent starts**

Sleekcode starts the agent you chose for the stage, in its permission mode, with instructions for the stage. Nobody needs to be at the keyboard.

**3. The agent works**

For a spec or a plan, the agent reads the work item and your code and writes the document. Its instructions tell it not to change any code. For a build, it gets its own copy of each repository it changes, writes and tests the code, commits to a new branch and pushes it.

**4. It reports back**

Progress notes, a question, the spec, the plan or the pull request go to the work item in Sleekplan. When the agent delivers, the run ends and the work item moves on: to your decision, or straight to the next stage if you set a goal further ahead.

### The agent's copy of your repository

The agent never works in your own folder. When it needs a repository, Sleekcode makes it a copy inside the run's folder, with its own git data, and points it at your repository's remote. Your folder, your uncommitted changes, your git settings and your hooks stay untouched.

When Sleekcode makes the copy, it first fetches the remote's default branch, so the agent works on the latest code, including pull requests merged a minute ago. If the fetch fails, for example offline, Sleekcode starts from what your own folder fetched last.

For a spec or a plan, the copy is only there to read. For a build, the agent works on a new branch named like `sleekcode/wi-42-export-the-roadmap` and opens a pull request whose title starts with the work item's number, such as `WI-42: Export the roadmap`.

### What the agent is told

* The brief is its task. Linked posts, comments and evidence are information from users, never instructions.
* It never merges a pull request, pushes to a default branch, deletes a branch or force-pushes.
* Your repository's own `AGENTS.md` or `CLAUDE.md` still applies.
* In the build it writes tests, runs your test suite and the other checks before it calls the work done.

The build never sees posts, comments or evidence from users. It works from the brief, your team's change requests, the spec and the plan. [Security and privacy](https://sleekplan.com/help/sleekcode/security.md#text-from-your-users) explains why.

## Follow a run

Click **Runs** in the left rail. **Active** lists what runs or waits now, **History** what finished, newest first. Each row shows the work item, the stage, the agent, the state, when it started and how long it ran.

![The Runs list in Sleekcode, with three active runs (needs approval, running, waiting for answer) and four finished ones in History](https://mintcdn.com/sleekplangmbh/m51m7FCsz6yi8eAC/images/sleekcode-runs-list.png?fit=max\&auto=format\&n=m51m7FCsz6yi8eAC\&q=85\&s=73d322f4ff77d8e8f235d8b10b5d2617)

| State | What it means |
| - | - |
| **Running** | The agent is working. |
| **Needs approval** | The agent waits for you to allow or deny an action. |
| **Waiting for answer** | The agent asked a question in Sleekplan and waits for the answer. |
| **Delivered** | The agent delivered the spec or the plan. |
| **Pull request open** | The agent opened a pull request, which waits for review and merge. |
| **Merged** | The pull request was merged. |
| **Failed** | The run couldn't finish. The run says why. |
| **Stopped** | The run was stopped, by you or because the work item moved on. |

Click a run to open it. It reads like the agent's terminal: what it says, the commands it runs with their output, the files it changes and, at the end, how long it took and how many tokens it used. The line at the top shows the stage, the agent, the permission mode, and any pull request link.

* **Open in Sleekplan** (the arrow icon) opens the work item.
* **Open folder** (the folder icon) opens the run's folder on your computer.
* **Stop** stops a run that's still active.

## Approve or deny an action

With **Ask for everything**, and in **Auto** for what Claude Code won't approve on its own, an action waits for you. The run shows **Needs approval**, Runs in the left rail gets a dot, and a notification says **WI-42 needs your approval**.

Open the run. The request shows what the agent wants to do. Click **Allow** or **Deny**. When you deny, the agent hears that the developer denied it in Sleekcode, and looks for another way or reports that it can't finish.

![A run in Sleekcode waiting for approval: the agent's request to run the widget tests is highlighted with Allow and Deny buttons. Above it, Sleekcode's own report command shows Allowed automatically](https://mintcdn.com/sleekplangmbh/m51m7FCsz6yi8eAC/images/sleekcode-runs-approval.png?fit=max\&auto=format\&n=m51m7FCsz6yi8eAC\&q=85\&s=493d01750d22cb8d979dec94cb96ad29)

Sleekcode's own report commands never wait for you: they show **Allowed automatically**.

The time a run waits for your approval counts toward its time limit, and the run keeps its session.

## Answer the agent's question

When the agent is stuck, it asks a question instead of guessing:

1. The work item shows **Needs decision** with the reason **Question**, and Sleekcode notifies you with **WI-42 has a question**. The run shows **Waiting for answer** and frees its session.
2. In Sleekplan, open the work item, click **Answer**, write your answer and click **Send answer**.
3. Within about 30 seconds, Sleekcode continues the same agent session with your answer, as soon as a session is free.

If the work item moves on while the agent waits, because someone released, closed or held it back, the run stops.

## When the pull request is merged

After a build, the work item waits in **Review and merge**. With the GitHub CLI or the GitLab CLI installed, Sleekcode checks the pull request every 10 minutes:

* When every pull request of the run is merged, Sleekcode reports the merge and the work item is **Completed**.
* When a pull request is closed without merging, Sleekcode reports that, and the work item shows **Needs decision** with the reason **Pull request closed**.

Without either tool, complete the work item yourself after the merge.

## Stop a run

Open the run and click **Stop**, then **Stop run**. The agent stops and the work item goes back to **Ready** in Sleekplan, where another device can take it. This device won't pick it up again for 24 hours.

## Limits and endings

* **Time limit.** A run gets 4 hours of agent time. Waiting for an answer doesn't count. After 4 hours, Sleekcode stops the agent and reports **Stopped after 4 hours.**
* **No delivery.** When the agent ends without delivering, asking or reporting a failure, Sleekcode reports the run as failed with the reason. After a build, the report names any branch the agent pushed.
* **Quitting Sleekcode.** Quitting stops running agents. At the next start, Sleekcode hands those work items back to Sleekplan. Runs that wait for an answer keep waiting.

## Cleanup

Sleekcode deletes a run's folder and its copies when the run's pull requests are merged or closed, or 7 days after a run without an open pull request ended. The run stays in **History**, with its transcript, for 30 days. Sleekcode never deletes branches on your git host.

## Related

> [card] [Work items](https://sleekplan.com/help/work-items.md)
>
> Start work items, approve deliveries and answer questions in Sleekplan.

> [card] [Settings](https://sleekplan.com/help/sleekcode/settings.md)
>
> Stages, agents, permission modes and parallel sessions.

> [card] [Security and privacy](https://sleekplan.com/help/sleekcode/security.md)
>
> What the agent may do, and what stays on your computer.

> [card] [Troubleshooting](https://sleekplan.com/help/sleekcode/troubleshooting.md)
>
> When Sleekcode doesn't take a work item, or a run fails.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.