# Habits · frequency and logs

A Habit is something the person repeats, with a cadence that is a soft target. Xale counts progress in the current period and never counts streaks.

Checked 2026-12-04 · https://xale.app/docs/ai/habits-frequency-and-logs

## Fields

`xale_read_habits` returns active Habits (filter with `areaId`):

| Field | What it is |
| --- | --- |
| `id`, `title` | The Habit |
| `cadence` | How often, below |
| `surfaceKind` | `habit`, or `event`, meaning it's offered on set weekdays |
| `anchor` | `{ "dows": [1, 3, 5] }`: ISO weekdays, 1 is Monday, 7 is Sunday |
| `archived` | `true` or `false` |
| `areaIds`, `linkedProjectIds` | Areas, Projects |
| `workerIds` | The People who do it |
| `steps` | Checkable steps with IDs, labels and optional durations |
| `linkedMilestoneIds`, `milestones` | Visible link IDs and bounded details (`id`, `title`, `date`, `endDate`) |
| `milestonesTruncated` | Some linked Milestone lookups were skipped |

A batch looks up at most 500 distinct Milestone IDs across all Habits. A single-Habit retry gets its own budget of up to 20. If `milestonesTruncated` is true, pass the Habit's `id` for an individual read. For other visible `linkedMilestoneIds`, use `xale_read_milestone`.

A Habit has no time of day. To give it time, put an occurrence into a day with `xale_schedule_intention` (`kind: "habit"`).

## Cadence

| `cadence` | Target |
| --- | --- |
| `{ "kind": "daily" }` | Once a day |
| `{ "kind": "perWeek", "target": 3 }` | 1 to 21 a week |
| `{ "kind": "perMonth", "target": 2 }` | 1 to 62 a month |
| `{ "kind": "perQuarter", "target": 1 }` | 1 to 92 a quarter |
| `{ "kind": "perYear", "target": 2 }` | 1 to 366 a year: “twice a year” |

The target is soft: Xale never counts streaks.

## Progress

`xale_read_today` gives each active Habit's progress in the current period: `completed`, `target` (1 for daily) and `remaining`.

## Creating and changing

| To | Use |
| --- | --- |
| Create | `xale_create_habit`: `title`, `cadence`, optional `durationMin` (5 to 480), `areaIds`, `description`, `people`, `projects`, `milestones`, ordered `steps` titles, and a `requestId` |
| Change title, description, cadence, duration (`durationMinDefault`, 5 to 1,440), `surfaceKind`, weekdays, or the Note or Mindmap behind it | `xale_update_habit` |
| Add or edit Steps | `xale_update_habit` with `steps`, merged by ID. A label-only edit keeps the existing duration. |
| Change linked Milestones | `xale_change_links` on the Habit with `milestones` |
| Archive | `xale_prepare_removal` with `archive_habit`, then the person's yes |

## Logs

| To | Use |
| --- | --- |
| Complete a day's occurrence (today unless `date` is given) | `xale_complete_habit`. Completing it twice changes nothing. If the day has several occurrences, the refusal lists them; send `instanceId`. |
| Complete it through its time block | `xale_complete_block` |
| Keep a dated entry in the person's words | `xale_record_entry` with `kind: "habit"`: it goes on the Habit's log Note, made and linked the first time |

## Nudges

If the person wants nudging about a Habit, offer a check-in at a time they choose. It reaches them when your own app runs it: see [Check-ins](https://xale.app/docs/ai/check-ins-recurring-workflows).

## Limits

Pro allows 500 Habits.

## Related

- For people: [How do I set habit frequency in Xale?](https://xale.app/help/habit-frequency-daily-to-monthly)
- For people: [How do I mark a habit as done in Xale?](https://xale.app/help/log-a-habit-or-correct-it)
- Tools: [xale_read_habits](https://xale.app/docs/ai/tools/xale_read_habits)
- Tools: [xale_create_habit](https://xale.app/docs/ai/tools/xale_create_habit)
- Tools: [xale_update_habit](https://xale.app/docs/ai/tools/xale_update_habit)
- Tools: [xale_complete_habit](https://xale.app/docs/ai/tools/xale_complete_habit)
- Tools: [xale_record_entry](https://xale.app/docs/ai/tools/xale_record_entry)
- Read next: [Things to repeat · as a Habit](https://xale.app/docs/ai/things-to-repeat-as-a-habit)
- Read next: [Reminders · how a check-in reaches the person](https://xale.app/docs/ai/reminders-how-a-check-in-reaches-the-person)
