Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add skills/moberghr/mtk-agent-toolkit/context-engineeringnpx skills add moberghr/mtk-agent-toolkit --skill context-engineeringgit clone --depth 1 https://github.com/moberghr/mtk-agent-toolkitWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/moberghr/mtk-agent-toolkit/context-engineering)<a href="https://agentmods.dev/skills/moberghr/mtk-agent-toolkit/context-engineering"><img src="https://agentmods.dev/badge/skills/moberghr/mtk-agent-toolkit/context-engineering.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00032 | $0.03424 |
| Opus 5 | $0.00016 | $0.01712 |
| Sonnet 5 | $0.00006 | $0.00685 |
| Haiku 4.5 | $0.00003 | $0.00342 |
Grade B, and why
context-engineering scanned grade B with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Reads agent configuration directoriesmediumAgent snooping
.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.
if [ -f "$_rts" ]; then bash "$_rts" --explain "$PWD" 2>&1; echo; else cat .claude/tech-stack 2>/dev/null || echo "(not set)"; fi How it starts
The opening of the file, as written. The whole thing — 246 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Context Engineering
Active Stack
echo "--- Tech Stack ---"
_rts="${CLAUDE_PLUGIN_ROOT:-.}/scripts/resolve-tech-stack.sh"; [ -f "$_rts" ] || _rts="scripts/resolve-tech-stack.sh"
if [ -f "$_rts" ]; then bash "$_rts" --explain "$PWD" 2>&1; echo; else cat .claude/tech-stack 2>/dev/null || echo "(not set)"; fi
if [ -f .claude/tech-stack-pm ]; then echo "--- Package Manager ---"; cat .claude/tech-stack-pm; fi
Overview
Good output depends on good context. Context is the complete information payload the model sees at generation time — load the minimum relevant part needed to act correctly, then refresh it when the task shifts.
Context Operations (Write / Select / Compress / Isolate)
The four moves of context engineering. MTK already implements each; the names give them a shared vocabulary (borrow: LangChain / jihoo-kim context-engineering taxonomy).
| Operation | What it means | Where MTK does it |
|---|---|---|
| Write | Persist state outside the window so it survives compaction/handoff | auto-memory + tasks/lessons.md, workflow-artifacts, handoff |
| Select | Pull in only what the current step needs | rules INDEX.md wake-up layer, path-scoped applyTo reference loading (below) |
| Compress | Shrink what must stay in-window without losing signal | .claude/references/output-compression.md, mtk-compress.sh |
| Isolate | Give a sub-task its own fresh window | subagent-implementation (one implementer per batch), review agents (context: fork) |
When To Use
- Starting a new session
- Switching from planning to implementation or implementation to review
- Entering an unfamiliar area of the codebase
- When the model starts making assumptions or drifting from project norms
When NOT To Use
- As an excuse to endlessly read without acting
Workflow
- Start with
CLAUDE.mdwhen present. - Load only the shared references relevant to the task.
- Path-scoped auto-load. Reference entries in
.claude/manifest.jsonmay declare anapplyToglob array. When the current task has a known set of files in scope (from the spec'schange_manifestor fromgit diff --name-only HEAD):- MCP-first: If
mtk_resolve_referencestool is available, call it with the list of touched files. It returns deterministic glob matches against the manifest'sapplyToarrays. Use its output directly. - Fallback: If the MCP tool is unavailable, manually test each
touched file against the globs (bash
case/fnmatchsemantics). - Load references whose globs match at least one touched file.
- Skip references whose globs match nothing — they're not relevant to this task.
- References without
applyToare always-on when needed (e.g. coding-guidelines, framework-patterns); load on demand per phase.
- MCP-first: If
- Read the exact file to be changed and 2-3 neighboring files that establish local patterns.
- Separate trusted local standards from untrusted external inputs.
- Before a new phase, summarize what matters now:
- current goal
- files in scope
- governing rules
- open risks
- which
applyToreferences activated and why
- Refresh context when the scope or failure mode changes. If new files enter scope, re-run the path-scoped match and load any newly-applicable references.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 3d ago First seen · 246 lines · 32 tokens per session scan B 71201fced1ec
context-engineering is a skill published in the GitHub repository moberghr/mtk-agent-toolkit (7 stars, last pushed 9d ago), licensed MIT. It adds 32 tokens to every session and 3,424 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it B with 1 finding (reads agent configuration directories). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other skills, from other repositories
systematic-debugging
Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.
brainstorming
You MUST use this before any creative work - creating features, building components, adding functionality, or modifying behavior. Explores user intent, requirements and design before implementation.
auto-perf-optimize
Run agent-driven VS Code performance or memory investigations. Use when asked to launch Code OSS, automate a VS Code scenario, run the Chat memory smoke runner, capture renderer heap snapshots, take workflow screenshots, compare run summaries, or drive a repeatable scenario before heap-snapshot analysis.
chat-perf
Run chat perf benchmarks and memory leak checks against the local dev build or any published VS Code version. Use when investigating chat rendering regressions, validating perf-sensitive changes to chat UI, or checking for memory leaks in the chat response pipeline.
chat-pet-sprite-creation
Use when creating or changing VS Code chat pet sprite art, sprite sheets, state animations, eye treatments, Stable/Insiders variants, or pet transitions under src/vs/workbench/contrib/chat/browser/widget/media/chatPet.
cpu-profile-analysis
Analyze V8/Chrome CPU profiles (.cpuprofile) and DevTools trace files (Trace-.json). Use when: profiling performance, investigating slow functions, comparing code paths, finding bottlenecks, analyzing timeToRequest, understanding call trees from sampling profiler data, analyzing layout/paint/rendering, investigating…