---
title: "What Is the Context Sandwich Prompting Framework?"
url: "https://goremy.ai/blog/articles/context-sandwich-goal-based-prompting-framework"
author: Luis Chavez-Mattos
editor: Luis Chavez-Mattos
editor_title: Director, Product
published: "2026-11-30T05:40:19.679Z"
updated: "2026-11-30T05:40:19.679Z"
topic: Business Writing Templates
description: The context sandwich wraps an AI task with who you are on top and what good looks like at the bottom. Learn goal-based prompting with examples and templates.
---

# What Is the Context Sandwich Prompting Framework?

> The context sandwich wraps an AI task with who you are on top and what good looks like at the bottom. Learn goal-based prompting with examples and templates.

Edited by Luis Chavez-Mattos, Director, Product · Published 2026-11-30

## What is the context sandwich prompting framework?

The context sandwich is a way to write a prompt in three layers. The top layer says who you are and where you stand right now. The middle layer is the task. The bottom layer says what good looks like, either as a goal or as a concrete example such as a sample report or contract. The idea is that modern AI models can work out the "how" on their own, but they cannot guess your situation or your standard for success.

## TL;DR

- The **context sandwich** puts your background above the task and a definition of success below it.
- Early AI use rewarded **iterative prompt engineering**. Today's models are good at figuring out the right prompt themselves, so your job shifts to supplying the missing facts.
- **Goal-based prompting** means telling the AI where you want to end up, plus enough about your current situation for it to plan the route.
- The bottom slice works best as **a concrete example or a measurable target**, not a vague adjective like "professional."
- Once a sandwich works, **save it** as a reusable template, or as a skill in tools that support them.
- The framework matters even more with AI agents that run on their own, because they act on the goals and context you gave them.

## Why has prompting changed?

In 2022 and 2023, getting a good result from a chatbot took experimentation. You wrote a prompt, read the output, adjusted the wording, added context, and tried again. Some people went through dozens of versions of one prompt. That loop is why it was called prompt engineering.

Models have since become much better at the engineering part. Given a task, they can work out which extra context would be relevant and effectively prompt themselves in the background. They also handle long-running tasks better than earlier models did. The creator behind the AI Advantage channel, who coined the context sandwich, describes the result as a move from prompt engineering to what he calls goal-based prompting.

This does not make your input optional. The model can improve a prompt's structure, but it has no way to know your industry, your audience, your numbers, or your idea of a finished result unless you say so.

## What is goal-based prompting?

Goal-based prompting means you describe the destination instead of dictating every step. You tell the AI where you want to go. You give it enough information about where you are now. Then it figures out how to get from one to the other.

Compare two requests:

- **Step-based:** "Write a 300-word email. Use a friendly tone. Start with a greeting. Mention the delay. End with a question."
- **Goal-based:** "I manage a small accounting team. A client's audit documents are three days late. I want them to send the files by Friday without feeling blamed, and I want to keep the relationship warm."

The second version gives the AI something to reason about. It can choose the tone, length, and structure itself, and it can explain why.

The goal-based version needs enough information to work with. That means context about you, your values, any relevant numbers, and the software you use. That is exactly what the sandwich organizes.

## How do you build a context sandwich?

Write each layer in order. Each one is a few sentences, not an essay.

**Top slice: who you are and where you are now.** Include your role, your company type or team, the audience, relevant constraints, and the current state of the work. Add numbers if they matter.

**Middle: the task.** Say what you want done, plainly.

**Bottom slice: what good looks like.** State the goal. Better still, paste an example of the format you want held: a past report, a contract template, a sample email you liked. Or give a concrete target, like "a one-page summary a busy director can read in two minutes."

Here is a template you can copy:

```
CONTEXT (who I am, where I'm at):
I am [role] at [type of company/team]. I'm working on [project].
Right now: [current situation, key numbers, tools I use].
My audience is [who will read or use this].

TASK:
[What I want you to do.]

WHAT GOOD LOOKS LIKE:
The goal is [specific outcome].
It should match this example: [paste example or describe format].
I'll know it worked if [measurable check].
```

## What does a before-and-after example look like?

Here is a plain prompt a recruiter might type:

> Write a job post for a customer support specialist.

The output will be generic, because the AI knows nothing about you. Now the sandwich version:

```
CONTEXT:
I'm a recruiter at a 60-person software company. We've had trouble
attracting applicants who can handle technical questions. Our last
posting got many applicants but few who were qualified. Our support
team works remote, in US time zones.

TASK:
Write a job post for a customer support specialist.

WHAT GOOD LOOKS LIKE:
The goal is to attract applicants who are comfortable troubleshooting
software, and to discourage those who aren't. Use the tone and
structure of the posting I've pasted below. Keep it under 400 words.

[pasted previous posting we liked]
```

