tasks
CLI reference

Configuration

The .tasks/config.yml keys, how the actor and the session are resolved, and the environment the CLI reads.

Explanatory, not normative

The authoritative definitions are specification › configuration and sessions and liveness. This page is the practical walkthrough.

config.yml

.tasks/config.yml is required and declares the convention version. tasks init scaffolds it with every optional key commented out; the actors: example already names the actor it resolved (alice below) and agent, and tasks init --actors writes that block live:

.tasks/config.yml
# .tasks convention v2. See `tasks --help` or .tasks/README.md.
version: 2

# Default scope for `list`, `ready`, `tree` and `claim --next`: a group or task path; keeps them to this tree.
# scope: auth-rework

# Minutes without a heartbeat after which a claim counts as orphaned.
# session_timeout_minutes: 30

# Days after which a resolved task is expected to be archived: validate reports
# older ones, and tasks archive --resolved-before without a value uses it.
# archive_resolved_after_days: 30

# The actors tasks may be assigned to, each with a line on who they are. Once
# any is listed, assign, handoff, new --assign and --as refuse other names.
# actors:
#   alice:
#   agent: the coding agent

# Where the project's documentation lives, by name, as paths relative to this
# project's root (a path may leave the repository: ../api-docs); an agent
# brings the listed documentation up to date before done.
# docs:
#   engineering: docs/engineering

# Sibling trees by alias, as paths relative to this project's root.
# projects:
#   backend: ../backend

Prop

Type

Unknown keys are rejected with exit 2, so an older CLI refuses a newer tree rather than misreading it. The v1 keys are named in the error: active_phase is scope in v2, and statuses, roles and transitions are gone because the lifecycle is fixed. Invalid YAML, or a document that is not a mapping, fails the command you ran with exit 2, naming the file.

scope

scope: auth-rework

Sets the default scope of tasks ready, tasks list, tasks tree and claim --next. --scope <path> overrides it, and --all ignores it. A scope is a path of the local tree, and while one is in force these commands keep to that tree: the listed projects are spanned only without a scope, so --all spans again. mine is not scoped — what is yours does not depend on what you work on next. A configured scope that names no task or group is applied as written, with a warning on stderr, so the file gets fixed instead of every overview failing.

A missing task is usually a scope

If a task you expect is absent from list or ready, retry with --all before concluding it does not exist.

session_timeout_minutes

How long a claim's session may stay silent before the claim is orphaned and the next session may take it over. Heartbeats are written when a command runs, and a harness runs tasks heartbeat after every tool call — so a single tool call that runs longer than the timeout (a long test suite) produces no heartbeat while it runs. Keep the timeout well above your longest tool call; the default of 30 is not meant to be lowered.

The liveness of a claim is judged by the timeout of the tree that holds the task.

archive_resolved_after_days

archive_resolved_after_days: 30

How long a resolved subtree may stay in the live tree before it counts as due for archiving. With it set, tasks validate warns resolved-unarchived with the count and the roots, and tasks archive --resolved-before without a value archives exactly those (see archive). The warning names only what the command would take: a root that open tasks still reference is listed apart as staying live, and when every due root is such a one there is no warning. Nothing is archived on its own: the warning is the signal, the command the action. Unset, neither applies.

actors

actors:
  alice: maintainer; approves plans and does releases
  agent: the coding agent
  bob:
  codex: { type: agent, description: a second coding agent }

The roster: who tasks may be assigned to, each with a line on who they are — what an agent reads to pick the right person for a handoff. Names match the actor pattern; a bare name (bob:) needs no description. Each actor has a type: an entry written as a description or nothing is a person, the name agent is an agent by convention, and an entry written as a mapping says so itself (codex: { type: agent, description: … }); an unlisted name is a person, agent excepted. The type decides what a pause leaves behind (see tasks pause): a person's keeps the task for them, an agent's leaves it free. With at least one actor listed:

  • tasks assign, tasks handoff and tasks new --assign refuse a name that is not listed, with exit 2, naming the listed actors and the file; a name that differs in case alone is suggested. The roster that applies is the one of the tree that holds the task, so a task created in a listed project is judged by that project's config.yml.
  • --as, on every command that opens the tree, and tasks hooks install --actor refuse an unlisted name the same way. --force lifts none of these refusals.
  • The actor a command resolves for itself — from TASKS_ACTOR, git or the OS user — is reported on stderr by every command that opens the tree when it is unlisted (not under --json, where tasks actors --json carries the fact as listed: false), and a command that would write under it is refused with exit 2, naming the listed actors, the file and the remedy: name yourself once with git config --global tasks.actor <name> (or TASKS_ACTOR), or add your name to the roster. A name off by case alone, or an e-mail address whose local part is listed, is suggested. Reads go on, so you can look around first; regenerating index.md records no actor and is not refused. The operator behind an --as is only diagnosed.
  • A name YAML would read as a number or a boolean (007, True) is refused unless quoted ("007":), so a roster never holds a name nobody typed; init --actors quotes such names itself. A name that is a canonical integer (42, not 007) sorts first in every listing, whatever its position in the file.
  • tasks validate warns unknown-actor for every open task whose assignee or claimed_by is not listed.

