awesome-context-engineering

作者 yzfly已验证

A curated collection of resources, papers, tools, and best practices for Context Engineering in AI agents and Large Language Models (LLMs).

103
Stars
9
Forks
2026/8/24
添加时间

⚠️ 第三方软件声明

本 Skill 为第三方开源软件,独立托管于 GitHub。SkillTip 仅为信息目录,不控制或维护底层仓库。所显示的安全检查为自动化且范围有限,安装前请自行审查源码。

阅读服务条款

安装

添加到你的 Claude Code skills 目录:

# Add to your Claude Code skills
git clone https://github.com/yzfly/awesome-context-engineering

快速入门

使用 awesome-context-engineering 等 Skills 的指南。

安全报告

已验证

上次扫描:—

{
  "status": "PASSED",
  "issues": []
}

README.md

Awesome Context Engineering

Awesome GitHub stars GitHub forks

A curated collection of resources, papers, tools, and best practices for Context Engineering in AI agents and Large Language Models (LLMs).

Context engineering is the art and science of filling the context window with just the right information at each step of an agent's trajectory.

中文版本 | English

📚 Table of Contents

What is Context Engineering?

Context Engineering is the systematic optimization of information payloads for Large Language Models (LLMs). It encompasses:

  • Context Retrieval & Generation: Selecting and creating relevant information
  • Context Processing: Organizing and structuring context for optimal consumption
  • Context Management: Handling context windows, memory, and state across interactions
  • Context Compression: Reducing token usage while preserving essential information
  • Context Isolation: Separating concerns across different context spaces

📖 Featured Articles

Context Rot: How Increasing Input Tokens Impacts LLM Performance

Manus Context Engineering

Context Engineering for AI Agents: Lessons from Building Manus

Key insights from building a production AI agent:

  • Design around KV-Cache for performance optimization
  • Mask, don't remove tools for better action selection
  • Use file system as external context memory
  • Manipulate attention through recitation techniques

Claude Code Best Practices

Claude Code Best Practices

Anthropic / Claude

LangChain Context Engineering

Context Engineering for Agents

Comprehensive guide covering four key strategies:

  • Write Context: Saving information outside context window
  • Select Context: Pulling relevant information into context
  • Compress Context: Retaining only necessary tokens
  • Isolate Context: Splitting context across different spaces

dbreunig Context Engineering Series

How Long Contexts Fail and How to Fix Them

Deep dive into context failure modes and management strategies:

  • Context poisoning, distraction, confusion, and clash patterns
  • RAG, tool loadout, context quarantine, pruning, summarization, and offloading techniques

Advanced Context Engineering for Coding Agents

Guide for using AI to solve hard problems in complex codebases.

Don't Build Multi-Agents (Cognition)

Principles for building reliable agents: share full context and avoid fragile parallel multi-agent architectures.

The New Skill in AI is Not Prompting, It's Context Engineering (Philipp Schmid)

Argues most agent failures stem from poor context, not the model; breaks context into instructions, history, long-term memory, RAG, tools, and output format.

Context Engineering (Simon Willison)

Why "context engineering" is a better framing than "prompt engineering", curating the foundational discussion of the term.

Wide Research: Beyond the Context Window (Manus)

Parallel sub-agent architecture that avoids fabrication when processing many items, by decomposing tasks across dedicated sub-agents instead of one overloaded context window.

SWE-grep: RL for Fast Context Retrieval (Cognition)

RL-trained models that run up to 8 parallel searches per turn to retrieve code context an order of magnitude faster while minimizing context pollution.

📑 Research Papers

Survey Papers

A Survey of Context Engineering for Large Language Models

  • 📄 arXiv: 2507.13334
  • 📊 Comprehensive analysis of 1400+ research papers
  • 🎯 Establishes formal taxonomy of context engineering components

The performance of Large Language Models (LLMs) is fundamentally determined by the contextual information provided during inference. This survey introduces Context Engineering, a formal discipline that transcends simple prompt design to encompass the systematic optimization of information payloads for LLMs.

Harness Engineering for Language Agents: The Harness Layer as Control, Agency, and Runtime

  • 📄 Preprints: 202603.1756
  • 📊 Audits 63 harness-relevant works across academia and public engineering practice
  • 🎯 Decomposes the agent harness layer into Control, Agency, and Runtime (CAR); proposes HarnessCard as a reporting artifact

Situates harness engineering in the arc from software engineering through prompt and context engineering, arguing that the harness — the runtime loop wrapping tool execution, control, and agency around an LLM — is a first-class layer whose effects are often mistaken for model-driven gains.

