Clara Docs
All docs

The Clara query language

Reference13 min readEdit on GitHub

On this page

Clara uses one small language to choose tickets. A query is a line of terms such as status:todo or points>=3, and a ticket matches when every term holds. A query can also say how to order the result and how many tickets to keep. This page covers the whole language: what you can write, what it means exactly, and what comes back when a query is wrong.

Four examples

status:todo,in_progress assignee:agent:* -label:wontfix points>=3 sprint:active

Tickets in todo or in_progress, held by any agent, without the label wontfix, estimated at 3 points or more, in the sprint that is running now.

is:ready   is:blocked   is:stale   is:mine   has:deps   no:assignee

Six terms that take a fixed word in place of a value. They share a line here only to show them together: as one query all six would have to hold at once, and is:mine and no:assignee never do. Each word is explained under is:, has: and no:.

epic:GEN-4 type:bug priority<=p1 updated<7d due<2026-12-01 text:"login form"

Bugs in the epic GEN-4 with priority p0 or p1 that changed less than 7 days ago, are due before 1 December 2026, and have the words login form in their id, title or body.

(type:bug or label:urgent) sort:-priority,rank limit:20

Tickets that are bugs or carry the label urgent, ordered by priority from p3 to p0 (the - reverses the key), then by rank, cut to the first 20.

Combining terms

Written Meaning
type:bug is:open Both terms hold. and between them means the same.
type:bug or label:urgent At least one side holds.
-label:wontfix The term does not hold. not label:wontfix means the same.
-(type:bug or type:chore) Nothing in the group holds.
status:todo,in_progress The field has any of the listed values.
  • Terms side by side bind tighter than or: type:bug priority:p0 or label:urgent reads as (type:bug priority:p0) or label:urgent. Use parentheses to say otherwise.
  • A - must touch what it leaves out. With a space after it, as in type:bug - label:urgent, it is an error.
  • or, and and not work in any case. To search for one of these words, quote it: "or".
  • A comma list works with : only. -status:todo,done matches tickets that are in neither.
  • = means the same as :. There is no !=: status!=done is an error, and -status:done is how to write it.
  • An empty query matches every ticket.
  • A query can be 2,000 characters long, and parentheses can be nested 50 deep.

Fields

Field Operators Takes Meaning Example
status : backlog, todo, in_progress, blocked, in_review, done The column the ticket is in. status:todo,in_progress
type : epic, story, task, bug, chore, spike The kind of ticket. type:bug
priority : < <= > >= p0, p1, p2, p3 How urgent the ticket is. p0 is the most urgent, so priority<=p1 is p0 or p1. priority<=p1
assignee : a name, me, none Who holds the ticket: a person, or an agent written as agent:name. assignee:agent:*
label, labels : a name A label on the ticket. label:area-*
depends_on, needs, deps : a ticket number or id, none A ticket this one depends on. depends_on:GEN-4
id : a ticket number or id The ticket itself, by number or by full id. id:12,GEN-14
epic : a ticket number or id, none The epic the ticket belongs to. epic:GEN-4
parent : a ticket number or id, none The parent of the ticket. parent:12
sprint : a sprint number or id, active, none The sprint the ticket is in. active is the sprint that is running now. sprint:active
release : a name, none The release the ticket is planned for. release:v0.2.0
points : < <= > >= a number The estimate in points. points>=3
title : text Text anywhere in the title. title:sign-in
text : text Text anywhere in the id, the title or the body. A bare word means the same. text:"login form"
branch : text Text anywhere in the name of the branch. branch:gen-12
pr : text Text anywhere in the pull request reference. pr:pull/42
created : < <= > >= a date, a date and time, a duration, today When the ticket was created. created:2026-11-16
updated : < <= > >= a date, a date and time, a duration, today When the ticket last changed. updated<7d
started : < <= > >= a date, a date and time, a duration, today When work on the ticket began. started>=2026-11-01
completed : < <= > >= a date, a date and time, a duration, today When the ticket was finished. completed<1w
due : < <= > >= a date, a date and time, a duration, today The day the ticket is due. A duration counts the time left. due<2026-12-01
is : ready, blocked, stale, mine, open, done, overdue, unassigned, epic, raw A named condition. is:ready
has : assignee, points, labels, epic, parent, sprint, release, deps, due, branch, pr, links The ticket has this optional part. has:deps
no : assignee, points, labels, epic, parent, sprint, release, deps, due, branch, pr, links The ticket does not have this optional part. no:assignee
sort : priority, rank, created, updated, started, completed, due, points, id, title, status, type, assignee, sprint The order of the result. A leading - reverses a key. sort:-priority,rank
limit : a whole number above zero The largest number of tickets to return. limit:20

