Skip to content
Mnema docs

Optimize

Optimize reads your sessions and surfaces where agent work is slow, expensive or failing — ranked by likely return. Findings are recomputed nightly and can be run on demand.

FindingWhat it flags
Stalla session whose tool calls went idle mid-run
High retrya task retried three or more times
Cost overruna session costing well above the workspace median
Token bloata session using far more tokens than its peers
Paralleltasks that could have run in parallel but didn’t
Context widea session that touched an unusually large number of files

Each finding is scored for ROI so the highest-leverage ones sort to the top. Findings are recomputed on a nightly job (and whenever you press Run); the underlying statistics refresh hourly.

Cost overrun, token bloat and context-wide findings need populated cost/token/files data — so they only appear once the hook is capturing real sessions. Stall, high-retry and parallel findings work from task and tool-call data alone.

  • For a finding tied to a task, Apply writes a fix hint onto the task and appends it to the task description — so the next agent that claims it (via get_next_task) sees the guidance. This is a real feedback loop back into the board.
  • For a session-scoped finding with no task, Apply just marks it handled. Use the Prompt action to generate a paste-ready prompt you can hand to an agent instead.