Context Engineering 2.0: The Context of Context Engineering

  • 📄 arXiv: 2510.26493
  • 🎯 Traces context engineering back two decades and proposes a systematic definition and design principles across the human-computer to human-agent evolution

Agentic Context Engineering: Evolving Contexts for Self-Improving Language Models

  • 📄 arXiv: 2510.04618
  • 🎯 Treats context as an evolving playbook (Generator/Reflector/Curator) to prevent context collapse; reports +10.6% on agents and +8.6% on finance tasks (ICLR 2026)

Memory in the Age of AI Agents: A Survey

  • 📄 arXiv: 2512.13564
  • 🎯 A "forms-functions-dynamics" taxonomy of agent memory, distinguishing it from RAG and context engineering

Core Research Areas

🛠️ Tools & Projects

Comprehensive Resources

  1. Prompt Engineering Guide

    • Comprehensive guide to prompt engineering, context engineering, RAG, and AI agents
    • Covers techniques, papers, tools, and best practices
    • Widely-used educational resource
  2. Awesome Context Engineering Survey

    • Comprehensive survey of context engineering techniques
    • Methodologies and applications overview
    • Academic research focus
  3. Context Engineering Intro

    • Practical guide for AI coding assistants
    • Claude Code centered approach
    • Hands-on implementation strategies
  4. Context-Engineering (davidkimai)

    • First-principles handbook for context engineering
    • From foundations to advanced techniques
  5. Context-Engineering (jasontang-ai)

    • Karpathy-inspired first-principles handbook
    • From prompt engineering toward context design, orchestration, and optimization
  6. The Context Course (HuggingFace)

    • HuggingFace course on context engineering for code agents
    • Covers skills, MCP, plugins, subagents, hooks, and building your own agent
    • Reference agents: Claude Code, Codex, OpenCode
  7. Agent Systems Handbook

    • Practical AI agents handbook covering agentic workflows and multi-agent architecture
    • Spans LangGraph, MCP/A2A, context engineering, agent memory, evaluation, and observability

Context Engineering Systems & Kits

  • Prompt Engineering Guide ⭐76.1k: Comprehensive guide and resources for prompt engineering, context engineering, RAG, and AI agents
  • get-shit-done (GSD) ⭐64.5k: Meta-prompting, context engineering and spec-driven development system for Claude Code
  • Agent Skills for Context Engineering ⭐16.7k: Collection of Agent Skills for context engineering and multi-agent architectures
  • Context Engineering Intro ⭐13.5k: Context engineering introduction and methodology for AI coding assistants
  • Context-Engineering (jasontang-ai) ⭐9.1k: Karpathy-inspired first-principles handbook for context engineering
  • GSD-2 ⭐7.7k: Meta-prompting / context engineering system enabling long-running autonomous agent work
  • MineContext ⭐5.4k: Volcengine's proactive, context-aware AI companion
  • Awesome-Context-Engineering (Meirtz) ⭐3.2k: Comprehensive survey of context engineering
  • how-claude-code-works ⭐2.7k: Deep dive into Claude Code source: architecture, agent loop, and context engineering
  • pro-workflow ⭐2.3k: Self-correcting memory Claude Code workflow, including context engineering
  • Advanced Context Engineering for Coding Agents ⭐1.7k: Advanced context engineering techniques for coding agents
  • Context Engineering Kit ⭐1.2k: A context engineering skills toolkit
  • ACE (Agentic Context Engineering) ⭐1.2k: Evolving language agents through agentic context engineering (ACE)
  • context-space ⭐812: Context engineering infrastructure built from MCPs and integrations
  • Practical Guide to Context Engineering ⭐708: A practical, hands-on guide (in Chinese) to context engineering for LLM applications
  • get-shit-done (GSD): Meta-prompting and spec-driven development / context engineering system for Claude Code
  • GSD-2: Meta-prompting / context engineering system enabling long-running autonomous agent work
  • how-claude-code-works: Deep dive into Claude Code source: architecture, agent loop, and context engineering
  • Agent Skills for Context Engineering: Collection of Agent Skills for context engineering and multi-agent architectures
  • Advanced Context Engineering for Coding Agents: Advanced context engineering techniques for coding agents
  • ax: Local telemetry and recall graph for AI coding-agent sessions, costs, skills, routing, and hooks
  • ACE (Agentic Context Engineering): Evolving language agents through agentic context engineering
  • Context Engineering Kit: A toolkit for context engineering
  • MineContext: Volcengine's proactive, context-aware AI companion
  • pro-workflow: Self-correcting memory system that lets Claude Code learn from its mistakes, covering context engineering, parallel worktrees, agent teams, and 17 skills
  • kit: Context engineering toolkit for AI dev tools, providing codebase mapping, symbol extraction, and code search
  • RepoPrompt CE: Community edition of RepoPrompt, a native macOS context engineering app for AI coding agents, with an MCP CLI
  • context-engineering (outcomeops): Working reference implementation of context engineering with five components (corpus, retrieval, injection, output, enforcement), running end-to-end on Amazon Bedrock
  • Project Context Records (PCR): A context-engineering methodology that keeps a durable, repo-versioned archive of a project's meta-context (the why, architecture, and maintainer decisions) so AI collaborators inherit its judgment instead of re-deriving it
  • interview-prep-template: A three-layer context-engineering template (immutable sources → agent-maintained wiki → operating-manual file) where the agent synthesizes raw material into reusable answers, frameworks, and scored debriefs that compound over time
  • Practical Guide to Context Engineering: A practical, hands-on guide (in Chinese) to context engineering for LLM applications
  • MFS: A context harness that unifies code, docs, chat, databases, and object stores into one file-like, searchable namespace (ls/cat/grep + hybrid semantic search), so agents pull context incrementally instead of injecting it all up front; self-hosted and local-first (local ONNX embeddings + Milvus, no API key)

