Context recipes
Frazer Context works with the models you already use. The rules that decide what binds, receipts, conflicts, references and the computed parts of a compaction use no model at all; for the parts that do, each recipe below shows how to bring your own. Values in angle brackets are placeholders; take them from your project.
Use the session context with your own model
Section titled “Use the session context with your own model”For an agent you built yourself, on any model:
- Fetch the session context with
get_session_context(MCP) or the API, as JSON or as Markdown. From a shell,fir context --session <session> --part 1prints part 1. - Put part 1 (In force, the task, conflicts, unknowns, the checklist) first in your system prompt, and keep the checklist at the very end of the input, because models use the start and the end of their input best.
- Put part 2 (the sources) after it, and fetch handles only when the task needs them.
- Re-send part 1 after every compaction, and acknowledge material notices with
ack_contextbefore your agent pushes its next layer.
Check it. fir context --session <session> --part 1 --explain shows what was sent and why. If your model traffic goes through the LLM gateway, the session shows how many model calls carried In force.
Keep what binds through your provider’s compaction
Section titled “Keep what binds through your provider’s compaction”Every provider’s compaction summarizes instructions along with the rest of the history, so what binds must come back after it:
| Your agent runs on | Do this |
|---|---|
| The Anthropic API | Compact on demand with Frazer’s compaction instructions, then send In force as a system message after the next user turn |
| The OpenAI Responses API | Compact as the API does, then re-send In force as the first input item of the next request |
| Google’s Agent Development Kit | Use Frazer’s summarizer prompt, and re-send In force after each compaction event |
| Claude Code, Codex, Gemini CLI, Copilot | Install the Frazer plugin: it re-sends In force at the harness’s own door after compaction |
| Your editor’s agent, or any MCP client | Connect mcp.frazer.ai: its instructions tell the agent to call get_session_context again after each compaction |
Check it. Force three compactions in a test session and ask the agent for the plan’s scope and a must decision; both must come back exactly. Where traffic goes through the gateway, a compaction that dropped In force is recorded as gateway.in_force.missing.
Rank with your own reranker
Section titled “Rank with your own reranker”-
Create a
rerankroute on the LLM gateway that points at your reranker, a model endpoint of kindrerankor a provider key:rerank.yaml name: rerankdataPolicy: org-onlysteps:- provider: <provider>model: <your reranker>Terminal window frazer llm routes apply -f rerank.yaml --dry-run -
Keep the candidate header on. Rules still run first, so supersession, permissions and In force never depend on your model; your reranker orders what the rules allow.
Check it. context_rank with explain shows which ranker scored each candidate, and every receipt names the ranker. With no rerank route, ranking uses rules and features only.
Verify with your own models
Section titled “Verify with your own models”Add your routes to your organization’s panel as members of their families. A member is a family and a tier; the gateway resolves it through your route:
# .fir/panels/<your-panel>.yaml (excerpt)members: - {id: ours, family: <family>, route: <your route>, tiers: [balanced]}Families are counted by the lineage of their base weights, so a fine-tune of an open model counts as its base’s family. A project whose data must stay inside the organization verifies with open models on its own Frazer endpoints only. Or call verify from your own reviewer through context_verify and the API, and write findings back in the same shape (SARIF 2.1.0).
Check it. The context’s verify report lists each member, its family, what it read, the cost and the time.
Run your own compaction
Section titled “Run your own compaction”- Call
context_compactfor the session. It returns the computed parts (In force re-derived from Fir, the person’s words, decisions, assertions, files changed, commands and failures, steps) and handles for tool outputs and reads. - Write the exploration narrative with your own model, citing the session’s event IDs.
- Send it back: Fir resolves every citation and runs the grounding check, removes an unsupported statement and lists it as a finding.
Check it. The compaction’s report shows the citations that resolved and any finding; a narrative whose citations do not resolve is replaced by handles.
Prove what your agent knew
Section titled “Prove what your agent knew”- Export the session’s receipts with
frazer context export. Each receipt is an in-toto statement: the records, versions and anchors the session was given, the parts and how each was delivered, the notices and acknowledgments, the In force digest, the verify report, the ranker and the policy. - Verify them with any in-toto tool, without Frazer. Receipts are chained, so a missing one shows.
- Match a merged commit to what its session knew: the pull request’s intent carries the receipt’s digest.
Related
Section titled “Related”- Frazer Context: ranking, compaction, verify and receipts
- Agents and plans: the session context and In force
- LLM gateway: routes and data policies