Token problems: 13 of 20

By Prof. Tom Yeh

Published: 2026-05-28

URL: https://www.byhand.ai/p/library-agents-tokens-the-system-prompt


Token problems: the workbook

  1. Count the Tokens
  1. Subword Splitting
  1. Punctuation Counts
  1. Tokens per Word
  1. Will It Fit?
  1. The Price of a Call
  1. Two Kinds of Token
  1. Input or Output?
  1. The Two-Part Bill
  1. End-to-End Call Cost
  1. Comparing Three Calls
  1. The Average Call
  1. The System Prompt
  1. The System Prompt Tax
  1. Calls in a Budget
  1. Tokens on a Budget
  1. How Long Will It Take?
  1. The Split Matters
  1. Pricing per Million Tokens
  1. Tokens from the Bill

Why does every call start with the same block of tokens? The model has no memory between turns, so the agent re-sends its instructions at the front of every call. That block is the system prompt: it defines how the agent behaves, and it costs tokens every single time. Labeling where it ends and the user message begins makes the per-call overhead visible.

Problem

The model replied bonjour to the user's message translate hello into french. The tokens before the user message are the system prompt. Label each token S for system prompt, U for user message, or O for output.

Label each token S, U, or O

Count the tokens of each kind

Practice 1

The model replied here is the fix to the user's message fix the login bug. The tokens before the user message are the system prompt. Label each token S for system prompt, U for user message, or O for output.

Label each token S, U, or O

Count the tokens of each kind

Practice 2

The model replied it is three pm now to the user's message what is the time. The tokens before the user message are the system prompt. Label each token S for system prompt, U for user message, or O for output.

Label each token S, U, or O

Count the tokens of each kind


Next: 14. The System Prompt Tax