# The time tracker

The time tracker times the tasks you work on, several at once if you like, each with its name, its
project and your notes. Moontors' background service keeps it on your computer, as it keeps your
sessions, so a timer keeps counting with the window closed, and the window and every paired phone
show the same list. A running timer keeps the background service running after you quit the
window, and a restart of Moontors leaves it running, its time counting the gap. A session's agent
can read it and time a task for you, when you ask it to.

## In the window

The clock button in the window's header, left of the board's own-window button, opens the time
tracker below it, as a browser extension's popup opens from its button. Escape or a click elsewhere
closes it. It's never taller than the room down to the window's bottom: a long list scrolls inside
it, with its buttons above and its total below staying in sight.

While a timer runs in any list, an archived one's too, the clock turns blue, open or closed, and its
tooltip says a timer is running.

- Each task shows its name, its project under it, its time and its play or pause button. A running
  task is tinted, and the total of the list is at its foot. A (!) beside a name holds the task's
  notes: hover it to read them. An agent's mark beside a name shows the agent changed it last (see
  [Agents and the time tracker](#agents-and-the-time-tracker)).
- **Edit**, **Reset** and **Delete** sit under each name. **Reset** sets the task's time back to
  0:00:00, and **Delete** removes the task at once.
- Drag a task by its name to move it, or focus its name and press Space, the arrow keys, then Space
  to drop it, or Escape to put it back. While the list is sorted, it can't be dragged, and your own
  order comes back once it isn't.
- Along the top, **New** adds a task; **Export all** saves the list as a CSV file, wherever you
  choose, with each task's name, project, time and notes; **Delete all** and **Reset all** ask
  first, as neither can be undone. Beside them, **Archive the list** and **Archived lists** (see
  [Archived lists](#archived-lists)), and **Sort**.
- A task needs a name. Its project is any text: pick one of the header's projects, type another, or
  leave it empty. Its time takes `1:30:00`, `90:00` or `5400` alike. **New** can start the task's
  timer at once with **Start now**. Changing a running task's name, project or notes leaves its
  time counting; only a time you type sets it.
- **Sort the list**, in **Sort**, sorts it by when each task was made, its name, its project, when
  its timer last started, or its time, ascending or descending. Your phone sorts it the same way.

## Archived lists

**Archive the list**, in the toolbar, keeps the current list under a name you give it, stops its
timers, and puts an empty list in its place. **Archived lists** shows them, newest first, each with
its tasks counted, its time and the day it was archived.

An archived list opens in the same view as the current one, and works the same way: its tasks are
added, edited, timed, reset, deleted and moved as yours are. Its head adds three of its own:

- **Restore** makes it the current list. If the current list has tasks, it asks first: **Remove and
  restore** removes them, or **Archive, then restore** archives the current list under the name you
  type, then restores.
- The pencil renames it.
- The bin deletes it, with its tasks, once you confirm.

## Agents and the time tracker

Ask a session's agent to start tracking the task it's on, or to stop a task's timer, and it does,
by tools of Moontors' own MCP server, `moontors`, which a session's agent has (a few start without
it; see [Known limits](/docs/known-limits/#sessions)):

- `time_tracker_list` reads the current list: each task's name, project, notes and time, whether
  its timer runs, and who last changed it.
- `time_tracker_archives` lists the archived lists, and reads one of them.
- `time_tracker_create` adds a task to the current list, its timer started at once if asked.
- `time_tracker_edit` changes a task's name, project, notes or time.
- `time_tracker_start` and `time_tracker_stop` start and stop a task's timer.
- `time_tracker_reset` sets a task's time back to 0:00:00.

No agent asks before any of them, in any mode, as they only change Moontors' own list (see
[Moontors' own tools](/docs/permission-modes/#moontors-own-tools)). An agent changes the current
list alone: it never deletes a task, resets or deletes them all, reorders them, changes the
tracker's settings, archives the list, restores one or changes an archived one. Those are yours.

A task an agent changed last shows that agent's mark, and hovering it shows the session's name.
Anything you change on the task, starting or pausing its timer included, takes the mark off.

## How time is counted

A task's time is counted from when its timer started, by your computer's clock. So it keeps
counting while the window is closed, while the computer sleeps, and while Moontors restarts, as a
stopwatch would. Several timers can run at once.

- A time shows as hours, minutes and seconds, `1:43:06`, the hours as many as it has.
- Setting a running task's time starts its count again from the time you set.
- Archiving the list stops its timers, keeping their time; a timer you start in an archived list
  runs as any other.
- A task's name and project hold at most 200 characters each, its notes 10,000, and its time
  9999:59:59; a list holds at most 200 tasks.

## On your phone

A paired phone has the same time tracker, from the clock at the top right of its board, blue while
a timer runs, as the window's is: the same
lists, timed and changed as in the window, the archived lists and the sort, and each list exported
as a CSV file through the phone's share sheet (see [Time tracker](/docs/phone/#time-tracker) in the
phone's guide).