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 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: ../backendProp
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-reworkSets 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: 30How 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 handoffandtasks new --assignrefuse a name that is not listed, with exit2, 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'sconfig.yml.--as, on every command that opens the tree, andtasks hooks install --actorrefuse an unlisted name the same way.--forcelifts 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, wheretasks actors --jsoncarries the fact aslisted: false), and a command that would write under it is refused with exit2, naming the listed actors, the file and the remedy: name yourself once withgit config --global tasks.actor <name>(orTASKS_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; regeneratingindex.mdrecords no actor and is not refused. The operator behind an--asis 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 --actorsquotes such names itself. A name that is a canonical integer (42, not007) sorts first in every listing, whatever its position in the file. tasks validatewarnsunknown-actorfor every open task whoseassigneeorclaimed_byis 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-docsWhere 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 resumelists the locations underdocs, each withpresent— 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 thedonemessage what changed or that nothing needed to. tasks validatewarnsdocs-missingfor 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-cliAliases 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:
--as <actor>— acting on someone's behalf. The identity that would otherwise have acted is recorded as the operator:alice via agent.TASKS_ACTOR.git config tasks.actor— your name fortasks, set once:git config --global tasks.actor mariafor every repository on the machine, or without--globalfor one. A value that fails the pattern is a usage error, likeTASKS_ACTOR.- The repository's git identity:
git config user.name, thenuser.email, read with the project root as the working directory. - 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-apiFor tasks init, -C names the directory to scaffold in.
Environment
| Variable | Read by | Meaning |
|---|---|---|
TASKS_ACTOR | every command | The actor; with --as, the operator recorded behind it. Validated either way. |
TASKS_SESSION | every command | The session token, when --session is not given. |
VISUAL, then EDITOR | tasks state --edit | The editor to open state.md in; a shell command line. |
TASKS_DEBUG | every command | When set, an unexpected error (exit 1 without a tasks error code) also prints its stack trace. |