Long-Context Working Brief

Long-Context Working Brief

How to put a large codebase or document set in front of a long-context model without it losing the thread.

z-ai long-context research codebase analysis

What it is for

A large context window is not the same as attention across it. This is how to put a codebase or a document set in front of a long-context model — ordered, labelled, and with the question stated before the material — so it does not lose the thread halfway.

The skill

When handing a long-context model a large body of material, the failure is not
that it forgets — it is that everything looks equally important.

Structure the input as:
1. **The question, first and last.** Put it at the top, then repeat it verbatim
   after the material. Attention to the middle is the weak part; the question
   should not live there.
2. **A map before the material** — a numbered list of what you are including
   and why each piece is there. Ten lines. This is what the model uses to
   decide where to look.
3. **The material, each part labelled** with the same numbers as the map, in
   the order the map lists them.
4. **The output shape**, stated as a template with the fields you want.

Then:
- Ask for citations by label ("from [3]"), so an answer that drifts into
  invention is visible rather than plausible.
- If the answer must be exhaustive, ask for the count first ("how many places
  do X?") and then the list. A model that commits to a number before
  enumerating is far less likely to stop early.

How to install it

1. Open the tool and start a new conversation, project or template.
2. Paste the text below wherever the tool keeps standing instructions
   — usually called system prompt, instructions, or persona.
3. Save it so it applies to every run rather than a single message.

Did it work for you?

Where it came from

Skills app Original