Interactive Diagrams

Visual guides to understanding how Claude works. Each diagram explains a core concept that helps you write better prompts and build more effective applications.

Tokenization

How text is broken down into tokens. Each token is a piece of text that Claude processes. Understanding tokenization helps you optimize prompt length and comprehend how Claude counts input.

Input Text"Hello, world!"Hello1,2 world3!4Each segment = 1 token • 4 tokens total

Context Window

The fixed amount of text Claude can process in a single conversation. Think of it as Claude's working memory. Larger context windows mean you can provide more information, history, and examples.

200K Token Context WindowSystem Prompt~500Conversation History~8KUser Message~200Available for Response~191K~8K~191KClaude 3.5 Sonnet: 200K input • Claude 3 Opus: 200K input

Tool Use

How Claude can call external functions or APIs. When enabled, Claude can request to use tools like calculators, code execution, or web search to provide better answers.

Tool Use CycleUser sendsmessageClaude decidesto use toolToolexecutesResult returnedto ClaudeClaude respondsto userClaude can chain multiple tool calls before responding

Agent Loop

The cycle of thought and action. Claude can iteratively think about a problem, take actions (use tools), observe results, and refine its approach. This enables complex problem-solving.

Agentic LoopThinkPlan next stepActExecute actionObserveCheck resultsDecide if doneDoneReturn result

Ready to dive deeper?

Explore lessons that explain these concepts in detail.

View All Lessons