Task Manager
Use this skill to manage long-running tasks in <GlobalWorkspaceRoot>/.tasks, such as coding, refactoring, or multi-step scripts. Tasks are driven by the in-app supervisor process based on the task directory and meta.json; you manage them by directly creating, editing, and deleting task files and folders.
Task Location
- Tasks are global and do not belong to a single project.
- Root path:
<GlobalWorkspaceRoot>/.tasks, not a specific agent project directory.
- Each task corresponds to one subdirectory under
.tasks, and the directory name is the task ID.
Task ID Rules
- Allowed characters: letters, digits, underscores
_, and hyphens -.
- The ID must start with a letter or digit.
- Regex:
^[a-zA-Z0-9][a-zA-Z0-9_-]*$
- Examples:
my-refactor-a1b2, claude-write-xyz
Single Task Directory Structure
<GlobalWorkspaceRoot>/.tasks/
<taskId>/ # Task ID, also used as the directory name
meta.json # Required task metadata
stdout.log # Optional, written by the supervisor process
meta.json Schema
meta.json is a JSON file with these fields:
createdAt (string, required): creation time, preferably ISO 8601, such as 2025-03-01T12:00:00.000Z
name (string, required): display name of the task; spaces and non-English text are allowed
command (string, required): the command to execute, usually a full shell command
status (string, required): task status, one of running, stopped, or success
pid (number | null, optional): PID of the running process, written by the supervisor; usually null when newly created or not running
Example:
{
"createdAt": "2025-03-01T12:00:00.000Z",
"name": "Implement XXX feature",
"command": "cd <AgentWorkspaceRoot> && claude --dangerously-skip-permissions \"Implement XXX: 1. ... 2. ...\"",
"status": "stopped",
"pid": null
}
How to Manage Tasks (Direct File Operations)
- List tasks: list subdirectories under
<GlobalWorkspaceRoot>/.tasks. Each directory name is a task ID. Read each task’s meta.json as needed for name, command, and status.
- View task details: enter the task directory and read
meta.json. Read or tail stdout.log when output is needed.
- Check task runtime status:
- Read
status and pid from meta.json.
- If status is
running, pid should normally be non-null and the process should still exist. You can verify with ps -p <pid>. If pid is null or the process does not exist, the task may still be starting, so check again later.
- If status is
stopped, pid should be null and the task should no longer be running. If it is still running, you can force-stop it.
- If status is
success, pid should be null and the task should have finished successfully.
- Create a task:
- Create a new directory under
.tasks using a valid task ID.
- Create
meta.json inside it and fill in createdAt, name, command, status (for example stopped or running to start immediately), and pid (usually null on creation).
- Start a task: edit
meta.json for the task. If you change status to running, the supervisor process will execute command and start the task.
- Stop a task: change
status to stopped, and the supervisor process will stop the task.
- Update a task: if
command needs to change, stop the task first. After editing, make sure the old process has really stopped before starting it again.
- Delete a task: ensure the task has stopped, then delete the task directory at
<GlobalWorkspaceRoot>/.tasks/<taskId>.
1---2name: task-manager3description: Manage long-running or asynchronous global tasks, including creating, starting, stopping, deleting, checking status, and troubleshooting output. Use for work such as code generation or multi-step scripts that cannot be completed quickly in the current turn.4---56# Task Manager78Use this skill to manage long-running tasks in **`<GlobalWorkspaceRoot>/.tasks`**, such as coding, refactoring, or multi-step scripts. Tasks are driven by the in-app supervisor process based on the task directory and `meta.json`; you manage them by directly creating, editing, and deleting task files and folders.910## Task Location1112- Tasks are global and do not belong to a single project.13- **Root path**: `<GlobalWorkspaceRoot>/.tasks`, not a specific agent project directory.14- Each task corresponds to **one subdirectory** under `.tasks`, and the directory name is the **task ID**.1516## Task ID Rules1718- Allowed characters: letters, digits, underscores `_`, and hyphens `-`.19- The ID must start with a letter or digit.20- Regex: `^[a-zA-Z0-9][a-zA-Z0-9_-]*$`21- Examples: `my-refactor-a1b2`, `claude-write-xyz`2223## Single Task Directory Structure2425```26<GlobalWorkspaceRoot>/.tasks/27 <taskId>/ # Task ID, also used as the directory name28 meta.json # Required task metadata29 stdout.log # Optional, written by the supervisor process30```3132## `meta.json` Schema3334`meta.json` is a JSON file with these fields:3536- `createdAt` (`string`, required): creation time, preferably ISO 8601, such as `2025-03-01T12:00:00.000Z`37- `name` (`string`, required): display name of the task; spaces and non-English text are allowed38- `command` (`string`, required): the command to execute, usually a full shell command39- `status` (`string`, required): task status, one of `running`, `stopped`, or `success`40- `pid` (`number | null`, optional): PID of the running process, written by the supervisor; usually `null` when newly created or not running4142Example:4344```json45{46 "createdAt": "2025-03-01T12:00:00.000Z",47 "name": "Implement XXX feature",48 "command": "cd <AgentWorkspaceRoot> && claude --dangerously-skip-permissions \"Implement XXX: 1. ... 2. ...\"",49 "status": "stopped",50 "pid": null51}52```5354## How to Manage Tasks (Direct File Operations)55561. **List tasks**: list subdirectories under `<GlobalWorkspaceRoot>/.tasks`. Each directory name is a task ID. Read each task’s `meta.json` as needed for `name`, `command`, and `status`.572. **View task details**: enter the task directory and read `meta.json`. Read or tail `stdout.log` when output is needed.583. **Check task runtime status**:59 - Read `status` and `pid` from `meta.json`.60 - If status is `running`, `pid` should normally be non-null and the process should still exist. You can verify with `ps -p <pid>`. If `pid` is null or the process does not exist, the task may still be starting, so check again later.61 - If status is `stopped`, `pid` should be null and the task should no longer be running. If it is still running, you can force-stop it.62 - If status is `success`, `pid` should be null and the task should have finished successfully.634. **Create a task**:64 - Create a new directory under `.tasks` using a valid task ID.65 - Create `meta.json` inside it and fill in `createdAt`, `name`, `command`, `status` (for example `stopped` or `running` to start immediately), and `pid` (usually `null` on creation).665. **Start a task**: edit `meta.json` for the task. If you change `status` to `running`, the supervisor process will execute `command` and start the task.676. **Stop a task**: change `status` to `stopped`, and the supervisor process will stop the task.687. **Update a task**: if `command` needs to change, stop the task first. After editing, make sure the old process has really stopped before starting it again.698. **Delete a task**: ensure the task has stopped, then delete the task directory at `<GlobalWorkspaceRoot>/.tasks/<taskId>`.