The Augmented Engineer

The Augmented Engineer

Share this post

The Augmented Engineer
The Augmented Engineer
Making LLM context actually work for you

Making LLM context actually work for you

What you feed your AI tools matters - here's how AI uses context

Jun 20, 2025
∙ Paid
2

Share this post

The Augmented Engineer
The Augmented Engineer
Making LLM context actually work for you
Share

Understanding how “context” works in large language models (LLMs) will have a massive impact on what you get out of AI tools.

Coding assistants like Cursor are built to manage context behind the scenes so you can concentrate on coding. This is the reason they’re so much more useful than just using a chat tool like ChatGPT.

Mastering context means getting way better code suggestions with less guesswork. In today’s deep dive, I’ll get into:

  • Understanding context in LLMs

  • Token limits and context windows

  • How LLMs use context you provide

  • How tools like Cursor inject context on your behalf

  • Managing and reducing irrelevant context

Understanding context in LLMs

In the world of LLMs, context is what the model “sees” before producing a response. Think of it as the model’s working memory or even a scratch pad. Unlike a human programmer, an AI doesn’t truly remember past conversations unless you include them again; it only knows what you feed it right now (plus whatever it learned during training). In practical terms, context includes things like:

  • The conversation history (previous questions and answers).

  • Your current prompt or instructions (what you’re asking it to do).

  • Any code snippets, error messages, or file content you provide as reference.

LLMs process this input text in pieces called tokens, which are basically chunks of words or characters. They predict results token-by-token based on the patterns in the context. The context is the AI’s short-term memory (like RAM), separate from its long-term training data. Provide a clear and relevant context, and the model can give a focused, accurate answer. Provide a poor or vague context, and the model might get confused or start making things up.

Types of Context (Intent vs. State): It helps to know there are generally two kinds of info you give to an AI:

  • Intent context – Your instructions or goal. This is prescriptive. For example, telling the model what you want, like “Explain why this function is slow” or a system message like “You are an expert Python assistant.” This sets the high-level direction

  • State context – The current state of the world or problem. This is descriptive background info, like code files, stack traces, or configuration data you supply. It tells the model what exists right now (the code or error it should consider).

Omit the state (e.g. forget to show the code or error), and the AI may hallucinate a solution using generic knowledge. Omit the intent (don’t tell it clearly what you need), and it won’t know what to do with the information.

Token limits and context windows

This post is for paid subscribers

Already a paid subscriber? Sign in
Š 2025 Jeff Morhous
Privacy ∙ Terms ∙ Collection notice
Start writingGet the app
Substack is the home for great culture

Share