Search⌘ K
AI Features

System Prompt Altitude and On-Demand Skill Loading

Learn how to replace brittle, case-by-case rules and vague guidance with system prompts written at the right altitude. You’ll structure instructions with labeled sections, load specialized skills only when needed, measure token savings, and detect overlapping triggers that create conflicting behavior.

We'll cover the following...

In Chapter 2, we learned to diagnose a context that had already gone wrong. In this chapter, we’ll start designing the context well from the beginning. The first piece is the system prompt.

Our on-call assistant still uses the short system prompt from Chapter 1. It says to answer from the retrieved notes and cite each step. That was enough while every question was “What should we roll back?” Now the team wants more. They want the assistant to compare runbooks and incidents side by side, and to decline questions that belong to other teams, such as customer refunds.

The easy way to get there is to add a new rule for every new case. In this lesson, we’ll see why that breaks, why the opposite approach also breaks, and how to write a prompt at the right level, which Anthropic calls the right altitude. Then we’ll load rarely needed instructions only when a question calls for them.

Rules for every case

Here’s what the rule-per-case approach looks like. Each line in the prompt handles one kind of question, triggered by specific words. Let’s write it, along with a question nobody wrote a rule for.

brittle_prompt.py · Python 3.14.0
from note_store import NOTE_STORE, tokenize
BRITTLE_PROMPT = """You are the on-call assistant.
If the question mentions "latency", answer from the latency runbook and cite it.
If the question mentions "deploy" or "rollback", answer from the deploy log and cite it.
If the question mentions "refund", say that the payments team handles refunds.
Otherwise, answer the question."""
BRANCH_WORDS = {"latency", "deploy", "rollback", "refund"}
COMPARE_NOTES = [NOTE_STORE[0], NOTE_STORE[3]] # note-1 (May 2026) and note-4 (2024)
COMPARE_QUERY = "How does the old checkout runbook stack up against the new one?"
if __name__ == "__main__":
print("notes:", [note["doc_id"] for note in COMPARE_NOTES])
print("branch words in the query:", sorted(tokenize(COMPARE_QUERY) & BRANCH_WORDS) or "none")

In the code above:

  • Lines 3–7: We write BRITTLE_PROMPT. Each line is a branch for one trigger word, plus a catch-all “Otherwise” line at the end.

  • Line 9: We list the words the branches depend on in BRANCH_WORDS.

  • Lines 10–11: We pick two notes to compare, note-1 and note-4, and write a comparison question in everyday words.

  • Lines 13–15: We check which branch words appear in the question.

None of the branches fire:

notes: ['note-1', 'note-4']
branch words in the query: none
The question matches no branch, so it falls through to “Otherwise”

The question is about two checkout runbooks, but it says “stack up against” and never mentions latency or deploys. So it falls through to “Otherwise, answer the question.” That line says nothing about citing notes, so the model has no instruction to cite. The branches were fine for the cases they planned for. They just can’t cover a phrasing that nobody wrote down.

A short, vague prompt

The tempting fix is to go the other way. We remove all the branches and write one short, general line: “Use good judgment and cite ...