Meta Context Engineering via Agentic Skill Evolution — part 1/4
Cleaned-text code points [0, 15999). Bibliography omitted here; source.md includes it.
## 1 Introduction
The operational efficacy of large language models (LLMs) is governed by the curation and orchestration of their inference-time context [ Mei et al., 2025 ] . As LLM infrastructure evolves from monolithic chat interfaces toward compound agentic systems, context optimization has become both a critical bottleneck and a powerful lever for its enhancement. This establishes the discipline of Context Engineering (CE), which focuses on the principled LLM context optimization to maximize downstream utility and enable continuous self-improvement [ Hua et al., 2025 ] .
Recent advances demonstrate CE’s efficacy across diverse objectives, such as enhancing vertical-domain performance [ Zhang et al., 2026 , Cai et al., 2025b , Agrawal et al., 2025 ] , solving long-horizon tasks [ Zhang et al., 2025a , Sun et al., 2025 , Hu et al., 2025a , Kang et al., 2025 ] , coordinating multiple agents [ Yuksekgonul et al., 2025 , Wu et al., 2024a , Ma et al., 2026 ] , and self-evolution driven by experience [ Ye et al., 2024 , Lu et al., 2026 , Wei et al., 2025 , Gao et al., 2025 ] . Unlike optimizing LLM parameters, optimizing their context provides distinct methodological advantages: (1) interpretability , by encoding experience in natural language rather than opaque weights; (2) efficiency , by enabling rapid deployment without costly updates of model parameters; (3) modularity , facilitating the composition and transfer of established contexts; and (4) robustness , ensuring immunity to catastrophic forgetting by decoupling capability acquisition from model weights.
However, current CE systems are fundamentally constrained by manually crafted agentic harnesses that impose characteristic inductive biases. At the context representation level , different context structures impose their own trade-offs: case-based trajectories retain rich episodic traces but lack generalization [ Zhou et al., 2025 ] ; itemized lists accumulate abstract insights but remain flat and structurally inexpressive [ Zhang et al., 2026 ] ; and graph-based hierarchies offer flexible organization but incur high latency without consistently outperforming naive retrieval [ Xu et al., 2025a , Ai et al., 2025 ] . At the context optimization level , existing methods exhibit opposing yet equally limiting biases. On one hand, prompt-rewriting approaches such as GEPA [ Agrawal et al., 2025 ] favor brevity, iteratively refining concise, high-level rules that fail in tasks requiring detailed strategies and deep domain knowledge [ Zhang et al., 2026 ] . On the other hand, additive-curation approaches [ Zhang et al., 2026 , Cai et al., 2025b , Suzgun et al., 2025 , Cai et al., 2025a ] favor verbosity, accumulating context through generation-reflection-curation pipelines that produce noisy context update (due to limited global visibility), incur excessive overhead (due to instance-level optimization), and cause context bloat (due to additive accumulation without holistic synthesis). Ultimately, these heuristic choices restrict CE to a narrow design subspace, precluding the discovery of task-optimal strategies that lie beyond human intuition.
To address these limitations, we introduce Meta Context Engineering (MCE) , a framework that supersedes static heuristics through the co-evolution of CE skills and context artifacts . MCE formalizes CE as a bi-level optimization problem, effectively decoupling the engineering strategy (how to represent and optimize context) from the resulting engineered artifact (what context is learned). At the meta-level , we propose agentic skill evolution , in which an agent iteratively refines CE skills [ Anthropic, 2025 ] : executable instructions and code that govern the CE process. This evolution is driven by agentic crossover, an evolutionary operator that synthesizes superior skills by reasoning across task specifications, historical CE trajectories, and performance metrics. At the base-level , an agent executes these evolved skills to learn from training rollouts and constructs context, in a fully agentic manner. Unlike prior methods that predefine context schemas, our base-agent leverages coding toolkits and file system access to instantiate and optimize context as flexible, programmatic artifacts.
In this manner, MCE replaces heuristic scaffolding with a generic design space. Prior state-of-the-art (SOTA) methods, such as the generation-reflection-curation workflow of agentic context engineering (ACE) [ Zhang et al., 2026 ] , represent singular points within the vast manifold of possible CE skills. By granting AI the full agency and capabilities to generate arbitrary code, invoke other LLMs, and manipulate file structures, MCE can reconstruct such pipelines, discover novel CE architectures, and dynamically adjust CE strategies.
We evaluate MCE across five diverse domains (finance, chemistry, medicine, law, and AI safety), using four LLMs, and against SOTA CE methods. Under offline and online settings respectively, MCE achieves 89.1% and 74.1% average relative improvement over the DeepSeek-V3.1 base model, outperforming the prior SOTA by 18.4% and 33.0%. In addition, MCE demonstrates superior 1) context adaptability : flexibly adjusting context length from 1.5K to 86K tokens across tasks, free from the brevity or verbosity biases of prior methods; 2) context efficiency : achieving better performance with fewer context tokens; 3) context transferability : exhibiting 4–7% lower performance degradation when transferring contexts from strong to weak models; and 4) training efficiency : accelerating training by 13.6 × 13.6\times and requiring 4.8 × 4.8\times fewer rollouts than ACE to achieve higher training accuracy.
We summarize contributions as follows. ❶ We propose MCE, a bi-level framework that co-evolves CE skills and context artifacts, superseding static CE harnesses with learnable skills. ❷ At the meta-level, we introduce agentic skill evolution, leveraging agent skills [ Anthropic, 2025 ] as a novel abstraction for evolutionary agent optimization. ❸ At the base-level, we introduce fully agentic context optimization, leveraging coding toolkits and file system access to instantiate context as flexible, programmatic artifacts. ❹ We conduct comprehensive evaluations across five domains, four LLMs, and both offline and online settings. MCE achieves 5.6–53.8% relative improvement over state-of-the-art CE methods (mean of 16.9%), while demonstrating superior context adaptability, transferability, and efficiency in both context usage and training.
## 2 Background and Related Work
### 2.1 Agentic Context Engineering
While LLMs possess strong zero-shot capabilities, post-deployment context engineering (CE) is crucial for domain adaptation and self-improvement [ Khattab et al., 2023 , Hu et al., 2025b , Fang et al., 2025 , Shinn et al., 2023 , Yuksekgonul et al., 2025 ] . Current SOTA CE methods rely on manually designed agentic harnesses: models accumulate experience through exploration-reflection workflows to update contexts with predefined schemas.
However, these harnesses impose characteristic inductive biases. At the context representation level , the trade-offs are distinct: case-based trajectories retain rich episodic traces but lack generalization and abstraction [ Zhou et al., 2025 , Wang et al., 2024b ] ; itemized lists accumulate abstract insights but remain flat and structurally limited [ Zhang et al., 2026 , Suzgun et al., 2025 ] ; and hierarchical, graph-based memories incur high latency and complexity without consistently outperforming naive retrieval [ Chhikara et al., 2025 , Ai et al., 2025 , Li et al., 2025 , Xu et al., 2025a ] . At the context optimization level , existing methods exhibit opposing yet equally limiting biases. On one hand, prompt-rewriting approaches such as GEPA [ Agrawal et al., 2025 ] employ full LLM-based rewrites driven by reflections over sampled trajectories, favoring abstract, high-level rules over detailed domain knowledge (brevity bias). On the other hand, additive-curation approaches such as Dynamic Cheatsheet (DC) [ Suzgun et al., 2025 ] and Agentic Context Engineering (ACE) [ Zhang et al., 2026 ] orchestrate modular agents (generators, reflectors, and curators) to iteratively perform on-policy rollouts, textual reflections, and context updates. These methods utilize localized updates to itemized lists and can additively accumulate insights, but suffer from structural rigidity and context bloat [ Cai et al., 2025b , Cai et al., 2025a ] .
We posit that no single agentic harness is universally optimal, motivating MCE’s dual-level optimization. Our instantiation of MCE is driven by two converging trends. First, agent architectures are shifting from rigid, multi-agent scaffolds toward unified, self-looping, and self-spawning frameworks with maximal agency and minimal yet general tools [ Anthropic, 2025a , Manus, 2025 , langchain-ai, 2025 , Bolin, 2026 ] . In this architecture, domain specificity can be encapsulated in agent skills: organized instructions, scripts, and resources that agents discover and load dynamically [ Anthropic, 2025 ] . This motivates our meta-level design: CE as a fully agentic process without restrictive scaffolding, with task specificity injected through learned skills.
Second, coding toolkits and computer (file system) access have became the essential harness of both general and vertical agents [ Yang et al., 2025 , Anthropic, 2026 , Manus, 2025 , Cheng et al., 2026 ] . The prevalence stems largely from the versatility of Turing-complete programming languages, which offer maximal design flexibility [ Zhang et al., 2025c , Zhang et al., 2025d ] , and their inherent verifiability, which facilitates robust training [ Wei, 2025 , Wang et al., 2024a , Yang et al., 2024 ] . This insight informs our base-level design space: context artifacts consist of files and code, which are general, agent-native representations unconstrained by predefined schemas.
Ultimately, MCE represents a transition from manually crafted CE workflows to fully agentic meta- and self-learning systems, where domain specificity encapsulated with learned skills and context is managed via agent-generated files and code.
### 2.2 Evolutionary Computation with LLMs
Conventional evolutionary computation (EC) relies on manually designed operators, which struggle to capture complex solution structures and domain properties. Recent research demonstrates that LLMs can serve as intelligent genetic operators, leveraging semantic knowledge to generate meaningful variations without explicit rules [ Wu et al., 2024b ] .
This paradigm shift enables the exploration of unstructured search spaces and facilitates optimization across varying levels of abstraction [ Novikov et al., 2025 , Lange et al., 2025 ] . Prior work in LLM-driven EC has primarily targeted the solution level (e.g., prompts [ Guo et al., 2024 ] , textual solutions [ Lee et al., 2025 ] , numerical parameters [ Xu et al., 2025b ] ), function level (e.g., heuristics [ Romera-Paredes et al., 2024 , Ye et al., 2024 , Liu et al., 2024b ] , reward functions [ Ma et al., 2024 ] ), and program level (e.g., search algorithms [ Novikov et al., 2025 , Hottung et al., 2025 ] , neural architectures [ Liu et al., 2025 ] , agent workflows [ Zhang et al., 2025b ] ).
In this work, we introduce agent skills [ Anthropic, 2025 ] as a novel, integrated level of abstraction for evolutionary optimization. Agent skills are organized folders of instructions, scripts, and resources, that an agent can discover and utilize. We find that this abstraction offers three distinct advantages for meta-level agent optimization. First, by encapsulating instructions, resources, and scripts into a unified representation, skills enable the seamless co-evolution of different solution levels, overcoming the fragmented frameworks often seen in prior co-evolutionary approaches [ Zhao et al., 2025 , Cen and Tan, 2025 , Xie et al., 2025 , Guo et al., 2025 ] . Second, skills provide a modular interface for agentic harnesses, decoupling the optimization target from the core agent architecture to enhance stability. Third, this representation facilitates more agentic genetic operators: agents can flexibly inspect and selectively recombine components from ancestor skill directories, enabling more granular and context-aware evolutionary updates.
## 3 Meta Context Engineering
We formalize Meta Context Engineering (MCE) as a bi-level optimization framework that co-evolves context engineering skills and context artifacts ( § 3.1 ). At the meta-level, an agent refines skills that guide context representation and optimization ( § 3.2 ); at the base-level, an agent executes these skills to optimize context as files and code ( § 3.3 ). This dual-level optimization is orchestrated by a simple ( 1 + 1 ) (1+1) -Evolution Strategy (ES) and instantiated with general agents that have access to coding toolkits and file systems ( § 3.4 ). We present the methodological overview in Fig. 2 .
### 3.1 Problem Formulation
We define a context function c c that maps each query x ∈ 𝒳 x\in\mathcal{X} to its context, specified by a tuple ( ρ , F ) (\rho,F) : c ( x ) = ( F k ∘ ⋯ ∘ F 1 ) ( x ; ρ ) , c(x)=(F_{k}\circ\cdots\circ F_{1})(x;\rho), (1) where ρ = { ρ 1 , … , ρ m } \rho=\{\rho_{1},\ldots,\rho_{m}\} denotes static components (e.g., system prompts, knowledge bases, code libraries) and F = { F 1 , … , F k } F=\{F_{1},\ldots,F_{k}\} denotes dynamic operators (e.g., retrieval, selection, filtering, formatting, composition) that transform and assemble these components conditioned on query x x .
Given an agent f θ f_{\theta} that produces output y ^ = f θ ( x , c ( x ) ) \hat{y}=f_{\theta}(x,c(x)) , the goal of CE is to find the optimal context function : c ∗ = arg max c ∈ 𝒞 J ( c ) , c^{*}=\arg\max_{c\in\mathcal{C}}J(c), (2) where J ( c ) J(c) is a task-specific objective. This formulation encompasses supervised settings, where J ( c ) = − ∑ i ℓ ( f θ ( x i , c ( x i ) ) , y i ) J(c)=-\sum_{i}\ell(f_{\theta}(x_{i},c(x_{i})),y_{i}) measures prediction accuracy, and RL-based settings, where J ( c ) = 𝔼 x [ R ( f θ ( x , c ( x ) ) ) ] J(c)=\mathbb{E}_{x}[R(f_{\theta}(x,c(x)))] measures expected reward.
This formulation admits diverse instantiations along the spectra of dynamism and complexity : static prompts correspond to constant functions c ( x ) = ρ 0 c(x)=\rho_{0} with identity operators; retrieval-augmented systems implement c ( x ) = F retrieve ( x , ρ ) c(x)=F_{\text{retrieve}}(x;\rho) over fixed resources; and agentic systems may incorporate pre/post-model hooks and chain multiple operators that dynamically generate, modify, or discard components during inference. The optimal design of ( ρ , F ) (\rho,F) depends on the task domain, data characteristics, and computational constraints.
Prior CE methods instantiate c c with predefined components and operators, then optimize c c directly using fixed procedures. For instance, ACE employs iterative generation-reflection-curation loops to optimize context as an itemized list [ Zhang et al., 2026 ] . These procedures impose structural biases that may be suboptimal for specific tasks. MCE instead introduces a skill s ∈ 𝒮 s\in\mathcal{S} as an executable specification that defines how the context function should be represented and learned from data. Given a skill s s , a base-level agent executes it to produce a context function c s = ( ρ s , F s ) c_{s}=(\rho_{s},F_{s}) . MCE then solves the bi-level problem : s ∗ = arg max s ∈ 𝒮 J val ( c s ∗ ) s.t. c s ∗ = arg max c s J train ( c s , s ) , s^{*}=\arg\max_{s\in\mathcal{S}}J_{\text{val}}(c_{s}^{*})\quad\text{s.t.}\quad c_{s}^{*}=\arg\max_{c_{s}}J_{\text{train}}(c_{s};s), (3) where the inner optimization finds the best context function given skill s s , and the outer optimization finds the skill that yields context with maximal validation performance.