context-engineering-collection
Audited by Runlayer on Mar 12, 2026
Tool passed security scan
Malicious tool definition detected
This affects both consistency across compressions and which details survive repeated compression cycles. A concrete example Consider a debugging session where a user reported a 401 error on the /api/auth/login endpoint despite valid credentials. Over 178 messages and 89,000 tokens, the assistant: Read the authentication controller and identified JWT token generation Examined the middleware chain and found a misconfigured CORS policy Discovered the session store was using an expired Redis connect
Malicious tool definition detected
Research shows observations comprise 83.9% of tokens in typical agent trajectories—masking offers significant efficiency gains. Architectural approaches include Core Context Aware (CCA) Attention, a plug-and-play module achieving 5.7× faster inference at 64K tokens, arXiv and Google's Chain of Agents (CoA), which breaks inputs into chunks processed by worker agents sequentially, reducing time complexity from n² to nk.
Tool passed security scan
Malicious tool definition detected
Note that conveniently, the optimal learning rate does *not* depend on the LoRA rank. In fact, you can verify that if you train with SL on different ranks (but with the same LR), you'll get exactly the same learning curves for the first few steps of training. --- ## File: evals.mdx import { Callout } from 'nextra/components' import { CookbookLink } from '../components/CookbookLink' # Evaluations Our training scripts will print out training and test loss.
We've provided a ready-to-run example that fine-tunes Llama-3.1-8B on a small instruction-following dataset in <CookbookLink path="tinker_cookbook/recipes/sl_basic.py">sl_basic.py</CookbookLink>. You can run it from the command line as follows: ```bash python -m tinker_cookbook.recipes.sl_basic ``` This script fine-tunes the base (pretrained) model on a small dataset called [NoRobots](https://huggingface.co/datasets/HuggingFaceH4/no_robots), created by Hugging Face.
Malicious tool definition detected
* **G3 Beyond Basics:** **PASS** * *Evidence:* Addresses advanced patterns: multi-phase agent orchestration with human validation, context compression for 5M+ token codebases, distinction between essential/accidental complexity for AI, using manual work artifacts as research seeds, pattern recognition atrophy in AI-assisted development. * **G4 Source Verifiability:** **PASS** * *Evidence:* Speaker explicitly states: 'I spent the last few years at Netflix helping drive adoption of AI tools.' Refe
Tool passed security scan
Malicious tool definition detected
This seems to be a generally useful strategy for context reduction, and I notice that it’s similar to Anthropic’s context editing feature: Context editing automatically clears stale tool calls and results from within the context window when approaching token limits. As your agent executes tasks and accumulates tool results, context editing removes stale content while preserving the conversation flow, effectively extending how long agents can run without manual intervention. When compaction reach
Make your context append-only. Avoid modifying previous actions or observations. Ensure your serialization is deterministic. Many programming languages and libraries don't guarantee stable key ordering when serializing JSON objects, which
Complex research tasks naturally involve exploring many sources. Our early agents executed sequential searches, which was painfully slow. For speed, we introduced two kinds of parallelization: (1) the lead agent spins up 3-5 subagents in parallel rather than serially; (2) the subagents use 3+ tools in parallel. These changes cut research time by up to 90% for complex queries, allowing Research to do more work in minutes instead of hours while covering more information than other systems.
Acknowledgements Written by Jeremy Hadfield, Barry Zhang, Kenneth Lien, Florian Scholz, Jeremy Fox, and Daniel Ford. This work reflects the collective efforts of several teams across Anthropic who made the Research feature possible. Special thanks go to the Anthropic apps engineering team, whose dedication brought this complex multi-agent system to production.
Search the payment logs for purchase_complete and customer_id=9182. Find the cancellation request by Customer ID 45892. Each evaluation prompt should be paired with a verifiable response or outcome. Your verifier can be as simple as an exact string comparison between ground truth and sampled responses, or as advanced as enlisting Claude to judge the response.
In fact, most of the advice in this post came from repeatedly optimizing our internal tool implementations with Claude Code. Our evaluations were created on top of our internal workspace, mirroring the complexity of our internal workflows, including real projects, documents, and messages.
Malicious tool definition detected
""" hits = 0 misses = 0 for req in requests: prefix = req.get("prefix_hash", "") token_count = req.get("token_count", 0) if prefix in cache: hits += token_count * cache[prefix].get("hit_ratio", 0) else: misses += token_count total = hits + misses return { "hit_rate": hits / total if total > 0 else 0, "cache_hits": hits, "cache_misses": misses, "recommendations": generate_cache_recommendations(hits, misses) } def generate_cache_recommendations(hits: int, misses: int) -> list: """Generate recommen
Malicious tool definition detected
Malicious tool definition detected
When compression triggers, summarize only the newly-truncated span and merge with the existing summary. Structure forces preservation by dedicating sections to specific information types. 2. **Opaque Compression**: Produce compressed representations optimized for reconstruction fidelity.
Optimize for tokens-per-task, not tokens-per-request 2. Use structured summaries with explicit sections for file tracking 3.
Tool passed security scan
Prompt Injection
Context Poisoning
Tool passed security scan
Malicious tool definition detected
Allow file reads before git sync completes; block only writes 4.
Tool passed security scan
Malicious tool definition detected
If your content exceeds this, split it into separate files using the progressive disclosure patterns described earlier.
Tool passed security scan
Malicious tool definition detected
**Over-constraining the model**: Adding guardrails, pre-filtering, and validation logic that the model could handle on its own. Test whether your scaffolding helps or hurts. **Ignoring costs until production**: Token costs compound quickly at scale. Estimate and track from the beginning.
Description: evaluation - Output evaluation frameworks External resources: - Karpathy's HN Time Capsule project: https://github.com/karpathy/hn-time-capsule - Vercel d0 architectural reduction: https://vercel.com/blog/we-removed-80-percent-of-our-agents-tools - Manus context engineering: Peak Ji's blog on context engineering lessons - Anthropic multi-agent research: How we built our multi-agent research system --- ## Skill Metadata **Created**: 2025-12-25 **Last Updated**: 2025-12-25 **Author**:
Tool passed security scan
Malicious tool definition detected
Target: - 50-70% token reduction for aggressive compaction - Less than 5% quality degradation from compaction - Less than 10% latency increase from compaction overhead ### Masking Performance Observation masking should reduce token count significantly: - 60-80% reduction in masked observations - Less than 2% quality impact from masking - Near-zero latency overhead ### Cache Performance KV-cache optimization should improve cost and latency: - 70%+ cache hit rate for stable workloads - 50%+ cost r
Risky tool definition detected
Malicious tool definition detected
Tool: context-engineering-collection/researcher/llm-as-a-judge.md [1/3] Description: You are a Principal Research Curator for the Agent-Skills-for-Context-Engineering repository. ## YOUR MISSION Identify **Implementable Engineering Primitives** for building production AI agent skills.
Malicious tool definition detected
Malicious tool definition detected
The hypothesis was, what if we just give Claude access to the raw Cube DSL files and let it cook? What if bash is all you need? Models are getting smarter and context windows are getting larger, so maybe the best agent architecture is almost no architecture at all. Link to headingv2: The file system is the agent The new stack: Model: Claude Opus 4.5 via the AI SDK Execution: Vercel Sandbox for context exploration Routing: Vercel Gateway for request handling and observability Server: Next.js API
Malicious tool definition detected
[y/N]: " overwrite if [ "$overwrite" != "y" ] && [ "$overwrite" != "Y" ]; then echo "Installation cancelled." exit 0 fi rm -rf "$TARGET_DIR" fi # Copy files echo "" echo "Installing to: $TARGET_DIR" cp -r "$BRAIN_DIR" "$TARGET_DIR" # Remove install script from target (not needed there) rm -f "$TARGET_DIR/scripts/install.sh" echo "" echo -e "${GREEN}Installation complete!${NC}" echo "" echo "Next steps:" echo "1.
Malicious tool definition detected
Quality gates require central coordination 3. Human oversight points are well-defined 4. Context isolation per phase prevents attention saturation ``` User Config -> Orchestrator -> [Scraper, Analyzer, Synthesizer, Writer, Editor] -> Daily Book ``` ### Agent Definitions #### 1.
Malicious tool definition detected
apiKey: process.env.ANTHROPIC_API_KEY || '' } } as const; export function validateConfig(): void { if (!config.openai.apiKey) { throw new Error('OPENAI_API_KEY is required.
Risky tool definition detected
Malicious tool definition detected
The evolution from vector stores to knowledge graphs to temporal knowledge graphs represents increasing investment in structured memory for improved retrieval and reasoning. ## When to Activate Activate this skill when: - Building agents that must persist knowledge across sessions - Choosing between memory frameworks (Mem0, Zep/Graphiti, Letta, LangMem, Cognee) - Needing to maintain entity consistency across conversations - Implementing reasoning over accumulated knowledge - Designing memory arc
Tool passed security scan
Risky tool definition detected
Tool: context-engineering-collection/examples/interleaved-thinking/optimization_artifacts/iteration_10/trace.txt [2/4] Description: quantity) - Position most relevant chunks at boundaries - Rank by relevance, not just similarity - Consider summarization to preserve key information density ## Debugging Context Issues - Enable verbose mode for detailed logging - Use tracing tools (LangSmith, W&B) - Look for patterns: tool confusion, goal drift, context loss - Implement progress checks and early st
Malicious tool definition detected
The coordination of autonomous agents requires rigorous protocols to prevent divergence, sycophancy, and infinite loops, necessitating the adoption of advanced orchestration frameworks like LangGraph, AutoGen, and CrewAI.5Furthermore, the passive retrieval mechanisms of the past—simple Vector RAG—are proving insufficient for the complex reasoning required by agents. The industry is witnessing a migration toward structured, graph-based memory systems (GraphRAG, Zep) that model relationships and t
Malicious tool definition detected
Tool: context-engineering-collection/.cursorindexingignore
Tool passed security scan
Malicious tool definition detected
Tool: context-engineering-collection/skills/filesystem-context/references/implementation-patterns.md [2/2] Description: command, "exit_code": result.returncode, "stdout": result.stdout, "stderr": result.stderr, "timestamp": datetime.now().isoformat() } if capture: output["file"] = self._persist_output(output) return output def _persist_output(self, output: dict) -> str: """Write output to terminal file.""" filename = f"{self.session_counter}.txt" file_path = self.terminals_path / filename conten
Tool passed security scan
Malicious tool definition detected
Context engineering is iterative and the curation phase happens each time you decide what to pass to the model. It is not a one-time prompt writing exercise but an ongoing discipline of context management.
Malicious tool definition detected
Open a Pull Request ### Testing Guidelines - Tests run against real OpenAI API (requires API key) - Use `60000ms` timeout for single API calls - Use `120000ms` timeout for multiple API calls - Tests should be deterministic despite LLM variance ## Development Setup ```bash # Clone git clone https://github.com/muratcankoylan/llm-as-judge-skills.git cd llm-as-judge-skills # Install npm install # Configure cp env.example .env # Add your OPENAI_API_KEY to .env # Build npm run build # Test npm test ``
Tool passed security scan
Risky tool definition detected
Tool passed security scan
Malicious tool definition detected
Extract incomplete tasks for continuation probes 4.
Tool passed security scan
Risky tool definition detected
Tool: context-engineering-collection/examples/interleaved-thinking/optimization_artifacts/iteration_9/trace.txt [4/4]
Malicious tool definition detected
Risky tool definition detected
Tool: context-engineering-collection/examples/interleaved-thinking/optimization_artifacts/iteration_10/analysis.txt Description: ============================================================ REASONING TRACE ANALYSIS REPORT ============================================================ Overall Score: 70/100 Scores: - Reasoning Clarity: 80/100 - Goal Adherence: 85/100 - Tool Usage Quality: 70/100 - Error Recovery: 45/100 Detected Patterns: [MEDIUM] incomplete_reasoning The agent reaches conclusions a
Tool passed security scan
Malicious tool definition detected
### Key Patterns **1. Append-Only Context** Never modify previous actions or observations. Ensure deterministic serialization (JSON key ordering must be stable). A single token difference invalidates the cache from that point forward. Common mistake: Including a timestamp at the beginning of the system prompt kills cache hit rate entirely.
Tool passed security scan
Malicious tool definition detected
### context-fundamentals Prompt diversity prevents attention collapse on single patterns. When training with identical prompt structures, the model memorizes the instruction-response mapping.
Data Exfiltration
Shadow Persistence
Supply Chain Compromise
Malicious tool definition detected
*$py.class .Python *.so .env venv/ ENV/ # Node node_modules/ npm-debug.log yarn-error.log # Personal data (uncomment if you want to keep local-only) # content/drafts/*.md # network/contacts.jsonl # operations/metrics.jsonl # Temporary files *.tmp *.temp *.log
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Passed Files (156)Click to expand
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan
Tool passed security scan