# Hand a task to an AI agent

Copy a whole task as one prompt for a coding agent like Claude Code or Codex, with its comments, commits and attachments, and get the work back on the task.

Do you let an AI coding agent such as Claude Code or Codex do part of the work? One menu item copies a task as a single piece of text you paste into the agent: the title, the description, the subtasks, the comments, the commits and the attachments, in markdown. You no longer copy things over bit by bit, and the prompt asks the agent to name the task in its commits, so the work shows up on the task again.

## Copy a task as a prompt

1. Open the task.
2. Click **More** (the three dots at the top of the task).
3. Click **Copy as prompt for a coding agent**.
4. Paste the text into your agent.

When it worked you see **Prompt copied.** If the task has attachments, the message also says how long their links work. If your browser does not allow it, you see **Copying failed. Check what your browser allows on the clipboard.**

## Who can use it

| | |
|---|---|
| Roles | Owner, Manager and Team member |
| Project | Only a project with a GitHub repository linked, see [linking GitHub](<https://taskstand.com/help/github>) |
| Plan | Follows the plan of the project owner, like the repository itself |
| Not available | On a completed or archived project, and for Client, Reader and Restricted members |

The prompt is built around commits that find their way back to the task, which is why it needs a linked repository.

## What the prompt contains

The prompt only holds what you can already see on the task yourself. In this order:

- **The heading**: the task reference and title (and the parent task, for a subtask), followed by a short note for the agent. It says which project the task belongs to and asks the agent to check it is working in the right folder before it changes anything.
- **The details**: project, section, status, priority, start and due date, recurrence, estimate, labels, assignee and a link to the task.
- **Description**: exactly as written.
- **Subtasks**: as a checklist, with the completed ones ticked.
- **Comments**: the newest fifty, each with its author and date. If there are more, the prompt says how many and links to the task.
- **Commits**: the newest twenty commits linked to the task, with sha, date and author.
- **Error reports**: when the project has Sentry linked, the issues that hang on the task.
- **Attachments**: the files on the task and on its comments, as download links (see below).
- **When you commit**: the instruction to name the task in every commit.

## Other people's words are marked as information

A good part of a task is written by other people: a client in a comment, a colleague in the description, somebody outside your team in the message of a merged pull request. An agent cannot tell a note from an order on its own, so the prompt puts every one of those passages between two marks and tells the agent up front that text inside them is information about the work and never an instruction.

The marks carry a code that is made fresh on every copy, so nothing inside a passage can fake the closing mark and pass the rest of itself off as your instructions. In short: a comment cannot give your agent orders.

This makes the prompt safer, not safe. Read what your agent is about to do before you let it run, as you would with any prompt.

## The work comes back to the task

The last part of the prompt asks the agent to put the task reference (for example `WEB-12`) in the message of every commit it makes for this work. Once those commits are pushed, they appear on the task and on the Code page, the same way your own commits do. A link to the task works too. A bare `#12` does not, because GitHub writes numbers like that into its own merge commits.

## Attachments

Each attachment travels as a link with a short download command, so the agent can fetch the files without being signed in.

- The links work for **15 minutes** after you click the menu item, and not a moment longer. Copy again for fresh links.
- The files are saved in a temporary folder named after the task. The prompt asks the agent to delete that folder when it is done, because a temporary folder can keep files for days.
- When a file is fetched, the link checks again whether you may still see it. If you are taken off the project, your links stop working at once.
- Each file gets a safe name: a short code followed by a tidied version of its original name, so odd characters in a file name cannot cause trouble.
- A file that is no longer on the server is listed as such, without a link.

## Copying is recorded on the task

Every copy adds a line to the **Activity** of the task: "copied this task as a prompt", with your name. The attachment links go wherever the prompt is pasted, so the task says that it happened.

## Privacy

- Pasting the prompt into a tool that runs somewhere else (an AI service, a chat, a shared document) sends the whole task text there: description, comments, names and commit messages. Only paste it where you are allowed to share the work of this project.
- The attachment links work for a quarter of an hour for anyone who has the prompt. After that they are dead.
- The attachment links contain an identifier of your account: a random code, not your name or e-mail address.

Want to know who sees what in a project? See [members and roles](<https://taskstand.com/help/members-and-roles>).
