liveBook · Manning

Context window

As explained in AI for Everyday IT

A context window is the amount of input and conversational or document context that a language model can process for one interaction.

A context window is the amount of conversation, code, or document content a language model can process at once. When the working context grows too large, responses may become less relevant, confused, or unreliable. section 3.1.3 section 2.1.1

Manage context deliberately when a task or conversation becomes large:

  • Restate important points or summarize long discussions to keep the interaction focused. section 3.1.3
  • Start a fresh conversation when answers become inconsistent, confused, or off-topic; a clean context can restore reliability. section 3.1.3
  • Break development work into small, discrete tasks instead of supplying unnecessary project history. section 11.9.1
  • Check generated work with tests, especially during refactoring, because an overloaded context can produce broken changes. section 11.9.1

A conversation that outgrows its context

Dave kept one ChatGPT conversation open for two months. As the history exceeded what the system could effectively process, it began making false claims about creating documents and promising future notifications. The practical response is to open a new chat, provide only the essential background, and verify the next answer. section 3.1.3

Context in coding work

A code assistant may behave normally at first, then generate broken suggestions, delete its own files, or drive up costs after extreme token counts. Ask for one focused change at a time, state what must remain unchanged, and use tests to detect regressions. section 11.9.1

Table 11.2 Sample tasks and their prompts
Task
Effective prompt
Refactoring large files
The keywordHandlers.js file is too large. Split it into multiple files. The code must work exactly the same way after splitting - don’t change any functionality.
Setting feature boundaries
Enable click-to-show-original only for Reddit and Bluesky posts. All other sites should have this feature disabled.
UI improvements
Make the footer sticky on desktop versions but let it scroll normally on mobile devices.
Performance feedback
Add in Write-Progress and Write-Verbose statements where appropriate to show operation status.
Documentation
Create PowerShell help for each file in the directory and include a synopsis.
Visual states
Disable badge count on disabled domains and gray out the icon.

Use the task-and-prompt table as a practical pattern for keeping requests narrow: specify one change and explicitly preserve existing behavior. section 11.9.1

How AI for Everyday IT covers it

How deep it goes
Explains capacity limits, token growth, failure symptoms, summaries, fresh chats, and focused tasks without detailing model internals.
Examples
Uses a two-month ChatGPT conversation, overloaded code assistants, focused coding prompts, and test-first refactoring.
What it assumes
Assumes basic familiarity with chatbot conversations and introduces tokens as the measure of processed input and output.
What you can do after
Operate chatbots and coding assistants more reliably by summarizing, restarting chats, narrowing tasks, and testing changes.
How it connects
Connects context windows with tokens, hallucinations, chatbots, coding assistants, and software testing.

Also explained in

Compare how 22 books explain context window →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of AI for Everyday IT. The section links point to the parts of the book it draws on.