---
title: "Why packing context matters"
lesson_id: "01"
---

# Why packing context matters

- **Lesson ID:** 01
- **Goal:** Show that unused memory, search hits, and tools waste the on-device window.
- **Human lesson:** [01-why-packing-matters.html](01-why-packing-matters.html)

## Prerequisites

- A basic idea of a context window.
- iOS 27 or macOS 27 as the target.

## Inputs, outputs, and artifacts

- **Inputs:** A question plus a pile of notes, hits, and tools.
- **Outputs:** A rule that only slices that change the answer get a seat.

## Agent build steps

1. Name `contextSize` on `SystemLanguageModel` and the larger PCC window.
2. Contrast an unpacked dump with a ranked pack.
3. Say packing is a budget, not prompt style.
4. Point to Dynamic Profiles as the place the pack becomes visible.
5. Cite [WWDC26 242](https://developer.apple.com/videos/play/wwdc2026/242/) for context engineering, lightly.

## Constraints

No LangChain. No em dashes. Progressive HTML flows only.

## Key concepts

- On-device windows are small. `SystemLanguageModel.contextSize` is a hard limit.
- Private Cloud Compute is larger but still finite.
- Packing is a ranked fill of a budget, not prompt poetry.
- If a slice does not change the answer, it does not earn a seat.

## Takeaways

- Extra memory, search hits, and tools crowd out the question.
- Keep the user question, short instructions, matching memories, matching hits, and allowed tools only.
- Dynamic Profiles declare the pack. Your assembler picks the contents.

## Acceptance checks

- Overflow versus pack is shown.
- One active Profile is previewed.
- Agent brief link is present.
