Context is the information available within a conversation that frames a model’s response. It includes your prompts, the model’s replies, and information brought in through tool use. Relevant background—such as your tech stack or constraints—helps prevent the model from filling gaps with incorrect assumptions. section 1.4.1 section 2.3
Each new Claude chat or code session starts with a clean slate. State the problem space again, including relevant files, architecture decisions, and constraints. Starting fresh can also help when a conversation has become stuck on a bad idea. section 1.4.1 section 2.9
Build a useful opening prompt around four elements:
- Goal: specify the task and the deliverable you want. section 2.4
- Context: include relevant infrastructure, preferred stack, scale, and team circumstances. section 2.4
- Constraints: state limits such as security requirements or budget. section 2.4
- Format: specify the structure and level of detail, or a format such as JSON or Markdown. section 2.4
Frame a cloud migration
Instead of asking only which cloud services to use, try: “Help me plan a migration of our website and backend. Our current infrastructure is [describe it], our preferred stack is [stack], and our budget and security constraints are [constraints]. Recommend services and estimate effort and running costs. Organize the answer by service, rationale, and open questions.” Fill in the details that matter, then review assumptions and refine the request. section 2.4 section 2.9
Context grows with each turn and is measured in tokens. Tool results, including loaded web pages or files, can add thousands of tokens. A conversation has a context-window limit distinct from usage limits; Claude Code can summarize and compress context to continue longer sessions. section 1.4.1
Figure 1.2 How context builds over the turns of a conversation. The input grows cumulatively and there can be huge jumps from tool use when Claude is researching file content or web pages.
See how conversation turns and tool results increase the context over time. section 1.4.1
Check the response for missing details and unsupported assumptions. Supply corrections or evidence and iterate; if the conversation has gone sideways, start a new session with a clearer opening prompt. section 2.3 section 2.9





























