Turning hostile event logs into one timing report
Every Amplifier session writes an events.jsonl file recording exactly what happened and how long each step took. The record exists — but it's written for machines, not for reading.
So the log that holds the answer is precisely the thing you can't read. Why?
A single session generates potentially thousands of events across a tree of parent/child agent sessions — and one tool output can run 100k+ tokens. Read it directly and you blow the context window.
A plan on paper wouldn't help. So what actually shipped?
manojp99/amplifier-bundle-session-insights is a complete Amplifier bundle: a standard-library-only tool with a pure analysis engine and a full test suite — 66 pass, 5 skipped (those 5 need real session data on disk).
Shipped — so how does one tool make a hostile file tractable?
The timing_analysis tool does all the heavy computation in one pass — parsing events, building turn trees, computing durations, identifying bottlenecks. The agent is instructed: "You do NOT parse events yourself."
One pass on a flat file is easy. But the tree is nested…
The tool discovers child sessions from delegate:agent_spawned events (via data.sub_session_id) and recurses into them — the exact hostility a human reader can't chase by hand.
Now the analysis spans the whole tree. But won't the output be huge?
By design the report stays small enough to hand to a model — the move that closes the loop back on the hostile file. No raw payloads survive the summary.
Small enough to read. So what does one prompt actually get you?
The hostile tree collapses into a single time budget that categorizes active time, while idle gaps are excluded. The specialist session-performance-analyst interprets the pre-computed JSON — and never touches a raw event.
That's the answer to "where did the time go?" — and it's a reusable pattern.
When data is hostile to a model, put a pure, budgeted tool between the events and the agent. The tool computes; the agent interprets. That's how a hostile event tree becomes an actionable report.
A pattern you can lift into any place raw data outsizes the context window.
Feature status: Complete and tested Amplifier bundle (15 commits ending 2026-04-22; independently re-verified against a fresh clone).
Repository: manojp99/amplifier-bundle-session-insights (the suggested michaeljabbour/amplifier-module-hooks-event-broadcast was checked and ruled out — it is event broadcasting, not timing analysis).
Research performed:
gh repo clone manojp99/amplifier-bundle-session-insights; gh repo view michaeljabbour/amplifier-module-hooks-event-broadcastgit log --pretty='%h %ad %s' --date=short; git shortlog -sne --all; git rev-list --count HEADuv run --with pytest --with pytest-asyncio python3 -m pytest -q → 66 passed, 5 skipped in 0.06sgrep -rc 'def test_' tests/test_*.py → 71wc -l amplifier_module_tool_timing_analysis/*.py → 1,061 totalcat README.md, cat docs/TIMING_GUIDE.md, grep -n '100' parser.py, grep -n '\[:10\]' analyzer.py, grep -n 'max_depth|depth_limit|agent_spawned' analyzer.pyGaps: "304 sessions / six projects / a week of AI work" demo framing does not appear in the repo and is excluded. End-to-end runtime "in milliseconds" is not benchmarked here; what is verified is millisecond-granularity duration computation and a ~0.06s test suite.
Primary contributor: Manoj Prabhakar Paidiparthy <mpaidiparthy@microsoft.com> — 15 commits (sole author, 100%).