Skip to content

Leverage

leverage = agent_seconds / human_seconds

The whole product exists to make this number visible — per topic, per period — and to surface its trend over time.

Codika sells outcomes per client. A rising leverage ratio on a given client means the team produces more output for each hour of attention paid. Falling leverage on internal R&D is fine and expected (R&D is human-heavy). Falling leverage on ops or platform work is a flag.

The trend matters more than the absolute number, because both numerator and denominator are conventions, not stopwatch readings.

Implemented in codika-os-cli/src/core/human-time.ts. Weighted capped-gap convention:

  1. Order the user prompts in a session by timestamp.
  2. For each consecutive pair, compute the gap in seconds.
  3. Cap each gap at 180s. Long gaps usually mean the user walked away; we don’t credit them as attention.
  4. Weight each gap by the prompt length that bookended it (rough proxy for engagement).
  5. Sum.

This isn’t wall-clock time. It’s a convention chosen so the trend is stable across days where you took long breaks vs days where you didn’t. Absolute values are not directly comparable to a stopwatch.

If you want to revisit the cap or the weighting, edit core/human-time.ts and run codika-os sync --full to backfill — human/agent recompute happens at sync time on the CLI side, not at classification time on the dashboard. (See codika-os-app/docs/tracking-system-plan.html for context.)

Implemented in core/jsonl-parser.ts plus the PostToolUse hook. Sum of model-streaming durations recorded per tool call in session_tool_calls.duration_ms.

Streaming time is the closest analog to “the agent was working”. It excludes the time between turns (which is human time, already capped) and the time the user spent reading output (also human time).

Implemented in core/jsonl-parser.ts:computeCostUsdCents. For each message in the JSONL transcript:

input_tokens × MODEL_RATES_PER_MTOK[model].input
output_tokens × MODEL_RATES_PER_MTOK[model].output
cache_read_tokens × MODEL_RATES_PER_MTOK[model].cacheRead
cache_write_tokens × MODEL_RATES_PER_MTOK[model].cacheWrite

MODEL_RATES_PER_MTOK is a static table in the same file. When Anthropic ships a new model, update this table.

PageWhat it answers
/tracking overviewTotal human, total agent, leverage, cost — for the period. Donut KPIs and per-topic table.
/tracking/topics/<slug>The same numbers, scoped to one topic. Plus session list and leverage sparkline.
/tracking/sessions/<id>One session: timeline, tool mix, attribution debug.
/timesheetHeatmap of activity, day × hour, color-coded by topic.

There’s no universal threshold. The system is built to make the trend visible. Compare a topic’s leverage this week vs the rolling 4-week average. If it’s rising, AI is doing more of the work per hour of attention. If it’s flat or falling, ask why before assuming.

For a longer narrative on the methodology, decisions, and open questions, read codika-os-app/docs/tracking-system-plan.html (interactive). It’s the canonical source of why for every non-obvious choice in this concept.