Skip to content

Tag Your Work

Tags say what a turn's cost was for. Set them in the harness before the work starts, and every record from then on carries them.

/alr-tag add project:ACME-2026-14 task:ACME-2026-14:design work_type:build

/alr-tag with no arguments shows the tags in force. Every form is listed in Slash Commands.

The Tag Keys

A tag is key:value. Five keys are reserved. A record carries at most one value of each, and /alr-tag add with a new value of a reserved key replaces the old value.

Key What It Says In Cost Accounting Example
project: The job the money is spent on The cost object (a job, in job costing) project:ACME-2026-14
task: One planned piece of that job; the plan's budget and its acceptance belong to the task A work package in the work breakdown task:ACME-2026-14:design
work_type: The kind of work, across tasks The activity (activity-based costing) work_type:review
client: Who the work is for The customer client:acme
cost_center: Whose budget pays for it The cost center cost_center:eng-tools

project and task say what the work was for. work_type says what kind of work it was. One turn carries all three.

work_type values are your own. The built-in list is plan, build, test, review, docs, support, and research, and the work_types setting adds to it. Clients and cost centers can have lists too; see Set Your Lists.

A plan names its project and its tasks by these tag values, so the records find their plan by the tags they carry. See Plan a Project.

Switch Tags as the Work Changes

Tags apply from the next turn. Each turn takes the tags in force when it started, so tag before the work begins.

/alr-tag add project:ACME-2026-14 work_type:plan
/alr-plan
/alr-tag add work_type:build task:ACME-2026-14:design
/alr-tag add work_type:review
/alr-tag add work_type:build task:ACME-2026-14:build-api

Each add above replaces the reserved values it names and keeps the rest: the project tag stays on throughout.

/alr-tag undo puts back the tags in force before your last change. It does not undo a move of tags on past turns (below).

Fix the Tags on Past Turns

Say you are on turn 10 and find that turns 3 to 7 were booked to the wrong task. Move the tag on those turns, in your harness or in a terminal:

/alr-tag move task:ACME-2026-14:design task:ACME-2026-14:build-api turn 3-7 booked to the wrong task

The words after the turn numbers are the reason.

alr tag last --session --turns 3-7 --move task:ACME-2026-14:design task:ACME-2026-14:build-api --reason "booked to the wrong task"

With --session, the first argument names the session: its id, a unique prefix of it, or last.

The turn numbers are the ones /alr-turns and alr turns show.

  • Only past turns change. The turn you are on and the turns after it keep the session's tags. To change those as well, add --from-now in a terminal, or from-now in the harness.
  • Only the named tag moves. Every other tag on those turns stays as it is. Both tags must have the same key; to change the key, remove one tag and add the other.
  • A reason is required, so the change explains itself later.
  • The new tag is checked as an added tag is: with tag_checks = "refuse", moving turns to a task outside the plan, or to a client or cost center that is not on its list, is refused, and nothing is written.
  • /alr-tag undo does not undo a move. Undo walks back the session's own tag changes. To reverse a move, move the tag back.
  • All or nothing. If any of the turns does not carry the old tag, nothing is written, and the message names those turns.
  • A turn's subagents move with it. The records of subagents a moved turn started move too. One that does not carry the old tag is skipped, and the message counts it.
  • A turn that already carries the new tag is left alone, so moving the tag back puts the turns exactly as they were. If every turn already carries it, the move is refused as having nothing to do; with --from-now, it then changes only the session's tags from now on, when those change.

A move never rewrites a record. It adds two lines to the record file: one removing the old tag and one adding the new tag, written together and linked by one move id (x_move), each with the reason. alr turns, alr summary, and the dashboard show the turns under the new tag, and the two lines are the audit trail of the change.

If you forward records to a log server with alr syslog send, a move arrives as those two lines, next to each other. A reader that ignores the move id still gets the right totals.

Move, or Add?

You Want To Use
Change the tag for the work from now on /alr-tag add (a reserved key's new value replaces the old one)
Change the tag on turns already done /alr-tag move or alr tag --move
Tag one past request or a whole past session alr tag last project:alpha, or with --session

Read the Cost by Key

alr summary --by work_type
alr summary --by task

A summary by a reserved key puts each turn in exactly one row: its value, (none) when it has no tag of that key, or (ambiguous) when it has two. The rows add up to the total. The two summaries above are two cuts of the same total, by kind of work and by planned piece.

Finer Grain: Your Own Keys

For anything below a task, such as a ticket or a step, use a key of your own:

/alr-tag add ticket:ACME-412
/alr-tag add subtask:schema-migration
  • Keys that are not reserved can hold several values at once. Remove one with /alr-tag rm ticket:ACME-412, or every value of the key with /alr-tag rm ticket:.
  • To group tasks into the phases of a project, use phase:.
  • Don't add a step to the task value (task:ACME-2026-14:design:step2). That is a different task: it gets its own row under --by task and matches no task in your plan.
  • alr summary --by tag shows one row per tag. A turn with two tags appears in both rows, so these rows overlap and are not meant to add up. The total row counts each turn once.

Without the Slash Command

On headless Grok Build and the Anthropic SDK, set the tags with the ALR_TAGS environment variable or a .alr-tags file in the project directory, one tag per line. See Environment Variables, and Setting an Environment Variable for how to set one on Windows, macOS, and Linux.

Required Tags

An organization can require keys on every record with the required_tags setting. See the Configuration Keys.

Report a problem with this page