Field names and the fixed words (todo, p1, active and the like) can be written in any case. The comparing operators <, <=, > and >= take one value, not a list.

Names: assignee, label, release

The value must match the whole name, ignoring case: label:area does not match the label area-auth, and label:area-* does. A * stands for any run of characters, including none.

  • assignee:me is whoever is asking, and assignee:none is nobody. A leading @ is dropped, so assignee:@ada is assignee:ada.
  • Agents are named agent:name, so assignee:agent:* is every agent. A value may hold colons.
  • release:none is no release. label:none is a label called none; for tickets without labels write no:labels.

Text: title, text, branch, pr

The value can stand anywhere inside, ignoring case: title:sign matches a ticket titled "Design the sign-in page". A * between two pieces lets anything come between them, as in title:log*form. text looks in the id, the title and the body, one at a time. A bare word is a text search, so login form asks for both words anywhere and "login form" asks for the two words together.

Quotes

Put a value in double quotes when it holds a space, a comma or a parenthesis: label:"needs review". Inside quotes \" is a quote, \\ is a backslash and \* is an asterisk; any other backslash is kept, and a plain * is still a wildcard. Outside quotes a backslash is an ordinary character. Quoting also turns off the special words of assignee and release: assignee:"none" is someone called none.

Text that starts with a word and a colon is read as a field, so http://example.com is an error about an unknown field http. Quote it: "http://example.com".

