What is context in a prompt and how much to give

Context is the information the AI cannot guess. Learn what to include, what to avoid and how to organize documents and data inside a prompt.

Context is all the background information that lets the AI understand your situation: who you are, who the result is for, what data you have and what limitations exist. It is, by far, what improves answer quality the most.

What to include

  • Audience: who the result is for and what they already know.
  • Goal: what you will use it for.
  • Situation: what happened, what was tried, what did not work.
  • Data: figures, texts, examples, relevant documents.
  • Limitations: budget, deadlines, company rules, available tools.

What to avoid

  • Irrelevant information: it distracts the model.
  • Sensitive data: passwords, third parties' personal data, confidential information.
  • Contradictions: “be very detailed” and “max 50 words” in the same prompt.

Example

No context

Which laptop should I buy?

With context

I need a laptop to edit 4K YouTube videos (Premiere Pro), I travel a lot and my maximum budget is $1,600. I currently use a 2018 laptop that takes ages to export. Compare 3 recommended configurations (CPU, GPU, RAM, screen) and explain which features to prioritize. Do not recommend specific models: I want to know what to look for.

Organizing long context

When you provide documents, emails or data:

  1. Delimit each block (triple quotes, tags such as <document>, headings).
  2. Say what each block is: “below, the current contract” or “these are last month's customer comments”.
  3. State the question or task clearly, ideally after the documents.

Persistent context

Many tools let you save fixed context (custom instructions, projects, memory). Use it for information you always repeat and keep the prompt for what is specific.

Learn prompting

  • What is a prompt and how does it work

    A prompt is the instruction you give an artificial intelligence. Learn its parts, why the result depends so much on how you write it, and how to get started.

  • How to create a prompt from scratch

    A 6-step method to go from a vague idea to a clear, reusable prompt, with a complete end-to-end example.

  • How to write effective prompts

    Ten practical principles to write prompts that work on the first try more often: clarity, specificity, examples, format and review.

  • How to write prompts for ChatGPT

    Practical tips to get more out of ChatGPT: message structure, custom instructions, long conversations, files and reviewing answers.

  • How to write prompts for Claude

    How to write prompts for Anthropic's Claude: direct instructions, rich context, long documents, tags for structure and requests for reasoning.

  • How to write prompts to generate images

    The structure that works best in Midjourney, DALL-E, Stable Diffusion, Flux or Firefly: subject, style, light, composition and parameters, with examples.

  • How to write prompts to generate videos

    How to describe a shot for Runway, Kling, Sora or Veo: one subject, one action, camera movement, light and mood. And how to plan multi-shot videos.

  • How to improve a bad prompt

    A diagnostic process to find out why a prompt is not working and how to fix it, with a before-and-after example and a prompt to let the AI help you.

  • What are variables in a prompt

    Variables turn a prompt into a reusable template. Learn how to define them, name them and use them on HomeCasa Prompts.

  • How to define roles in a prompt

    What telling the AI “act as…” really does, how to choose a good role, combine it with concrete criteria and avoid roles that do not help.

  • How to structure prompt instructions

    Numbered steps, delimiters, sections and logical order: how to organize a long prompt so the AI does not skip anything.

  • Good and bad prompt examples

    Eight comparisons of real prompts for text, code, image and video, explaining what fails in the bad version and what the good one improves.

  • Common mistakes when writing prompts

    The ten most common prompt-writing mistakes and how to avoid them: from missing context to blindly trusting the answer.

  • Advanced prompting techniques

    Few-shot examples, step-by-step reasoning, prompt chaining, self-critique, structured outputs and evaluation: techniques for more reliable results.