Nothing about the task changed. The AI now knows the real problem (too many unqualified applicants), the audience, and the format to match. It can decide for itself to include a sample troubleshooting scenario or a requirements section that filters people out.

## Why does the bottom slice matter most?

Most people write the top and the task and skip the end. That leaves the AI guessing at success, and it tends to guess "average."

A concrete example is the strongest version. If you want a report in a certain layout, paste a past one. If you want a contract clause in your company's style, paste the existing contract. If you have a goal, make it checkable: a number, a deadline, a length, a reader. "Make it better" is not a goal. "A manager should be able to approve this in one read" is.

The bottom slice also tells the AI why the task matters. The source describes this as turning the task into more than a task: when the AI knows why and for whom, it can serve you rather than just complete an instruction.

## How do connectors, skills, and agents fit in?

Typing your background into every prompt gets old. Several tools now reduce that work.

- **Connectors** let tools like ChatGPT and Claude pull information from other services, such as email or files in a drive, instead of you copying and pasting it. Technically they run on a standard called MCP (model context protocol). In ChatGPT they are called plugins and in Claude they are called connectors. Some connectors can also act, such as drafting emails or creating files, depending on the mode you use.
- **Skills** are packaged prompts, and they can include scripts and a whole folder of files. If you have a sandwich that works, a skill lets you call it again without retyping it. Both Claude and ChatGPT now use that name, so skills can move between them.
- **Personal agents** are AI assistants that run continuously and prompt themselves regularly, asking how they could help you. If one has your email and calendar, it might notice a double-booked meeting and draft a rescheduling note for your approval.

The sandwich helps with all three. A connector supplies facts for the top slice. A skill stores the whole sandwich. An agent that remembers your goals can propose useful actions without being asked, but only if it knows what you are trying to achieve.

## What are common mistakes with the context sandwich?

- **Writing a biography instead of context.** Include only what changes the answer: role, audience, constraints, current numbers.
- **Describing success with adjectives.** "Professional and engaging" means little. An example or a target means a lot.
- **Prescribing every step anyway.** If you dictate the method, you block the model from finding a better one. Specify steps only when a step is truly required, such as a compliance rule.
- **Never saving what works.** The source's point about people who get great results is that they have a system, a middle layer between themselves and the AI, built and refined over time. Your saved sandwiches are the start of that.
- **Expecting one pass to be final.** Treat the first answer as a draft and adjust the top or bottom slice, not the whole prompt.

## What does this mean for you?

**If you use AI occasionally,** stop hunting for magic phrases. Spend your effort on two things: a short paragraph about your situation, and a sample or target for the result. That is a bigger upgrade than any wording trick.

**If you manage a team,** the sandwich is a good standard for requests, whether to AI or to colleagues. A request with context and a definition of done gets better work from either.

**If you do the same tasks weekly,** write a sandwich once, save it in a document or as a skill, and update the top slice as your situation changes. Keep one copy of your best output as the example for the bottom.

**If you are starting out,** try it today on one real task. Run your usual prompt, then run the sandwich version, and compare the two results side by side.

## Can you build a tool that collects the context for you?

If you fill in the same top and bottom slices again and again, or need teammates to do it consistently, a small internal app can handle that better than a shared document. With [Remy](https://goremy.ai), you can describe in plain English a request form that asks for role, situation, task, and a sample of good output, stores each submission in a database, and lets people reuse past entries. Remy builds and deploys it as a full-stack app, so you own it rather than renting another subscription. The same idea works for a library of your team's best examples.

## Frequently Asked Questions

### Is prompt engineering dead?

Not exactly. Models now handle much of the trial-and-error wording themselves, so heavy iteration on phrasing matters less. Supplying accurate context and a clear definition of success still matters, and that is the part the context sandwich covers.

### How long should a context sandwich be?

Long enough to include what would change the answer, and no longer. Often that is a few sentences for each slice. Add a pasted example in the bottom slice when format matters.

### Do I need special software to use it?

No. It works in any chatbot because it is a way of writing, not a feature. Connectors and skills make it faster by supplying context automatically and saving your templates.

### What if I don't have an example of what good looks like?

Use a concrete goal instead: who will read it, what they should do afterward, a length, or a deadline. You can also ask the AI to propose two or three versions of success and pick the one closest to what you want.
