Context engineering

From aturzone/Skull · View interactive version

Context engineering is an AI agent skill from the GitHub repository aturzone/Skull. Curate the model's context window for the most signal per token — stop burning tokens on bloat. Triggers on "context engineering", "burning tokens", "context window full", "reduce token usage", "the model lost the thread", "too much in context", "prompt caching", "session handoff", or any long / exp

How to use this skill

Skill file

Context engineering — the window is a budget, spend it well

Every token in the context window costs money, latency, and attention (more noise = worse answers). Context

engineering is deciding, deliberately, what earns a place in the window — and routing the rest elsewhere.

The disciplines

  1. Keep instructions small and prefix-stable. A lean CLAUDE.md / system prompt beats a kitchen sink.

Prompt caching rewards a stable prefix: put the unchanging stuff first and don't reorder it — a change

near the top invalidates the cache for everything after it. (Pairs with workspace-architect.)

  1. Retrieve, don't dump. Pull the few relevant files / snippets; never paste a whole repo or doc. Use a

ranked map (repo-map) or a code graph (CodeGraph) to find the load-bearing few. (Pairs with repo-map.)

  1. Fresh docs at query time, not pasted. Stale pasted docs cause hallucinated APIs; fetch version-correct

docs on demand with a docs MCP (Context7) instead.

  1. Compress tool output before it lands. Logs, git status, test output, find — pipe them through a

compressor (RTK) or summarize before feeding them in; raw command spew is the quiet token killer.

  1. Audit your MCP servers. Every connected MCP injects its tool definitions into every request. Keep only

the ones this project uses — each unused server is a permanent context tax.

  1. Stop documentation inflation. Instruction files grow unbounded if you let them. Trim ruthlessly; link to

detail instead of inlining it; one fact in one place.

  1. Hand off cleanly across sessions. For long work, take a clean break with a short handoff note so the next

session restarts from a compact summary, not a giant transcript. (Pairs with compactor.)

  1. Measure tokens like an infra cost. Right-size the model per task (model-router — Haiku scouts, Opus

for the hard calls), trim output (caveman / token-economy), and watch usage (Tokscale) instead of

guessing. What you don't measure, you overspend.

The quick audit

Run it when a session feels expensive or the model is losing the thread:

Where SKULL already helps

token-economy (best output per token), repo-map (ranked retrieval), compactor (session handoffs),

model-router (right model per task), workspace-architect (a lean .claude/). The external power-ups —

Context7, CodeGraph, RTK, Tokscale, caveman — are in docs/ECOSYSTEM.md.


*Credits: the "15 ways to stop burning tokens" context-engineering playbook (devwithmj on Medium). We

re-implement the ideas and point you at the tools. See docs/ECOSYSTEM.md.*

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.