tokprof — LLM Token Profile
Zero-code LLM input token decomposition — system prompt, conversation history, user prompt, and tools, carefully composed.
1. Input Token Breakdown (Total) & Diagnostic Dossier
1. Input Token Breakdown (Total)
| Component | Tokens | Share | Distribution |
|---|---|---|---|
| System prompt | 44,800 | 61.4% | |
| History: user turns | 2,670 | 3.7% | |
| History: assistant turns | 1,400 | 1.9% | |
| Current user prompt | 1,870 | 2.6% | |
| Tools: definitions | 16,800 | 23.0% | |
| Tools: results | 4,620 | 6.3% | |
| Unattributed (template/hidden) | 840 | 1.2% |
Findings & Recommendations (6)
- First-Call Fixed Overhead
- 9,200 tok
- Median Input per Call
- 9,600 tok
- Prompt Cache Efficiency
- 65.3% (47,700 / 73,000)
- Turn Fan-out (Median / Max)
- 2 / 4 calls
HIGH
2 tool definition(s) were sent but never called (14,000 tokens, 19.2% of input): browser_open, notebook_edit
Troubleshooting guide →HIGH
A system 'system#agent-rules' block of 6,400 tokens was sent in 7 calls (44,800 tokens, 61.4% of input)
Troubleshooting guide →MEDIUM
A tool_def 'browser_open' block of 1,100 tokens was sent in 7 calls (7,700 tokens, 10.5% of input)
Troubleshooting guide →MEDIUM
A tool_def 'notebook_edit' block of 900 tokens was sent in 7 calls (6,300 tokens, 8.6% of input)
Troubleshooting guide →HIGH
Tool call 'run_tests' was repeated 3 times in a row (28,800 input tokens): add a loop guard that redirects after identical calls
Troubleshooting guide →HIGH
Conversation history grew 11.8x across 5 turns (from 480 to 5,640 tokens): compact older turns or isolate sub-tasks in fresh sessions
Troubleshooting guide →
EDITION LINEAGE / TOKEN FLOW
1 session(s) · 3 turn(s) · select a call node to open its dossier
Baseline → Turn Progression → Call Execution
02 / SESSION DOSSIER
↑ Navigation
2. Per-Session Summary
| Session | Turns | Calls | System Prompt | Conv History | User Prompt | Tools & Schema | Total Input | Cached | Output |
|---|---|---|---|---|---|---|---|---|---|
| S1 65% cached | 3 | 7 | 44,800 | 4,070 | 1,870 | 21,420 | 73,000 | 47,700 | 1,580 |
03 / TURN LINEAGE
↑ Navigation
3. Per-Turn Breakdown (System Prompt vs. Conversation History vs. User Prompt)
| Turn | Calls | System | History | User | Tools | Input | Cached | Out | Composition |
|---|---|---|---|---|---|---|---|---|---|
| S1 · Turn 1 | 4 | 25,600 65% | 2,230 6% | 930 2% | 9,960 25% | 39,200 | 28,400 72% | 680 | |
USER PROMPT930 tok (2%) Fix the failing discount boundary test in checkout.py CONVERSATION HISTORY2,230 tok (6%) User/Context Fix the failing discount boundary test in checkout.py Assistant Running pytest on tests/test_checkout.py ASSISTANT OUTPUT680 tok toolread_file pathsrc/checkout.py | |||||||||
| S1 · Turn 2 | 1 | 6,400 42% | 1,440 10% | 540 4% | 6,600 44% | 15,100 | 10,300 68% | 420 | |
USER PROMPT540 tok (4%) Patch >= 100 boundary and verify with .venv/bin/pytest -q CONVERSATION HISTORY1,440 tok (10%) User/Context Fix the failing discount boundary test in checkout.py Assistant Read src/checkout.py (unfiltered full file read: 4,200 tokens) ASSISTANT OUTPUT420 tok Patched boundary check (`>= 100`) and verified with `.venv/bin/pytest -q` (14 passed). | |||||||||
| S1 · Turn 3 | 2 | 12,800 68% | 400 2% | 400 2% | 4,860 26% | 18,700 | 9,000 48% | 480 | |
USER PROMPT400 tok (2%) Run test suite for currency rounding module CONVERSATION HISTORY400 tok (2%) User/Context Run test suite for currency rounding module Assistant pytest not on PATH; switching to .venv/bin/pytest ASSISTANT OUTPUT480 tok All 8 rounding tests passed in 0.09s. | |||||||||
04 / CALL INSPECTOR
↑ Navigation
4. Per-Call Timeline & Full Prompt Inspector (7 of 7 call(s))
| # | Turn | Model / Step | System | History | User | Tools | Input | Cached | Out | Time | Prompts & Response |
|---|---|---|---|---|---|---|---|---|---|---|---|
S1·T1 | m-largecoding-agent | 6,400 | 0 | 280 | 2,400 | 9,200 | 0 | 310 | 620 ms | ||
System Prompt6,400 tokens
Current User Prompt280 tokens Fix the failing discount boundary test in checkout.py Tools & Response Schema2,400 tokens
Assistant Output310 tokens {
"tool": "run_tests",
"cmd": "pytest tests/test_checkout.py"
} | |||||||||||
S1·T1 | m-largecoding-agent | 6,400 | 420 | 200 | 2,460 | 9,600 | 9,000 | 120 | 410 ms | ||
S1·T1 | m-largecoding-agent | 6,400 | 740 | 220 | 2,520 | 10,000 | 9,500 | 110 | 390 ms | ||
S1·T1 | m-largecoding-agent | 6,400 | 1,070 | 230 | 2,580 | 10,400 | 9,900 | 140 | 530 ms | ||
S1·T2 | m-largecoding-agent | 6,400 | 1,440 | 540 | 6,600 | 15,100 | 10,300 | 420 | 710 ms | ||
S1·T3 | m-largecoding-agent | 6,400 | 0 | 280 | 2,400 | 9,200 | 0 | 280 | 580 ms | ||
S1·T3 | m-largecoding-agent | 6,400 | 400 | 120 | 2,460 | 9,500 | 9,000 | 200 | 490 ms | ||
05 / TOPOLOGY & ENDPOINTS
↑ Navigation
Per-Step Token Map & Detected Endpoints
Per-Step Token Map
| Step | Label / Model | Calls | Input | Fixed/Call |
|---|---|---|---|---|
agent_ | coding-agent | 7 | 73,000 | 8,800 |
Detected Endpoints
| Host | Class | API | Calls | Input |
|---|---|---|---|---|
api.example.com | cloud | openai_chat | 7 | 73,000 |
Provenance & Measurement Methodology
Segment token counts are local tokenizer estimates (tiktoken BPE / heuristic); Unattributed is provider-reported input tokens minus counted segments (message framing, images, or hidden tokens). HTTP Authorization headers and API keys are never stored, and secrets matching token patterns are automatically redacted before writing.