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/topprismdata/cultivating-ml-agent/context-engineeringnpx skills add topprismdata/cultivating-ml-agent --skill context-engineeringgit clone --depth 1 https://github.com/topprismdata/cultivating-ml-agentWrote 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/topprismdata/cultivating-ml-agent/context-engineering)<a href="https://agentmods.dev/skills/topprismdata/cultivating-ml-agent/context-engineering"><img src="https://agentmods.dev/badge/skills/topprismdata/cultivating-ml-agent/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.1 | $0.00065 | $0.00847 |
| Opus 5 | $0.00032 | $0.00424 |
| Sonnet 5 | $0.00013 | $0.00169 |
| Haiku 4.5 | $0.00006 | $0.00085 |
Grade A, and why
context-engineering scanned grade A with 0 findings 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 6d 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.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 95 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Context Engineering
Context
Even with 1M-2M token context windows, stuffing everything degrades performance ("Lost in the Middle" — Liu et al. 2023). This skill encodes Anthropic's 2025 best practices: dynamic compression, intelligent log truncation, and priority-aware token budgeting.
The core insight: context is RAM, treat it like memory management, not a buffer.
Guidance
Three Tools
from framework.src.context_engineering import (
ContextCompressor, LogTruncator, TokenEconomy,
CompressionLevel, BudgetPriority,
)
# 1. Compress long text (LLM outputs, paper abstracts)
compressor = ContextCompressor()
result = compressor.compress(long_paper_abstract,
level=CompressionLevel.MEDIUM,
focus_query="time series forecasting")
# → AGGRESSIVE for very long, MEDIUM for 4K-20K, LIGHT for <4K
# 2. Truncate training logs (preserve errors + samples)
truncated = LogTruncator(max_lines=200).truncate(training_log)
# → 500 lines → 50 lines, all ERROR/WARN kept, METRIC sampled
# 3. Priority-aware token budget
econ = TokenEconomy()
econ.add_critical(system_prompt, "system")
econ.add_high(current_task, "task")
econ.add(relevant_skill_text, BudgetPriority.MEDIUM, "skills")
econ.add(optional_context, BudgetPriority.LOW, "context")
prompt = econ.assemble() # auto-drops LOW when over budget
Decision Workflow
Assembling a prompt?
↓
1. Are there training logs > 100 lines?
→ LogTruncator first (reduce noise 5-10x)
↓
2. Are there paper abstracts / long docs?
→ Compressor + MEDIUM (keep relevant 50%)
↓
3. Total still > 8000 chars?
→ TokenEconomy (prioritize, auto-drop LOW)
↓
4. Send to LLM
Why This Matters
| Without Context Engineering | With It |
|---|---|
| Lost in the Middle (model misses mid-prompt) | Key info always prioritized |
| 40% token waste on redundant/irrelevant content | 50-70% token savings |
| Inconsistent outputs from over-stuffed prompts | Stable, focused outputs |
| Can't fit new context when LLM call limit hit | Always room for one more thing |
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.
- 6d ago First seen · 95 lines · 65 tokens per session scan A a72eae05d42f
context-engineering is a skill published in the GitHub repository topprismdata/cultivating-ml-agent (4 stars, last pushed 8d ago), licensed MIT. It adds 65 tokens to every session and 847 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other skills, from other repositories
Context Doctor
Identify and repair degradation in system prompt, external memory, and skills preventing you from following instructions or remembering information as well as you should.
memanto-companion
Inspect and manage the cross-session engineering memory that Memanto maintains for your Claude Code skills. Use when the user asks what Memanto remembers, wants to see their engineering profile, manually recall context for a skill, or store a decision. The automatic lifecycle hooks handle capture/injection on their…
system-monitor
Monitor system health: CPU, memory, disk, processes, and network. Alert on thresholds via any channel.
mnemon
Persistent memory CLI for LLM agents. Store facts, recall past knowledge, link related memories, manage lifecycle.
prep
Session wrap-up. Update memories, check plans, review git state, check inbox, flag loose ends. Use before closing a session or compacting context.
prolong
Recover and use durable coding-session history from PRO-LONG's local append-only log. Use on long-running coding tasks, after context compaction or session resume, when reconstructing prior decisions or tool results, or before repeating work that may already have been attempted.