Memory & State

Leif's persistent-state layers — self-document, bootstrap context, notes, checkpoints, tasks, projects, commitments — and when to reach for each.

Claude is stateless between sessions; Leif is not. Everything that needs to survive a conversation lives on the Leif side, in one of a handful of layers. Each layer has a different shape and a different job. Reaching for the wrong one (a note where a task belongs, a checkpoint where a living doc belongs) works, but it scatters state and makes it harder to find later.

This page is the map of those layers, from “read this every time” to “long-running structured work.”

Self-document

The single, authoritative description of Leif and its operating context. Read at session start, treated as read-only during normal work.

  • read_self — load the self-document

This is the one layer that is always consulted, not consulted on demand.

Bootstrap context (living docs)

Per-scope living documents that capture the durable state of a subsystem — the things that are true across sessions but specific to one area of work. Read the relevant scope before acting in that area; update it when the state changes.

  • bootstrap_context — load the living docs for a scope
  • update_bootstrap_context / update_bootstrap_context_tool — keep them current as state changes

Treat returned living docs as the source of truth for their scope.

Notes

Lightweight, free-form memory for facts and observations that don’t fit a more structured layer. Cheap to write, easy to search.

  • save_note — record a fact or observation
  • get_recent_notes — pull the latest notes
  • search_notes — find notes by content

Checkpoints & progress

State for in-flight work — where a multi-step task left off, so it can resume cleanly in a later session instead of starting over.

  • save_progress — checkpoint the current state of a task
  • load_progress — resume from a saved checkpoint
  • complete_task — mark a checkpointed task done
  • cleanup_old_checkpoints — prune stale checkpoints

Tasks

Discrete, trackable units of work with status and relationships. Use this when something needs to be remembered as a to-do rather than just noted.

  • create_task / capture_task — add a task
  • update_task / complete_leif_task — change status or close it out
  • search_tasks / list_tasks / list_active_tasks — find tasks
  • link_tasks / break_down_task — express dependencies and decompose work

Projects

The container layer above tasks — a named project with its own context, status, and active-project pointer. Use it to group related work and carry project-specific context across sessions.

  • create_project / get_project / list_projects — manage projects
  • set_active_project — set the working context
  • get_project_status / get_project_context / update_project_context — read and maintain per-project state

Commitments

Promises and obligations that need to surface again at the right time — follow-ups, deadlines, things owed to a person. Distinct from tasks in that they are time-aware and meant to resurface.

  • create_commitment / update_commitment / close_commitment — manage commitments
  • list_commitments — review open commitments
  • commitments_due_for_surfacing / mark_commitment_surfaced — surface the ones that are due and record that they were raised

A short-lived emotional-trajectory log maintained automatically by the memory synthesis cycle — no tool writes to it directly. Each extraction window is tagged with valence, energy, and recurring states; a 14-day trend line is injected into the user context so conversations can account for a two-week slump or a streak of wins instead of reading each message in isolation. Entries age out after 28 days, and the layer is read-only from the conversation side.

Disable with AFFECT_TRENDS_ENABLED=false. See Personality & Emotional Range for how the trend feeds tone adaptation.

Higher-level reads

Synthesized views over the layers above — useful for orienting at the start of a conversation or pulling history on a topic or person.

  • get_topic_overview — what’s known about a topic
  • get_person_summary — context on a person
  • conversation_analytics — patterns across past conversations
  • search_past_conversations — find prior discussion