tasks actors shows the roster with each actor's open tasks, and the names in use that it lacks. Without the key, any name may be assigned. tasks init --actors [<names>] writes the key from the start, with the actor it resolved and agent, or the names given (run as agent, the bare form is refused: name the person); without the flag the scaffold carries those two names commented out, ready to switch on.

docs

docs:
  engineering: docs/engineering
  readme: README.md
  api: ../api-docs

Where the project's documentation lives, by name: a directory or a file, as a path relative to the project root, inside the repository or beside it. Names match ^[a-z0-9][a-z0-9-]*$; an absolute path is rejected like a project path, because it would not resolve in another clone. The key changes what an agent owes before done, not what the CLI allows:

  • tasks resume lists the locations under docs, each with present — whether the path exists on this machine — so an agent knows from the start where its documentation work goes. The locations are those of the tree that holds the task.
  • Before done, the agent protocol has the agent bring the listed documentation that describes what the task changed up to date, within the task's scope only, and say in the done message what changed or that nothing needed to.
  • tasks validate warns docs-missing for a location that does not exist here: a sibling repository that is not checked out, or an entry that went stale when the documentation moved. Nothing is blocked.

Without the key, the protocol's general rule still applies: knowledge that must outlive the task goes into the project's documentation, wherever that is.

projects

projects:
  backend: ../backend
  cli: ../tasks-cli

Aliases match ^[a-z0-9][a-z0-9-]*$; paths are relative to the project root (the directory that holds .tasks/). An absolute path is rejected, because it would not resolve in another clone, and so is an alias that leads back to this tree. A listed project that is not checked out is a validation warning, and references into it block with reason not-checked-out. See projects.

The actor

Every log entry is headed with an actor, and the authorization rules compare actors. The CLI resolves it, in order, from:

  1. --as <actor> — acting on someone's behalf. The identity that would otherwise have acted is recorded as the operator: alice via agent.
  2. TASKS_ACTOR.
  3. git config tasks.actor — your name for tasks, set once: git config --global tasks.actor maria for every repository on the machine, or without --global for one. A value that fails the pattern is a usage error, like TASKS_ACTOR.
  4. The repository's git identity: git config user.name, then user.email, read with the project root as the working directory.
  5. The operating-system user.

An actor matches ^[A-Za-z0-9][A-Za-z0-9._@+-]*$ — no spaces — which is what keeps log headings parseable. A --as or TASKS_ACTOR that does not match is a usage error. A git identity that does not match is skipped with a diagnostic on stderr: a one-word user.name is used, a name with spaces falls through to user.email. Nothing is normalized silently. tasks init prints the actor it resolved, so you see the name that will head every entry you write. With actors listed, a resolved identity that is not among them is reported on stderr by every command that opens the tree (not under --json), and --as on such a command must name a listed actor.

Give agents their own name

A person and an agent often share one machine and one git identity. Export TASKS_ACTOR for the agent — the harness hooks do — so the log, the inbox and the authorization rules tell the two apart. By convention the name is agent: the hooks export it and the skill sets it without them, so tasks assign <task> agent reaches the agent either way.

The session

A session is one run of an agent. Its token comes from --session <token>, else TASKS_SESSION; an empty variable counts as unset. Tokens follow the actor pattern, which also makes them safe as file names under .tasks/.locks/sessions/. On a case-insensitive filesystem two tokens that differ only in case share one heartbeat file, and Windows refuses its reserved names (CON, NUL) as tokens.

With a session known, the CLI records it in claimed_session on claim, in every log heading it writes (s:<token>), and touches the session's heartbeat in this tree and in every listed tree before doing anything else. A claim taken without a session is normal at a terminal without a harness; its liveness is unknown, since nothing heartbeats for it, so nobody else can take it over without --force.

An agent uses one token for the whole session, on every command. With the harness hooks, TASKS_SESSION is exported for it; without them, generate a token once at the start (uuidgen, date +%s, anything matching the pattern; an ISO timestamp's colons do not) and pass --session to every command. See the agent protocol.

-C <dir>

-C, --dir <dir> starts the search for .tasks/ in <dir> instead of the current directory, before or after the command name, and takes the directory literally. Without it, a command run inside a linked git worktree starts the search at the same place in the main checkout — the CLI reads the worktree's .git file — so task state stays in one working copy on the integration branch, and the worktree's own .tasks/, a snapshot committed on its branch, is passed over (it is used only when the main checkout has no tree). -C is for a tree somewhere else:

tasks -C ~/src/acme-api ready
tasks claim token-schema -C ~/src/acme-api

For tasks init, -C names the directory to scaffold in.

Environment

VariableRead byMeaning
TASKS_ACTORevery commandThe actor; with --as, the operator recorded behind it. Validated either way.
TASKS_SESSIONevery commandThe session token, when --session is not given.
VISUAL, then EDITORtasks state --editThe editor to open state.md in; a shell command line.
TASKS_DEBUGevery commandWhen set, an unexpected error (exit 1 without a tasks error code) also prints its stack trace.

On this page