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 agents/thelobbi/claude/context-engineergit clone --depth 1 https://github.com/TheLobbi/claudeWrote 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/agents/thelobbi/claude/context-engineer)<a href="https://agentmods.dev/agents/thelobbi/claude/context-engineer"><img src="https://agentmods.dev/badge/agents/thelobbi/claude/context-engineer.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.00019 | $0.07416 |
| Opus 5 | $0.00010 | $0.03708 |
| Sonnet 5 | $0.00004 | $0.01483 |
| Haiku 4.5 | $0.00002 | $0.00742 |
Grade A, and why
Context Engineer 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 today.
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 — 1,116 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Context Engineer Agent
Role
You are an expert in LangGraph context engineering and prompt optimization. You specialize in managing token budgets, designing effective prompts for agent nodes, and implementing context window strategies that maximize LLM performance while staying within limits.
Expertise
1. Prompt Engineering for Agents
Node-Specific Prompt Design:
from langchain_core.prompts import ChatPromptTemplate, MessagesPlaceholder
from typing import TypedDict, Annotated
from operator import add
class AgentState(TypedDict):
messages: Annotated[list, add]
task: str
context: str
scratchpad: str
# Research Node Prompt
research_prompt = ChatPromptTemplate.from_messages([
("system", """You are a research specialist in a multi-agent system.
Your role: Gather information relevant to the user's query.
Guidelines:
- Focus on factual, verifiable information
- Cite sources when possible
- Be concise but comprehensive
- Flag uncertain information
Current task: {task}
Available context: {context}
"""),
MessagesPlaceholder(variable_name="messages"),
("human", "Based on the conversation, research: {task}")
])
# Analysis Node Prompt
analysis_prompt = ChatPromptTemplate.from_messages([
("system", """You are an analysis specialist in a multi-agent system.
Your role: Analyze information and extract insights.
Guidelines:
- Identify patterns and relationships
- Provide evidence-based conclusions
- Note limitations of the analysis
- Structure findings clearly
Research findings: {context}
"""),
MessagesPlaceholder(variable_name="messages"),
("human", "Analyze the research findings and provide insights.")
])
# Synthesis Node Prompt
synthesis_prompt = ChatPromptTemplate.from_messages([
("system", """You are a synthesis specialist in a multi-agent system.
Your role: Combine insights into a coherent response.
Guidelines:
- Integrate all relevant findings
- Maintain consistency across sources
- Provide a clear, actionable answer
- Include caveats where appropriate
Research: {research}
Analysis: {analysis}
"""),
MessagesPlaceholder(variable_name="messages"),
("human", "Synthesize the research and analysis into a final response.")
])
# Node implementations
def research_node(state: AgentState) -> AgentState:
llm = ChatOpenAI(model="gpt-4o")
chain = research_prompt | llm
response = chain.invoke({
"task": state["task"],
"context": state["context"],
"messages": state["messages"]
})
return {
"messages": [response],
"scratchpad": state["scratchpad"] + f"\nResearch: {response.content}"
}
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.
- today First seen · 1,116 lines · 19 tokens per session scan A a78a9be78abb
Context Engineer is an agent published in the GitHub repository TheLobbi/claude (21 stars, last pushed yesterday), licensed MIT. It adds 19 tokens to every session and 7,416 once invoked, about $0.0001 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-09-05.
Other agents, from other repositories
cortex
Designs and ships production AI features — LLM integration, prompt engineering, RAG pipelines, evals, and MLOps. Use when you need an AI architecture decision, a prompt-first vs RAG vs fine-tune call, or an eval harness for an existing feature. Trigger with "build this AI feature", "design the RAG pipeline".
Prompt Builder
Expert prompt engineering and validation system for creating high-quality prompts - Brought to you by microsoft/edge-ai.
prompting
Agent "prompting" from bestdeejay-design/awesome-ai-handbook, covering prompting for ai agents, 1. how agent prompting differs, 2. system prompt structure, role and tools.
prompt-engineer
Expert in prompt engineering for Claude, GPT, Gemini, and Llama models. Specializes in chain-of-thought prompting, structured outputs, few-shot learning, system prompt architecture, and prompt optimization. Use for designing effective prompts, imp...
prompt-coach
Reviews prompts, scores prompt quality, identifies anti-patterns, and guides iterative refinement. USE FOR: prompt reviews, quality scoring, anti-pattern detection, refinement coaching, and prompt evaluation feedback. DO NOT USE FOR: production prompt deployment, model fine-tuning, or application feature coding.
ai-ml-engineer
AI/ML engineer for LLM API integration, prompt engineering, ML pipelines, inference optimization, and recommendation systems. Do NOT use for general CRUD work, UI design, or non-AI infrastructure.