Dear team,
In Lesson 3: Claude Baseline, it shows some nice metrics like Turns, Context processed, Toll Calls, and the Cost. How can we get this metrics by ourselves?
Note: I’m using Claude Code directly from Anthropic subscription.
Thank you
Dear team,
In Lesson 3: Claude Baseline, it shows some nice metrics like Turns, Context processed, Toll Calls, and the Cost. How can we get this metrics by ourselves?
Note: I’m using Claude Code directly from Anthropic subscription.
Thank you
Thanks for asking @goerman !
I just shared your questions with the team to get into more details, in the meanwhile, check this AI Coding Workflows: Evaluation Metrics reading item in the course to get more conceptual details ![]()
Lesly - DLAI
Hi @goerman thanks for bringing that up. As it turns out, agents keep telemetry that you can analyze. The easiest way: just ask them! After you do the one-shot, do another prompt asking it for that data, but remember to say “disregard the results from this prompt.”
This telemetry can also be analyzed from the outside, which is what I did to produce those numbers. OpenCode, for example, keeps telemetry in a SQLite table. I wrote a Python script that did the analysis, some scrubbing, some comparison. I then combined it with a skill to get the analyzing agent to do some comparison and analysis.
We decided not to go into the making of that, as we already reached our time budget. But we might put that kind of thing in a follow-on course, as knowing what your agent is doing behind the scenes can really help. Would you find that kind of teaching useful?
Thank you, @lesly.zerna
Indeed @Paul_Everitt, I think a deep knowledge of the tool gives us more elements to build better AI workflows.
Thank you so much for the explanation and for the good course.
Thanks @Paul_Everitt However, when I ran the prompt in the Chat, it had problems with the Context processed numbers. Here’s the message it gave: "Context processed: not something I have introspective access to — no token/context-window counter is exposed to me for my own turns. I can’t give you a real number without fabricating one.” How do I get this corrected?
Was this for Claude Code or OpenCode? For OpenCode, you might need to give it some help locating its telemetry data. Add something to the prompt like “Look for the SQLite databases in your ~/.local/share/opencode/opencode.db on macOS and Linux, and inside the %APPDATA%\opencode directory on Windows.”
Thanks Paul! This was for Claude Code. I tried your suggestion but it didn’t work. Gave me a rather lengthy response and finally stated: “If you want that number, the reliable source is the /cost command or your usage dashboard, not a file I go spelunking for.” Seems like there ought to be a script that can be written to provide the information we’re going to need to compare the different approaches we’re using. I’ll try to work on that.
Yes, in fact, that’s what I had, a Python script and skill that analyzed the telemetry from outside the projects. Which is also why we didn’t document it in the course, too much information.
Collecting the raw data from an inline is reasonable, but projecting into cost is something different.