context-injection

context-injection is a skill for Claude Code, Codex from seb1n/awesome-ai-agent-skills. It costs 54 tokens per session (1,977 once invoked), scanned A, original, MIT.

A prompt- and agent-state technique for adding selected documents, examples, data, or tool results with clear source boundaries.

In plain words
What is it for?
It places retrieved context into prompts, chooses how to format it, and manages its size so the model can use it effectively.
Why use it?
It helps an AI use relevant information without confusing trusted context with instructions or unrelated text.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit It places retrieved context into prompts, chooses how to format it, and manages its size so the model can use it effectively.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/seb1n/awesome-ai-agent-skills/context-injection
Install

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.

Any agent
npx skills add seb1n/awesome-ai-agent-skills --skill context-injection
Clone the repo
git clone --depth 1 https://github.com/seb1n/awesome-ai-agent-skills

Made for: Claude Code, Codex.

Wrote 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.

agentmods badge for context-injection

README.md
[![agentmods](https://agentmods.dev/badge/skills/seb1n/awesome-ai-agent-skills/context-injection/github.svg)](https://agentmods.dev/skills/seb1n/awesome-ai-agent-skills/context-injection)
Your own site
<a href="https://agentmods.dev/skills/seb1n/awesome-ai-agent-skills/context-injection"><img src="https://agentmods.dev/badge/skills/seb1n/awesome-ai-agent-skills/context-injection/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for context-injection

Your own site · 80×15
<a href="https://agentmods.dev/skills/seb1n/awesome-ai-agent-skills/context-injection"><img src="https://agentmods.dev/badge/skills/seb1n/awesome-ai-agent-skills/context-injection.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 54 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,977 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00054 $0.01977
Opus 5 $0.00027 $0.00988
Sonnet 5 $0.00011 $0.00395
Haiku 4.5 $0.00005 $0.00198

Measured 11d ago against content hash d7e3746d8a1d, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

context-injection 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 11d 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.

Origin

Copies of this mod

1 near-identical copy found in the catalogue:

context-engineering/context-injection/SKILL.md · 137 lines

How it starts

The opening of the file, as written. The whole thing — 137 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Context Injection

Context injection is the practice of dynamically inserting relevant information — documents, data, examples, or tool outputs — into an AI prompt so the model has the knowledge it needs to produce accurate, grounded responses. Effective injection is about more than pasting text; it requires deliberate placement, formatting, and token budget allocation to maximize the model's ability to use the injected material.

Workflow

  1. Identify the Context Need: Analyze the task to determine what types of external information the model requires. A code review needs the source file; a support question needs product documentation; a personalized reply needs the user's profile. Clearly categorize each need as document grounding, few-shot examples, tool output, or metadata.

  2. Gather the Context: Retrieve the necessary information from its source — a database, file system, API response, vector store, or prior conversation. Apply any necessary compression or truncation before injection so the material fits within the allocated token budget.

  3. Select an Injection Strategy: Choose the appropriate injection method based on the context type and the model's attention patterns:

    • System prompt injection — persistent context like role definitions, rules, and user preferences go in the system message.
    • Document grounding — retrieved documents or files are inserted in the user message, typically before the question.
    • Few-shot examples — input/output pairs demonstrating the desired format are placed between the system prompt and the user query.
    • Tool output injection — results from function calls or API invocations are injected as assistant/tool messages in the conversation.
  4. Format and Delimit the Context: Wrap injected content in clear delimiters (XML tags, markdown headers, or triple-backtick fences) so the model can distinguish instructions from context from the user's query. Label each section explicitly (e.g., <retrieved_document>, <user_profile>, <code_file>).

Read the full file on GitHub · 137 lines

Changes

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.

  1. 11d ago First seen · 137 lines · 54 tokens per session scan A d7e3746d8a1d

Subscribe to this mod's changes

context-injection is a skill published in the GitHub repository seb1n/awesome-ai-agent-skills (179 stars, last pushed 1mo ago), licensed MIT. It adds 54 tokens to every session and 1,977 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-30.

Related

Other skills, from other repositories

cost-aware-llm-pipeline

A planning guide for choosing language models and managing the amount of conversation context used by an AI coding workflow. It groups tasks by complexity and gives rules for avoiding context overflow during long sessions.

hashgraph-online/awesome-codex-plugins · 42 tokens

prompt-lookup

Activates when the user asks about AI prompts, needs prompt templates, wants to search for prompts, or mentions prompts.chat. Use for discovering, retrieving, and improving prompts.

f/prompts.chat · 39 tokens

813-regulations-iso-42001

Use when reviewing, designing, or modifying Java enterprise systems that use GenAI, LLMs, AI-assisted coding, RAG, AI agents, generated code, generated dependencies, prompt workflows, external model providers, or AI-enabled business logic and need ISO/IEC 42001 AI management system-aware engineering guidance. Part of…

jabrena/plinth · 77 tokens

happyhorse-prompt-studio

Interactive prompt studio for HappyHorse 1.0 video generation. Guides users through scenario discovery with vivid examples, then assembles production-ready prompts in JP/CN/EN. Use when someone wants to create AI video content with HappyHorse but doesn't know where to start, or when they have a specific scenario and…

modelstudioai/skills · 93 tokens

strategy

Run structured brainstorming sessions (divergent/convergent), improve prompts with 7-dimension framework, and apply decision frameworks (RICE, weighted scoring, first principles, pre-mortem).

EliasOulkadi/shokunin · 42 tokens

analyze-video

Analyze a reference video and reverse-engineer its style into a reusable Seedance 2.0 prompting template for the Novoads API. The output is a new formula file — like seedance-2-ugc.md — that captures the video's structure, pacing, camera work, edit style and tone so it can be recreated with any product, any person, in…

novoads/agent-skills · 138 tokens