Where did my coding agent's 49 minutes go?
Описание и применение
Профайлер session‑profiler выявил, что 47 из 49 минут, затраченных агентом на слияние и очистку рабочего дерева, ушли на полный запуск тест‑сuites. Это позволило изменить подход к работе с агентом, разделяя тесты на части и выполняя полный запуск в фоне.
Задача
A coding agent spent 49 minutes on a merge and worktree cleanup, but the agent did not explain where the time was spent.
Результат
The profiler revealed that most of the session time was spent on a single test‑suite run, not on the agent’s work. This insight led the author to change how they interact with agents, running relevant subsets of tests during iteration and delegating full runs to background jobs.
Рабочий процесс
- Install session‑profiler plugin for Claude Code or Codex
- Ask the agent to "profile this session"
- Open the local report on 127.0.0.1
- Inspect timeline, tool calls, and background jobs
- Identify longest steps and their durations
- Adjust workflow to run tests in subsets or parallel tasks
Доказательства
47 of those 49 minutes were a single full test‑suite run.
The profiler treats messages the app injects (a side session finishing, a message from another session) as wake‑ups, so the gap before them shows up as a wait, not as the agent working.
In my Codex history, about 64% of commands are recorded as taking under a millisecond, because the log captures only how long they took to start.
- Дата записи: 2026-10-22T15:11:23.915Z