Development Frameworks

  • LangGraph: Low-level orchestration framework for context management
  • LangSmith: Agent tracing and evaluation platform
  • LangMem: Memory management abstractions

Memory & Compression

  • claude-mem: Persistent cross-session memory for Claude Code that automatically captures, compresses, and re-injects context across sessions
  • LeanCTX (lean-ctx): Context intelligence layer for AI agents — a single local Rust binary that decides what agents read, remember, and save; 60–90% fewer tokens, with 76 MCP tools and local-first design
  • headroom: Compresses tool outputs/logs before they reach the LLM, saving 60-95% of tokens
  • Accordion: A pi extension that renders an agent's entire context window as a live "map" and folds (reversibly compacts) less-relevant blocks in the background via pluggable "conductors" that rank block relevance, instead of lossy all-or-nothing compaction
  • Letta (MemGPT): Framework for building stateful agents with long-term memory
  • Mem0: Memory layer for AI agents and assistants
  • Vestige: "Local-first MCP memory server (single ~23MB Rust binary, data stays on-device) with entity/causal retrieval — links memories by shared file/env-var/service/symbol to recall the earlier change behind a later failure that similarity search can miss"
  • LLMLingua: Prompt compression for accelerated and cost-efficient LLM inference
  • Cognee: Open-source AI memory platform giving agents persistent long-term memory via a self-hosted knowledge-graph engine
  • Graphiti: Framework for building real-time, temporal knowledge graphs for AI agents (the engine behind Zep's memory)
  • Supermemory: Fast, scalable memory + context engine with a single Memory API; supports fully local runs

Production Tools

  • Claude Code: Auto-compact context management
  • ChatGPT: Long-term cross-session memory
  • Cursor: Rules-based context engineering
  • Windsurf: Advanced code context retrieval

💡 Expert Insights

Industry Leaders

Andrej Karpathy (OpenAI)

+1 for "context engineering" over "prompt engineering".

People associate prompts with short task descriptions you'd give an LLM in your day-to-day use. When in every industrial-strength LLM app, context engineering is the delicate art and science of filling the context window with just the right information for the next step. Science because doing this right involves task descriptions and explanations, few shot examples, RAG, related (possibly multimodal) data, tools, state and history, compacting... Too little or of the wrong form and the LLM doesn't have the right context for optimal performance. Too much or too irrelevant and the LLM costs might go up and performance might come down. Doing this well is highly non-trivial. And art because of the guiding intuition around LLM psychology of people spirits.

On top of context engineering itself, an LLM app has to:
- break up problems just right into control flows
- pack the context windows just right
- dispatch calls to LLMs of the right kind and capability
- handle generation-verification UIUX flows
- a lot more - guardrails, security, evals, parallelism, prefetching, ...

So context engineering is just one small piece of an emerging thick layer of non-trivial software that coordinates individual LLM calls (and a lot more) into full LLM apps. The term "ChatGPT wrapper" is tired and really, really wrong.

Key Principles

  1. KV-Cache Optimization: Design for cache hit rates to reduce latency and cost
  2. Append-Only Context: Avoid modifying previous context to maintain cache validity
  3. External Memory: Use file systems and databases as extended context storage
  4. Error Preservation: Keep failure traces for model learning and adaptation
  5. Diversity Over Uniformity: Avoid repetitive patterns that lead to model drift

🔗 Model Context Protocol (MCP)

Context7 MCP Server

Up-to-date code documentation for LLMs and AI code editors

  • 🔗 Repository: upstash/context7
  • 🎯 Real-time code context for development workflows
  • 🚀 Integration with popular AI coding assistants

MCP Ecosystem

🤝 Contributing

We welcome contributions! Please see our Contributing Guidelines for details.

How to Contribute

  1. Add Resources: Submit papers, tools, or articles related to context engineering
  2. Improve Translations: Help translate content to different languages
  3. Share Insights: Contribute expert opinions and best practices
  4. Report Issues: Help us maintain accuracy and relevance

Contribution Categories

  • 📄 Research Papers
  • 🛠️ Tools & Libraries
  • 📖 Articles & Tutorials
  • 💡 Expert Insights
  • 🔧 Implementation Examples
  • 🌐 Translations

⭐ Star History

Star History Chart

📄 License

This project is licensed under the CC0 1.0.

🙏 Acknowledgments

Special thanks to all contributors and the research community advancing the field of context engineering.


Maintained by: yzfly | 云中江树(微信公众号: 云中江树)

If you find this repository helpful, please consider giving it a ⭐!

常见问题

What is awesome-context-engineering?

awesome-context-engineering is an open-source ai agents skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by yzfly. A curated collection of resources, papers, tools, and best practices for Context Engineering in AI agents and Large Language Models (LLMs). It has 103 GitHub stars.

Is awesome-context-engineering safe to use?

Yes. awesome-context-engineering passed SkillsLLM's automated security scan — a dependency vulnerability audit plus prompt-injection heuristics — with no high-severity issues. You can read the full report in the Security Report section on this page.

How do I install awesome-context-engineering?

Clone the repository with "git clone https://github.com/yzfly/awesome-context-engineering" and add it to your Claude Code skills directory (see the Installation section above).

Are there alternatives to awesome-context-engineering?

Yes. SkillsLLM lists many other AI Agents skills you can browse and compare side by side. Open the AI Agents category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh awesome-context-engineering against similar tools.

评论 (0)

暂无评论,成为第一个分享想法的人!

ECC

by affaan-m

10

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

242,21936,702JavaScript
AI 智能体ai-agentsanthropicclaude-code
查看详情
15

An agentic skills framework & software development methodology that works.

234,96620,863Shell
AI 智能体ai-agentsbrainstorming
查看详情

hermes-agent

by NousResearch

10

The agent that grows with you

234,43747,175Python
AI 智能体ai-agentsagent-orchestration
查看详情

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

185,94028,768JavaScript
AI 智能体ai-agentsanthropicclaude-code
查看详情

cc-switch

by farion1231

3

A cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Grok Build & Hermes Agent. Only official website: ccswitch.io

128,8688,826Rust
AI 智能体claude-codeai-tools
查看详情

claude-code

by anthropics

Claude Code is an agentic coding tool that lives in your terminal, understands your codebase, and helps you code faster by executing routine tasks, explaining complex code, and handling git workflows - all through natural language commands.

120,03119,897Shell
AI 智能体
查看详情

开发者还喜欢

基于喜欢此 Skill 的开发者投票和收藏

ECC

by affaan-m

10

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

242,21936,702JavaScript
AI 智能体ai-agentsanthropicclaude-code
查看详情
15

An agentic skills framework & software development methodology that works.

234,96620,863Shell
AI 智能体ai-agentsbrainstorming
查看详情

hermes-agent

by NousResearch

10

The agent that grows with you

234,43747,175Python
AI 智能体ai-agentsagent-orchestration
查看详情

n8n

by n8n-io

12

Fair-code workflow automation platform with native AI capabilities. Combine visual building with custom code, self-host or cloud, 400+ integrations.

201,88160,308TypeScript
MCP 服务器apisai-tools
查看详情

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

185,94028,768JavaScript
AI 智能体ai-agentsanthropicclaude-code
查看详情

cc-switch

by farion1231

3

A cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Grok Build & Hermes Agent. Only official website: ccswitch.io

128,8688,826Rust
AI 智能体claude-codeai-tools
查看详情