Tickets, sprints and numbers

  • id, epic, parent and depends_on take a ticket number (12 or #12) or a full id (GEN-12, in any case). A number matches a ticket with that number, and a full id must match the whole id.
  • epic:none, parent:none and depends_on:none match tickets that have none.
  • sprint takes S2, s2 or 2, and also active for the sprint that is running and none for no sprint. When no sprint is running, sprint:active matches nothing.
  • points takes a plain number such as 3 or 2.5. A ticket without an estimate matches no points term; no:points finds those tickets.

Dates and durations

created, updated, started, completed and due take a date, a date and time, or a duration. All of it is in UTC.

A date is written YYYY-MM-DD and stands for the whole day, from midnight UTC to the next midnight.

Written Matches a ticket created
created:2026-11-16 during that day
created<2026-11-16 before that day starts
created<=2026-11-16 before that day ends
created>2026-11-16 after that day has ended
created>=2026-11-16 when that day starts, or later
  • today is the UTC day the query is run on: created:today, due<=today.
  • A date and time is written 2026-11-16T09:30, 2026-11-16T09:30:15 or 2026-11-16T09:30:15.250, with Z or an offset such as +02:00 at the end if you want one. Without one the time is UTC. It stands for the minute, the second or the millisecond that was written, and the five operators treat that stretch the way they treat a day: updated>=2026-11-16T09:30 is from the start of that minute on.
  • A day that does not exist, as in due<2026-02-30, is an error.

A duration is a whole number of up to six digits and a unit: m for minutes, h for hours, d for days of 24 hours, w for weeks of 7 days. Units are lower case: updated<7D is an error. There are no months or years; write 30d or 52w. A duration needs one of <, <=, > and >=, so updated:7d is an error.

Written Matches a ticket
updated<7d that changed less than 7 days ago
updated>7d that changed more than 7 days ago
completed<=24h finished 24 hours ago or less
due<3d whose due day starts in less than 3 days, or has started already
due>2w whose due day starts more than 2 weeks from now

For created, updated, started and completed a duration measures how long ago the moment was. For due it measures the time left until midnight UTC at the start of the due day, so due<3d also matches tickets that are due today or overdue.

A ticket that has no value in the field (never started, no due date) matches none of these terms.

is:, has: and no:

Written Matches a ticket that
is:ready is ready to start, by Clara's rule for ready work
is:blocked has the status blocked
is:stale is held but has been quiet for too long, by Clara's rule for stale holders
is:mine is assigned to whoever is asking; the same as assignee:me
is:open has any status but done
is:done has the status done
is:overdue is not done and whose due day has ended
is:unassigned has no assignee; the same as no:assignee
is:epic has the type epic
is:raw was written by hand and not yet refined: no refined time, no acceptance criteria, not an epic and not done

The rules for ready and stale are not part of the query language. Whatever runs the query supplies them, along with the current time, who is asking and which sprint is running.

has: matches a ticket that has an optional part, and no: matches one that lacks it.

Has it Lacks it The part
has:assignee no:assignee an assignee
has:points no:points an estimate
has:labels no:labels at least one label
has:epic no:epic an epic
has:parent no:parent a parent
has:sprint no:sprint a sprint
has:release no:release a release
has:deps no:deps at least one ticket it depends on
has:due no:due a due date
has:branch no:branch a branch
has:pr no:pr a pull request
has:links no:links a related ticket or a duplicate

label can be written for labels, and depends_on or needs for deps.

Sorting and limits

sort: takes one key or several, separated by commas. A later key decides between tickets that are equal on the keys before it. A - in front of a key reverses it.

Key Order
sort:priority most urgent first: p0, p1, p2, p3
sort:rank by the rank text of the ticket, in plain character order
sort:created oldest first
sort:updated least recently changed first
sort:started earliest start first
sort:completed earliest finish first
sort:due earliest due date first
sort:points smallest estimate first
sort:id lowest ticket number first
sort:title by title, ignoring case, in plain character order
sort:status board order: backlog, todo, in_progress, blocked, in_review, done
sort:type epic, story, task, bug, chore, spike
sort:assignee by assignee, ignoring case, in plain character order
sort:sprint lowest sprint number first
  • A ticket that has no value for a key (no due date, no estimate, no sprint) comes after the tickets that have one, whichever way the key runs.
  • Tickets that are equal on every key are ordered by priority (p0 first), then rank, then ticket number. A query without sort: uses that order for everything, so the same query over the same tickets always gives the same order.
  • limit: takes a whole number above zero, written without leading zeros, and keeps that many tickets from the top of the sorted result.
  • sort: and limit: apply to the whole query. Each can appear once, outside any parentheses, without a - or a not in front. Neither can stand beside an or that is not in parentheses: type:bug or label:urgent sort:rank is an error, and (type:bug or label:urgent) sort:rank is how to write it.

A query can be nothing but an order and a limit:

sort:-updated limit:10

Where the language is used

The same language filters tickets in every part of Clara that takes a filter. Today that is clara list, clara board and saved views. The list tool of the MCP server, the filter bar of the web board and the when of a routing rule will take it as they are built; docs/STATUS.md says which are. All of them use the one parser in library/query, so a query means the same thing in each place.

On the command line, the query is the words after the command. A word that leaves out a field term or a group, such as -status:done or -(type:bug or type:chore), is part of the query. A word that leaves out bare text, such as -flaky, looks like the short flag -f, so write the query after --: clara list -- -flaky. Quote a query that holds <, > or parentheses, since the shell reads those itself: clara list 'points>=3 -(type:bug)'.

What differs between places is what they know. is:mine and assignee:me match nothing when the place cannot say who is asking, and sprint:active matches nothing when no sprint is running.

formatQuery writes a parsed query back in one standard spelling: field names in full, : for =, - for not, a space for and, a bare word as text:word, and sort: and limit: last. The standard spelling matches the same tickets in the same order. It can be longer than what was typed, so a query close to 2,000 characters can have a standard spelling that is over the limit.

Errors

A query that cannot be read is never guessed at. parseQuery does not throw: it returns { ok: false, error }, and the error has four parts.

Part Holds
message What is wrong and how to put it right, in one line that ends with a full stop.
position Where the wrong piece starts. The first character of the query is 0.
length How long the wrong piece is.
suggestion The text to put in place of the wrong piece. Left out when there is no good guess.

position and length count the way JavaScript counts a string, in UTF-16 units. One mistake is reported at a time: the first one in the query, except that a quote that is never closed is reported before anything else.

The query status:tod gives:

JSON
{
  "message": "\"tod\" is not a status. Use one of: backlog, todo, in_progress, blocked, in_review, done.",
  "position": 7,
  "length": 3,
  "suggestion": "todo"
}

The query (type:bug or label:urgent gives:

JSON
{
  "message": "This \"(\" is never closed. Add a \")\" where the group ends.",
  "position": 0,
  "length": 25,
  "suggestion": "(type:bug or label:urgent)"
}

mustParseQuery is for code that would rather catch than branch. It throws an error with the code INVALID_QUERY, a message that counts columns from 1, a hint, and the query, position, length and suggestion in its details. For status:tod they read:

Text
Query error at column 8: "tod" is not a status. Use one of: backlog, todo, in_progress, blocked, in_review, done.
Replace "tod" with "todo". The query language is described in docs/QUERY.md.