# Richer agent transcripts + lifecycle data for observability (Langfuse / stop hooks)

**URL:** <https://forum.cursor.com/t/richer-agent-transcripts-lifecycle-data-for-observability-langfuse-stop-hooks/166592>\
**Category:** Feature Requests\
**Tags:** hooks, cli, cloud-agents\
**Created:** [July 24, 2026, 11:43pm UTC](https://forum.cursor.com/t/richer-agent-transcripts-lifecycle-data-for-observability-langfuse-stop-hooks/166592 "2026-07-24T23:43:35Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![deanrie](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/deanrie/32/1263_2.png) [@deanrie](https://forum.cursor.com/u/deanrie)\
**Post date:** [July 26, 2026, 5:49pm UTC](https://forum.cursor.com/t/richer-agent-transcripts-lifecycle-data-for-observability-langfuse-stop-hooks/166592/5 "2026-07-26T17:49:50Z")

</div>

Hey, thanks for such a well thought-out request. The Ask 1 to 5 breakdown with an example of the desired JSONL schema is exactly the level of detail we need. I’ve forwarded it as a feature request.

I also want to clarify the status on a few items so you don’t build a pipeline on the wrong expectations:

- `stop` payload: it fires in local CLI plus IDE and includes `conversation_id`, `transcript_path`, `model` or `model_id` or `model_params`. Token usage `input_tokens`, `output_tokens`, `cache_*` is not included in the `stop` payload right now. That’s one of the key points in your request and it’s tracked.
- Token usage, thinking, and assistant message are available today via headless `--print` with `--output-format stream-json`. The final `result` event includes token usage and the request ID, and along the way you also get thinking deltas and the full assistant message. For cost dashboards and trace reconstruction, this is a workable interim option without transcript enrichment.
- `afterAgentResponse` and `afterAgentThought`: these do not fire in CLI right now, neither headless nor interactive. This is a known gap, see [Hooks afterAgentResponse / afterAgentThought not firing in headless CLI](https://forum.cursor.com/t/hooks-afteragentresponse-afteragentthought-not-firing-in-headless-cli/156220). They work in the IDE.
- Env for hooks Ask 4: the `sessionStart` hook response can set env for later hook calls in the session, but there are important caveats. Subagents do not inherit that env, see [SubAgents do not inherit environment variables](https://forum.cursor.com/t/subagents-do-not-inherit-environment-variables/155212), and variables are lost when you close and reopen a chat or restart Cursor. `sessionStart` is not replayed on resume, see [Env exported in sessionStart hook does not persist across Cursor restarts](https://forum.cursor.com/t/env-exported-in-sessionstart-hook-does-not-persist-across-cursor-restarts/157196). So as a channel for persistent secrets it’s not reliable right now. Sidecar files are the more honest option for now.

On the main asks, Ask 1 transcript schema enrichment, per-row timestamps, `usage`, `tool_result` with `tool_use_id`, stable IDs, per-row model, and Ask 2 flush or ready signal before `stop`, there’s no implementation timeline yet. The request is logged in that form.

Also, a sample current vs desired JSONL from your local `agent-transcripts/` would be helpful. If you can share it here, it’ll help us pin down the minimum viable schema more precisely.

---

_[View the full topic](https://forum.cursor.com/t/richer-agent-transcripts-lifecycle-data-for-observability-langfuse-stop-hooks/166592)._
