<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: seiwan maikuma</title>
    <description>The latest articles on Forem by seiwan maikuma (@seiwan-maikuma).</description>
    <link>https://forem.com/seiwan-maikuma</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3379397%2Fdb35c9cf-03ed-4d16-a7b0-5dd5cc74df91.png</url>
      <title>Forem: seiwan maikuma</title>
      <link>https://forem.com/seiwan-maikuma</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/seiwan-maikuma"/>
    <language>en</language>
    <item>
      <title>A Deep Dive into GitHub Copilot Agent Mode’s Prompt Structure</title>
      <dc:creator>seiwan maikuma</dc:creator>
      <pubDate>Sat, 27 Dec 2025 14:15:18 +0000</pubDate>
      <link>https://forem.com/seiwan-maikuma/a-deep-dive-into-github-copilot-agent-modes-prompt-structure-2i4g</link>
      <guid>https://forem.com/seiwan-maikuma/a-deep-dive-into-github-copilot-agent-modes-prompt-structure-2i4g</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;GitHub Copilot is not “just” a code completion tool—it behaves like an AI coder powered by layered prompt engineering. When you type a request, Copilot typically sends a multi-layer prompt to the model behind the scenes.&lt;/p&gt;

&lt;p&gt;In this article, we closely analyze the prompt structure GitHub Copilot appears to use, and extract the underlying design philosophy and practical prompt-engineering best practices. This is aimed at engineers who want to use AI tools more effectively and developers interested in learning prompt engineering through real-world systems.&lt;/p&gt;

&lt;h3&gt;
  
  
  Test environment &amp;amp; methodology
&lt;/h3&gt;

&lt;p&gt;This article is based on observation and analysis under the following setup:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Verification date&lt;/strong&gt;: Dec 27, 2025&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;VS Code version&lt;/strong&gt;: 1.107&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Method&lt;/strong&gt;: Inspecting logs via &lt;strong&gt;Chat Debug view&lt;/strong&gt; (official VS Code debugging feature)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Chat Debug view is an official mechanism to inspect Copilot Chat’s internal behavior. Using it, we observed the structure of prompts actually passed into the model.&lt;/p&gt;

&lt;p&gt;:::message alert&lt;br&gt;
Because this write-up is based on log interpretation, it may contain mistakes. Also, Copilot’s internal prompt structure can change with updates.&lt;br&gt;
:::&lt;/p&gt;
&lt;h3&gt;
  
  
  Why should we care about prompt structure?
&lt;/h3&gt;

&lt;p&gt;Understanding Copilot’s prompt layers helps you:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Give better instructions&lt;/strong&gt;: You learn what context is (and isn’t) already provided.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Learn best practices&lt;/strong&gt;: You can study a production-grade prompt design created by Microsoft/GitHub.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Explain Copilot’s behavior&lt;/strong&gt;: “Why did it do that?” becomes easier to answer.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Design your own agent&lt;/strong&gt;: The architectural ideas transfer well to custom AI agents.&lt;/li&gt;
&lt;/ul&gt;


&lt;h2&gt;
  
  
  The 3-layer prompt structure Copilot receives
&lt;/h2&gt;

&lt;p&gt;Copilot’s prompt often looks like a layered system:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
Layer 1: System prompt
↓ (universal rules for “AI coder” behavior)
Layer 2: Workspace information
↓ (environment-specific context)
Layer 3: User request + extra context
↓ (the actual task)
Model response

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Roles of each layer
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Layer 1 (System prompt)&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Universal, environment-independent instructions: tool strategy, workflow, communication style, safety rules, output format.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Layer 2 (Workspace info)&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Dynamic environment context: OS, repository/workspace structure, current file, etc.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Layer 3 (User request)&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Your input, plus additional context such as date, reminders, attachments, selected text, screenshots, and so on.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This separation keeps the “rules” stable while allowing environment-specific details to vary per session.&lt;/p&gt;




&lt;h2&gt;
  
  
  Layer 1: System prompt — the “AI coder” design philosophy
&lt;/h2&gt;

&lt;p&gt;The system prompt is Copilot’s brain. It defines how the model should behave.&lt;/p&gt;

&lt;h3&gt;
  
  
  Purpose of the system prompt
&lt;/h3&gt;

&lt;p&gt;Typical elements include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Identity&lt;/strong&gt;: “You are GitHub Copilot,” sometimes including the model family/version.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Policy compliance&lt;/strong&gt;: content policy, copyright constraints, refusal behavior.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Baseline stance&lt;/strong&gt;: concise, objective answers; strict compliance with user requirements.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Tool usage strategy
&lt;/h3&gt;

&lt;p&gt;Copilot has multiple tools; the system prompt usually instructs when to use what.&lt;/p&gt;

&lt;h4&gt;
  
  
  Context-gathering tools
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;read_file&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Read large ranges at once (e.g., up to ~2000 lines) to reduce repeated calls and keep context coherent.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;semantic_search&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Use when you don’t know where a function/file is; search by meaning, not just keywords.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;grep_search&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Use for quick discovery within files; often faster than reading everything.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;fetch_webpage&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
If a URL is included in context, fetch it; sometimes also follow related links recursively.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  File-editing strategy
&lt;/h4&gt;

&lt;p&gt;Editing is expensive and error-prone, so the system prompt often enforces:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Read before you edit&lt;/strong&gt;: ensure you understand the file and identify the exact location.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Include enough context&lt;/strong&gt;: e.g., “include ±3 lines around the edit target” so patches apply reliably.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Small, testable increments&lt;/strong&gt;: make changes in steps that can be validated.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Avoid error loops&lt;/strong&gt;: if you fail repeatedly on the same file, switch approaches.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  The 8-step workflow design
&lt;/h2&gt;

&lt;p&gt;A core part of “agent mode” behavior is a structured workflow—an explicit thinking/working process:&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 1: Deeply understand the problem
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;What is the expected behavior?&lt;/li&gt;
&lt;li&gt;What are the edge cases?&lt;/li&gt;
&lt;li&gt;What pitfalls are likely?&lt;/li&gt;
&lt;li&gt;Where does this fit in the overall codebase?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The key idea: don’t write code immediately—first understand what must be true.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 2: Investigate the codebase
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Explore related files and directories&lt;/li&gt;
&lt;li&gt;Search for key functions/classes/variables&lt;/li&gt;
&lt;li&gt;Identify the root cause&lt;/li&gt;
&lt;li&gt;Continuously update your understanding as you learn more&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Even if context is missing, the agent is pushed to use tools to find what it needs.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 3: Produce a detailed plan
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Make a concrete, verifiable plan&lt;/li&gt;
&lt;li&gt;Create a TODO list (often via a dedicated tool)&lt;/li&gt;
&lt;li&gt;Update progress after each step&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Important&lt;/strong&gt;: proceed to the next step without repeatedly asking the user, if you can act safely&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is a major “agent” characteristic: autonomous forward motion.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 4: Implement changes
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Read relevant files first (large chunks)&lt;/li&gt;
&lt;li&gt;Make small, testable changes&lt;/li&gt;
&lt;li&gt;Create &lt;code&gt;.env&lt;/code&gt; automatically if environment variables are required&lt;/li&gt;
&lt;li&gt;Retry if patch application fails&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Step 5: Debug
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Use error collection tools to inspect problems&lt;/li&gt;
&lt;li&gt;Fix the cause, not just the symptom&lt;/li&gt;
&lt;li&gt;Temporary debug code is allowed (logs/prints/tests) to validate hypotheses&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Step 6: Test frequently
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Run tests after each change&lt;/li&gt;
&lt;li&gt;Ensure both visible and hidden tests pass&lt;/li&gt;
&lt;li&gt;When tests fail, find the true root cause&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Step 7: Iterate until fixed
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Continue until all tests pass&lt;/li&gt;
&lt;li&gt;If stuck looping in the same file multiple times, change strategy&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Step 8: Comprehensive verification &amp;amp; reflection
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Re-check the original intent&lt;/li&gt;
&lt;li&gt;Add extra tests if needed&lt;/li&gt;
&lt;li&gt;Update TODO list: done / skipped / blocked items must be explicit&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This shows Copilot is designed to behave like a systematic problem-solver, not a chat bot.&lt;/p&gt;




&lt;h2&gt;
  
  
  Communication guidelines
&lt;/h2&gt;

&lt;p&gt;System prompts usually define communication rules too:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Tone&lt;/strong&gt;: warm, professional, approachable&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Brevity&lt;/strong&gt;: keep it short and structured&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Critical thinking&lt;/strong&gt;: don’t blindly obey user corrections—think first&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Humor&lt;/strong&gt;: light wit is allowed when appropriate&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Output formatting requirements
&lt;/h2&gt;

&lt;p&gt;To optimize readability in the editor UI:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Use &lt;strong&gt;Markdown&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Wrap symbols in backticks: &lt;code&gt;MyClass&lt;/code&gt;, &lt;code&gt;handleClick()&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Use linkable file paths (workspace-relative) when possible&lt;/li&gt;
&lt;li&gt;Use KaTeX for math when relevant&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Layer 2: Workspace information — environment-specific optimization
&lt;/h2&gt;

&lt;p&gt;This layer provides context unique to the user’s environment.&lt;/p&gt;

&lt;h3&gt;
  
  
  Typical environment information
&lt;/h3&gt;

&lt;h4&gt;
  
  
  OS info
&lt;/h4&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;The user's current OS is: Windows
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This influences:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;command syntax (PowerShell vs bash)&lt;/li&gt;
&lt;li&gt;path separators (&lt;code&gt;\&lt;/code&gt; vs &lt;code&gt;/&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;OS-specific instructions&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Workspace structure
&lt;/h4&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;I am working in a workspace with the following folders:
- c:\CodeStudy\Prompts

I am working in a workspace that has the following structure:
README.md
ai_coder/
  github_copilot/
    agent/
      basic.general.md
...
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This helps the model:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;decide which files matter&lt;/li&gt;
&lt;li&gt;construct correct absolute paths for tools&lt;/li&gt;
&lt;li&gt;quickly grasp project layout&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Large repos may provide abbreviated trees, prompting the agent to fetch more context with tools.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why Layer 2 matters
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;higher accuracy via environment awareness&lt;/li&gt;
&lt;li&gt;fewer tool errors due to correct path handling&lt;/li&gt;
&lt;li&gt;faster project comprehension&lt;/li&gt;
&lt;li&gt;more stable parsing when the info is structured (e.g., XML-like tags)&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Layer 3: User request — context amplification
&lt;/h2&gt;

&lt;p&gt;This is your request, plus extra metadata attached by the system.&lt;/p&gt;

&lt;h3&gt;
  
  
  Common additions
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Date context
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;context&amp;gt;&lt;/span&gt;
The current date is December 27, 2025.
&lt;span class="nt"&gt;&amp;lt;/context&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Useful for time-sensitive tasks (log analysis, deadlines, version recency).&lt;/p&gt;

&lt;h4&gt;
  
  
  Editor context
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;editorContext&amp;gt;&lt;/span&gt;
The user's current file is at: c:&lt;span class="se"&gt;\.&lt;/span&gt;..&lt;span class="se"&gt;\s&lt;/span&gt;omefile.md
&lt;span class="nt"&gt;&amp;lt;/editorContext&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This makes “this file” understandable and keeps the working set coherent.&lt;/p&gt;

&lt;h4&gt;
  
  
  Attachments
&lt;/h4&gt;

&lt;p&gt;Selected text, screenshots, and attached files may be included under something like &lt;code&gt;&amp;lt;attachments&amp;gt;&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Reminder instructions (agent behavior reinforcement)
&lt;/h3&gt;

&lt;p&gt;A key feature is explicit instruction like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;reminderInstructions&amp;gt;&lt;/span&gt;
You are an agent - you must keep going until the user's query is completely resolved,
before ending your turn and yielding back to the user. ONLY terminate your turn when
you are sure that the problem is solved, or you absolutely cannot continue.

You take action when possible - the user is expecting YOU to take action and go to
work for them. Don't ask unnecessary questions about the details if you can simply
DO something useful instead.
&lt;span class="nt"&gt;&amp;lt;/reminderInstructions&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The philosophy:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Autonomy&lt;/strong&gt;: keep working until done; don’t freeze on uncertainty&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Action-first&lt;/strong&gt;: prefer doing useful work over asking extra questions&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Key design principles &amp;amp; best practices
&lt;/h2&gt;

&lt;p&gt;From this structure, we can extract reusable prompt engineering lessons.&lt;/p&gt;

&lt;h3&gt;
  
  
  1) Hierarchical prompt design
&lt;/h3&gt;

&lt;p&gt;Separate:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;stable universal rules (system)&lt;/li&gt;
&lt;li&gt;dynamic environment context (workspace)&lt;/li&gt;
&lt;li&gt;per-request task details (user request)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This improves maintainability and reuse.&lt;/p&gt;

&lt;h3&gt;
  
  
  2) Structured workflow
&lt;/h3&gt;

&lt;p&gt;Explicitly encode the agent’s process:&lt;br&gt;
understand → investigate → plan → implement → debug → test → iterate → verify&lt;/p&gt;
&lt;h3&gt;
  
  
  3) Clear tool guidelines
&lt;/h3&gt;

&lt;p&gt;Don’t just provide tools—define when and how to use them.&lt;/p&gt;
&lt;h3&gt;
  
  
  4) Autonomy + action orientation
&lt;/h3&gt;

&lt;p&gt;Give the agent permission and responsibility to proceed, with guardrails.&lt;/p&gt;
&lt;h3&gt;
  
  
  5) Context before action
&lt;/h3&gt;

&lt;p&gt;Quality of output correlates strongly with quality/amount of context.&lt;/p&gt;
&lt;h3&gt;
  
  
  6) Structured tags (XML/JSON-like)
&lt;/h3&gt;

&lt;p&gt;Segment complex info clearly to reduce misinterpretation.&lt;/p&gt;
&lt;h3&gt;
  
  
  7) Error-handling strategy
&lt;/h3&gt;

&lt;p&gt;Predefine what to do when stuck: retry, then switch approach after repeated failures.&lt;/p&gt;
&lt;h3&gt;
  
  
  8) Standardized output format
&lt;/h3&gt;

&lt;p&gt;Consistency improves user experience and reduces confusion.&lt;/p&gt;


&lt;h2&gt;
  
  
  Applying this to prompt engineering
&lt;/h2&gt;

&lt;p&gt;You can reuse the same architecture in your own systems.&lt;/p&gt;
&lt;h3&gt;
  
  
  Example: designing your own AI agent prompt
&lt;/h3&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;&lt;span class="gh"&gt;# System prompt (stable rules)&lt;/span&gt;
You are a professional data analyst.
Follow this workflow:
&lt;span class="p"&gt;1.&lt;/span&gt; Understand the data
&lt;span class="p"&gt;2.&lt;/span&gt; Create an analysis plan
&lt;span class="p"&gt;3.&lt;/span&gt; Execute the analysis in small steps
...

&lt;span class="gh"&gt;# Environment info (dynamic)&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;environment&amp;gt;&lt;/span&gt;
Data source: PostgreSQL
Available tools: pandas, matplotlib
&lt;span class="nt"&gt;&amp;lt;/environment&amp;gt;&lt;/span&gt;

&lt;span class="gh"&gt;# User request (per task)&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;task&amp;gt;&lt;/span&gt;
Analyze sales trends and summarize key insights.
&lt;span class="nt"&gt;&amp;lt;/task&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;reminder&amp;gt;&lt;/span&gt;
Keep going until the analysis is complete.
&lt;span class="nt"&gt;&amp;lt;/reminder&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h3&gt;
  
  
  How to write effective requests to Copilot
&lt;/h3&gt;

&lt;p&gt;✅ Better:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;Fix the error in the current file.
Also check related tests and ensure all tests pass.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This gives:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;a clear goal&lt;/li&gt;
&lt;li&gt;autonomy for the agent&lt;/li&gt;
&lt;li&gt;alignment with the workflow (investigate → fix → test)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;❌ Worse:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;Tell me if there is an error.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;requests information only&lt;/li&gt;
&lt;li&gt;doesn’t trigger action&lt;/li&gt;
&lt;li&gt;leaves next steps ambiguous&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  General prompt principles learned here
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;clarity&lt;/li&gt;
&lt;li&gt;structure&lt;/li&gt;
&lt;li&gt;sufficient context&lt;/li&gt;
&lt;li&gt;controlled autonomy&lt;/li&gt;
&lt;li&gt;verifiable success criteria&lt;/li&gt;
&lt;li&gt;incremental steps&lt;/li&gt;
&lt;li&gt;flexible error handling&lt;/li&gt;
&lt;li&gt;consistency&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;By analyzing Copilot’s layered prompt structure, we can see it behaves like a systematic problem-solving agent.&lt;/p&gt;

&lt;h3&gt;
  
  
  What the prompt structure boils down to
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Layer 1&lt;/strong&gt;: universal agent rules (tools + 8-step workflow + format + policy)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Layer 2&lt;/strong&gt;: environment context (OS + workspace tree + current file)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Layer 3&lt;/strong&gt;: your request plus metadata (date + attachments + “keep going” reminder)&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Practical takeaways
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Layer your prompts for maintainability&lt;/li&gt;
&lt;li&gt;Encode workflows explicitly&lt;/li&gt;
&lt;li&gt;Specify tool usage rules&lt;/li&gt;
&lt;li&gt;Give autonomy with guardrails&lt;/li&gt;
&lt;li&gt;Standardize output&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Copilot’s architecture is a strong reference implementation for anyone building AI agents or designing prompts for complex engineering tasks.&lt;/p&gt;




&lt;h2&gt;
  
  
  References
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Official docs
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://code.visualstudio.com/docs/copilot/chat/chat-debug-view" rel="noopener noreferrer"&gt;Chat Debug view - Visual Studio Code&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.github.com/en/copilot/concepts/prompting/prompt-engineering" rel="noopener noreferrer"&gt;Prompt engineering for GitHub Copilot Chat - GitHub Docs&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://learn.microsoft.com/en-us/training/modules/introduction-prompt-engineering-with-github-copilot/" rel="noopener noreferrer"&gt;Introduction to prompt engineering with GitHub Copilot - Microsoft Learn&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Internals / reverse engineering
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://thakkarparth007.github.io/copilot-explorer/posts/copilot-internals.html" rel="noopener noreferrer"&gt;Copilot Internals - thakkarparth007&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/thakkarparth007/copilot-explorer" rel="noopener noreferrer"&gt;copilot-explorer - GitHub&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://medium.com/@techiewissen/how-github-copilot-agent-mode-appears-to-work-a-reverse-engineering-deep-dive-a75ff5e0a505" rel="noopener noreferrer"&gt;How GitHub Copilot Agent Mode Appears to Work - Medium&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://devblogs.microsoft.com/all-things-azure/github-copilot-chat-explained-the-life-of-a-prompt/" rel="noopener noreferrer"&gt;GitHub Copilot Chat Explained: The Life of a Prompt - Microsoft DevBlogs&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>ai</category>
      <category>githubcopilot</category>
      <category>vscode</category>
      <category>promptengineering</category>
    </item>
    <item>
      <title>The Complete Guide to Meta-Prompting: The Technique of Having AI Write Your Prompts</title>
      <dc:creator>seiwan maikuma</dc:creator>
      <pubDate>Sun, 14 Dec 2025 16:10:30 +0000</pubDate>
      <link>https://forem.com/seiwan-maikuma/the-complete-guide-to-meta-prompting-the-technique-of-having-ai-write-your-prompts-12ai</link>
      <guid>https://forem.com/seiwan-maikuma/the-complete-guide-to-meta-prompting-the-technique-of-having-ai-write-your-prompts-12ai</guid>
      <description>&lt;h2&gt;
  
  
  TL;DR (Conclusion)
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;What a meta-prompt is&lt;/strong&gt;: A higher-order prompting technique that makes AI generate and improve prompts&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Main benefit&lt;/strong&gt;: You can get structured, clarified prompts at low cost&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Practicality&lt;/strong&gt;: Effective enough that Anthropic and OpenAI provide official tools&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Advanced results&lt;/strong&gt;: Stanford/OpenAI research reports a 17.1% improvement over standard prompting&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  1. What Is a Meta-Prompt?
&lt;/h2&gt;

&lt;p&gt;A meta-prompt is a &lt;strong&gt;higher-level prompt used to create the prompt you will give to AI&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;If a normal prompt is “instructions to AI,” a meta-prompt is “instructions for creating instructions to AI.”&lt;/p&gt;

&lt;h3&gt;
  
  
  Normal Prompt vs. Meta-Prompt
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Foa8e3holt226zbe586i1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Foa8e3holt226zbe586i1.png" alt=" " width="293" height="290"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbqm724ddfvowdh545d41.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbqm724ddfvowdh545d41.png" alt=" " width="417" height="491"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  The Two Components of a Meta-Prompt
&lt;/h3&gt;

&lt;p&gt;A meta-prompt usually consists of two parts:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Component&lt;/th&gt;
&lt;th&gt;Role&lt;/th&gt;
&lt;th&gt;Example&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Prompt improvement instructions&lt;/td&gt;
&lt;td&gt;Tell the model how to improve the normal prompt&lt;/td&gt;
&lt;td&gt;“Improve the following prompt so it includes more specific and clear instructions.”&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Normal prompt&lt;/td&gt;
&lt;td&gt;Convey the user’s real goal&lt;/td&gt;
&lt;td&gt;“Propose five innovative business ideas.”&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  2. Why Meta-Prompting Works
&lt;/h2&gt;

&lt;h3&gt;
  
  
  2.1 The “Formatter” Effect
&lt;/h3&gt;

&lt;p&gt;AI is good at presenting information in consistent formats. Using a meta-prompt tends to produce a &lt;strong&gt;more structured prompt&lt;/strong&gt; than one written directly by a human.&lt;/p&gt;

&lt;h3&gt;
  
  
  2.2 The Clarification Effect
&lt;/h3&gt;

&lt;p&gt;Meta-prompts push the model to avoid vague instructions and replace them with specific, concrete ones. In the process, the user can also notice &lt;strong&gt;ambiguities that were hiding in their own prompt or task&lt;/strong&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  2.3 Low Cost
&lt;/h3&gt;

&lt;p&gt;The only real overhead is writing the “prompt improvement instructions.” In most cases, very simple instructions are enough—&lt;strong&gt;much cheaper&lt;/strong&gt; than writing a clear, structured prompt from scratch.&lt;/p&gt;

&lt;h3&gt;
  
  
  2.4 Simplifying the Normal Prompt
&lt;/h3&gt;

&lt;p&gt;Because the meta-prompt handles structure and clarity, the normal prompt can focus on &lt;strong&gt;the essential content&lt;/strong&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  2.5 Better Accuracy
&lt;/h3&gt;

&lt;p&gt;Accuracy improvements come from two angles:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Clear instructions&lt;/strong&gt;: As the meta-prompt forces clarity, the model can understand the user’s intent more precisely.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The model’s reasoning gets embedded in the prompt&lt;/strong&gt;: During improvement, the prompt often picks up optimal steps and necessary context.&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  3. Understanding Meta-Prompting as a Function
&lt;/h2&gt;

&lt;p&gt;If you view meta-prompting through the lens of functional programming, the essence becomes clearer.&lt;/p&gt;

&lt;h3&gt;
  
  
  3.1 Basic Model
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Type definitions&lt;/span&gt;
&lt;span class="kd"&gt;type&lt;/span&gt; &lt;span class="nx"&gt;Prompt&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;type&lt;/span&gt; &lt;span class="nx"&gt;Response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;// Normal AI call&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;ai&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;prompt&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;Prompt&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;Response&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;// Prompt improvement function&lt;/span&gt;
&lt;span class="kd"&gt;type&lt;/span&gt; &lt;span class="nx"&gt;PromptImprover&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;prompt&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;Prompt&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;Prompt&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;// How meta-prompting works&lt;/span&gt;
&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;metaPrompt&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="nx"&gt;improveInstruction&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  &lt;span class="c1"&gt;// prompt improvement instructions&lt;/span&gt;
  &lt;span class="nx"&gt;userPrompt&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;Prompt&lt;/span&gt;           &lt;span class="c1"&gt;// normal prompt&lt;/span&gt;
&lt;span class="p"&gt;):&lt;/span&gt; &lt;span class="nx"&gt;Response&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c1"&gt;// Step 1: Improve the normal prompt based on the improvement instructions&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;improvedPrompt&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;Prompt&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;ai&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;improveInstruction&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;userPrompt&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="c1"&gt;// Step 2: Call the AI using the improved prompt&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;finalResponse&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;Response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;ai&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;improvedPrompt&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;finalResponse&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  3.2 Understanding It as Function Composition
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Treat prompt improvers as composable functions&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;improve1&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;PromptImprover&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;p&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;ai&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`Please structure this: &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;p&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;improve2&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;PromptImprover&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;p&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;ai&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`Please add concrete examples: &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;p&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="c1"&gt;// Function composition (multi-stage meta-prompting)&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;compose&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;T&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;f&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;x&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;T&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;T&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;g&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;x&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;T&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;T&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;x&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;T&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;g&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;f&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;x&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;improveAll&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;compose&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;improve1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;improve2&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="c1"&gt;// Run it&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;improvedPrompt&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;improveAll&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;userPrompt&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;ai&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;improvedPrompt&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  4. Practical Meta-Prompting Methods
&lt;/h2&gt;

&lt;h3&gt;
  
  
  4.1 Anthropic’s Prompt Generator
&lt;/h3&gt;

&lt;p&gt;Anthropic officially provides a &lt;a href="https://docs.claude.com/en/docs/build-with-claude/prompt-engineering/prompt-generator" rel="noopener noreferrer"&gt;Prompt Generator&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Key features:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Automatically incorporates Chain-of-Thought (reasoning steps)&lt;/li&gt;
&lt;li&gt;Separates data and instructions using XML tags&lt;/li&gt;
&lt;li&gt;Supports variables with Handlebars notation&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;The prompt generator is particularly useful as a tool for solving the "blank page problem" to give you a jumping-off point for further testing and iteration.&lt;br&gt;
— &lt;a href="https://docs.claude.com/en/docs/build-with-claude/prompt-engineering/prompt-generator" rel="noopener noreferrer"&gt;Anthropic Docs&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  4.2 Stanford/OpenAI Meta-Prompting
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://arxiv.org/abs/2401.12954" rel="noopener noreferrer"&gt;Meta-Prompting&lt;/a&gt;, published in January 2024 as a joint Stanford/OpenAI research project, proposes a more advanced approach.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Architecture:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flgsvpoh83ui9g36czbq7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flgsvpoh83ui9g36czbq7.png" alt=" " width="750" height="286"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Results (with a Python interpreter):&lt;/strong&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Baseline&lt;/th&gt;
&lt;th&gt;Improvement&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Standard prompt&lt;/td&gt;
&lt;td&gt;+17.1%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Expert (dynamic) prompt&lt;/td&gt;
&lt;td&gt;+17.3%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Multi-persona prompt&lt;/td&gt;
&lt;td&gt;+15.2%&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;em&gt;These numbers are averaged across tasks like Game of 24, Checkmate-in-One, Python Programming Puzzles, etc.&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  4.3 DSPy / TextGrad
&lt;/h3&gt;

&lt;p&gt;As more technical approaches, these frameworks are drawing attention:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://arxiv.org/pdf/2310.03714" rel="noopener noreferrer"&gt;DSPy&lt;/a&gt;&lt;/strong&gt;: Treats LLMs as modular components and optimizes prompts programmatically&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://arxiv.org/pdf/2406.07496" rel="noopener noreferrer"&gt;TextGrad&lt;/a&gt;&lt;/strong&gt;: Uses natural-language feedback as “text gradients” to iteratively improve prompts&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  5. Meta-Meta-Prompts: An Advanced Concept
&lt;/h2&gt;

&lt;h3&gt;
  
  
  5.1 Introducing the Idea
&lt;/h3&gt;

&lt;p&gt;If you extend meta-prompting, you get the concept of a &lt;strong&gt;meta-meta-prompt&lt;/strong&gt;: a “prompt for generating meta-prompts.”&lt;/p&gt;

&lt;h3&gt;
  
  
  5.2 Two Patterns
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Pattern A: Improve the normal prompt in multiple stages
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9s0oa26efqm69lm19eiv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9s0oa26efqm69lm19eiv.png" alt=" " width="749" height="98"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Mathematical expression:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;fn1&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;PromptImprover&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="cm"&gt;/* Instruction A */&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;fn2&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;PromptImprover&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="cm"&gt;/* Instruction B */&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;// Function composition&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;improvedPrompt&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;fn2&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;fn1&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;userPrompt&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;ai&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;improvedPrompt&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Essence&lt;/strong&gt;: Simple function composition—iterative prompt improvement.&lt;/p&gt;

&lt;h4&gt;
  
  
  Pattern B: Generate the &lt;em&gt;prompt improvement instructions&lt;/em&gt; themselves
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkw35vg4p8patgpeuqurb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkw35vg4p8patgpeuqurb.png" alt=" " width="738" height="99"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Mathematical expression:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Clearly define the type hierarchy&lt;/span&gt;
&lt;span class="kd"&gt;type&lt;/span&gt; &lt;span class="nx"&gt;Prompt&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;// Level 1: A function that improves a prompt&lt;/span&gt;
&lt;span class="kd"&gt;type&lt;/span&gt; &lt;span class="nx"&gt;PromptImprover&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;p&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;Prompt&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;Prompt&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;// Level 2: A function that improves a prompt-improver (meta-meta-prompt)&lt;/span&gt;
&lt;span class="kd"&gt;type&lt;/span&gt; &lt;span class="nx"&gt;ImproverImprover&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;f&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;PromptImprover&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;PromptImprover&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;// Level 3: In theory, even higher levels can exist&lt;/span&gt;
&lt;span class="kd"&gt;type&lt;/span&gt; &lt;span class="nx"&gt;MetaImproverImprover&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;g&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;ImproverImprover&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;ImproverImprover&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;// Example implementation&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;baseImprover&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;PromptImprover&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;p&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; 
  &lt;span class="nf"&gt;ai&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`Please structure this: &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;p&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;improverImprover&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;ImproverImprover&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;f&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c1"&gt;// Take an existing improver and return an enhanced improver&lt;/span&gt;
  &lt;span class="k"&gt;return &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;p&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;firstPass&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;f&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;p&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;ai&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`Please refine this improved result even further: &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;firstPass&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;};&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;

&lt;span class="c1"&gt;// Apply the meta-meta-prompt&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;enhancedImprover&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;improverImprover&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;baseImprover&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;improvedPrompt&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;enhancedImprover&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;userPrompt&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;ai&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;improvedPrompt&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Essence&lt;/strong&gt;: A hierarchy of higher-order functions. Each level is defined as “a function that improves functions one level below.”&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Level 0: Prompt                                 (value)
Level 1: Prompt → Prompt                         (PromptImprover)
Level 2: (Prompt → Prompt) → (Prompt → Prompt)   (ImproverImprover)
Level 3: ...                                     (higher levels)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  5.3 Practicality
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Pattern&lt;/th&gt;
&lt;th&gt;Practicality&lt;/th&gt;
&lt;th&gt;When to use&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Pattern A&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;High&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Complex tasks, tasks involving information gathering (e.g., “Plan mode” for AI coding assistance)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Pattern B&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;Medium&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Specialized domains where it’s hard to template improvement instructions&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  6. Implementation Examples and Tools
&lt;/h2&gt;

&lt;h3&gt;
  
  
  6.1 Anthropic Prompt Generator (Official)
&lt;/h3&gt;

&lt;p&gt;You can use it directly from Anthropic’s &lt;a href="https://console.anthropic.com/" rel="noopener noreferrer"&gt;Developer Console&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;You can also review the architecture in their &lt;a href="https://anthropic.com/metaprompt-notebook/" rel="noopener noreferrer"&gt;Google Colab notebook&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  6.2 OpenAI System Instruction Generator
&lt;/h3&gt;

&lt;p&gt;Available in OpenAI’s &lt;a href="https://platform.openai.com/playground" rel="noopener noreferrer"&gt;Playground&lt;/a&gt; (excluding the o1 model).&lt;/p&gt;

&lt;h3&gt;
  
  
  6.3 A Simple Implementation Example
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;anthropic&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;meta_prompt&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;user_task&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="sh"&gt;"""&lt;/span&gt;&lt;span class="s"&gt;
    Generate a task prompt using meta-prompting.
    &lt;/span&gt;&lt;span class="sh"&gt;"""&lt;/span&gt;
    &lt;span class="n"&gt;client&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;anthropic&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Anthropic&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

    &lt;span class="n"&gt;meta_instruction&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"""&lt;/span&gt;&lt;span class="s"&gt;
    Convert the following task description into a high-quality prompt.

    The prompt should include:
    1. A clear role definition
    2. A concrete task description
    3. The expected output format
    4. Constraints (if any)

    Task description:
    &lt;/span&gt;&lt;span class="sh"&gt;"""&lt;/span&gt;

    &lt;span class="c1"&gt;# Step 1: Generate the prompt
&lt;/span&gt;    &lt;span class="n"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;messages&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;create&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;claude-sonnet-4-20250514&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  &lt;span class="c1"&gt;# Check the official docs for the latest model name
&lt;/span&gt;        &lt;span class="n"&gt;max_tokens&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;1024&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;messages&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;
            &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;role&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;user&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;content&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;meta_instruction&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;user_task&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;content&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="n"&gt;text&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  📋 Disclaimer
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Important&lt;/strong&gt;: This article was created through dialogue with Claude, so it may contain mistakes.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  7. Summary
&lt;/h2&gt;

&lt;h3&gt;
  
  
  The Value of Meta-Prompting
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Efficiency&lt;/strong&gt;: Greatly reduces the time spent manually optimizing prompts&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Quality&lt;/strong&gt;: Structured, clarified prompts improve response accuracy&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Scalability&lt;/strong&gt;: Templates make it reusable across many tasks&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Recommended Approach
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsx92fas9krr29nyg85v3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsx92fas9krr29nyg85v3.png" alt=" " width="740" height="503"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Reference Resources
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://docs.claude.com/en/docs/build-with-claude/prompt-engineering/overview" rel="noopener noreferrer"&gt;Anthropic Prompt Engineering Docs&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://arxiv.org/abs/2401.12954" rel="noopener noreferrer"&gt;Meta-Prompting: Enhancing Language Models with Task-Agnostic Scaffolding (arXiv)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.prompthub.us/blog/a-complete-guide-to-meta-prompting" rel="noopener noreferrer"&gt;PromptHub: A Complete Guide to Meta Prompting&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://anthropic.com/metaprompt-notebook/" rel="noopener noreferrer"&gt;Anthropic Prompt Generator Google Colab&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;:::message alert&lt;br&gt;
&lt;strong&gt;Note&lt;/strong&gt;: Meta-prompting isn’t magic. For simple tasks, a normal prompt is often enough, and too much abstraction can backfire. Choose the right approach based on task complexity.&lt;br&gt;
:::&lt;/p&gt;

</description>
      <category>ai</category>
      <category>promptengineering</category>
      <category>functionalreactiveprogramming</category>
      <category>llm</category>
    </item>
    <item>
      <title>Deep Dive into the Latest GitHub Copilot Updates</title>
      <dc:creator>seiwan maikuma</dc:creator>
      <pubDate>Thu, 11 Dec 2025 14:30:54 +0000</pubDate>
      <link>https://forem.com/seiwan-maikuma/deep-dive-into-the-latest-github-copilot-updates-3pba</link>
      <guid>https://forem.com/seiwan-maikuma/deep-dive-into-the-latest-github-copilot-updates-3pba</guid>
      <description>&lt;p&gt;In VS Code November 2025 Insiders (v1.107), the GitHub Copilot agent features received a major upgrade.&lt;br&gt;&lt;br&gt;
This article walks through three particularly interesting &lt;strong&gt;experimental&lt;/strong&gt; features in detail.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Reference&lt;/strong&gt;: &lt;a href="https://code.visualstudio.com/updates/v1_107" rel="noopener noreferrer"&gt;VS Code Release Notes v1.107&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;


&lt;h2&gt;
  
  
  1. Running Agents as Subagents (Experimental)
&lt;/h2&gt;
&lt;h3&gt;
  
  
  What is a Subagent?
&lt;/h3&gt;

&lt;p&gt;A subagent (Context-Isolated Subagent) is a &lt;strong&gt;context-isolated autonomous agent&lt;/strong&gt; that can be invoked from within a main chat session.&lt;br&gt;&lt;br&gt;
It has its own context window independent from the main session and is well suited for complex multi-step tasks such as research and analysis.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Reference&lt;/strong&gt;: &lt;a href="https://code.visualstudio.com/docs/copilot/chat/chat-sessions#_contextisolated-subagents" rel="noopener noreferrer"&gt;Chat Sessions - Context-isolated subagents&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;


&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;┌────────────────────────────────────────────────────┐
│ Main Chat Session                                  │
│ ┌────────────────────────────────────────────────┐ │
│ │ User: Research best practices for auth,        │ │
│ │       then create an implementation plan       │ │
│ └────────────────────────────────────────────────┘ │
│                     ↓                              │
│ ┌────────────────────────────────────────────────┐ │
│ │ Subagent launched                              │ │
│ │ - Independent context window                   │ │
│ │ - Runs research via read-only tools            │ │
│ │ - Returns only the final result to main chat   │ │
│ └────────────────────────────────────────────────┘ │
│                     ↓                              │
│ ┌────────────────────────────────────────────────┐ │
│ │ Continue planning in the main session          │ │
│ │ (using the subagent’s research results)        │ │
│ └────────────────────────────────────────────────┘ │
└────────────────────────────────────────────────────┘
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Characteristics
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Property&lt;/th&gt;
&lt;th&gt;Details&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Context isolation&lt;/td&gt;
&lt;td&gt;Does not consume the main session’s context&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Autonomous execution&lt;/td&gt;
&lt;td&gt;Runs to completion &lt;strong&gt;without user feedback&lt;/strong&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Result handoff&lt;/td&gt;
&lt;td&gt;Only the final result is returned to the main session&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Tool access&lt;/td&gt;
&lt;td&gt;Inherits the same tools as the main session by default&lt;br&gt;&lt;strong&gt;Can specify its own toolset via custom agents&lt;/strong&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Model&lt;/td&gt;
&lt;td&gt;Uses the same AI model as the main session by default&lt;br&gt;&lt;strong&gt;Can use its own model via custom agents&lt;/strong&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Extension via experimental feature&lt;/strong&gt;:&lt;br&gt;
When the &lt;code&gt;chat.customAgentInSubagent.enabled&lt;/code&gt; setting is enabled, you can specify a different custom agent for a subagent.&lt;br&gt;
Because a custom agent can define its own &lt;code&gt;tools:&lt;/code&gt; and &lt;code&gt;model:&lt;/code&gt; properties, you can assign &lt;strong&gt;a specialized toolset and optimal AI model per subagent&lt;/strong&gt;. (Verified in practice by the author.)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Reference links&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://code.visualstudio.com/docs/copilot/chat/chat-sessions#_contextisolated-subagents" rel="noopener noreferrer"&gt;Official docs: Context-isolated subagents&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/microsoft/vscode/issues/275855" rel="noopener noreferrer"&gt;GitHub Issue #275855: Request for model selection per subagent&lt;/a&gt; – Community request to “explicitly specify different models for each subagent”&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.github.com/en/copilot/how-tos/use-copilot-agents/coding-agent/create-custom-agents" rel="noopener noreferrer"&gt;Model selection in custom agents&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  How to Use
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Enable the &lt;code&gt;runSubagent&lt;/code&gt; tool in the Tool Picker.&lt;/li&gt;
&lt;li&gt;In a prompt, explicitly instruct Copilot to run a subagent.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;&lt;span class="c"&gt;&amp;lt;!-- Example 1: Research task --&amp;gt;&lt;/span&gt;
Use a subagent to research authentication methods for web applications.
Summarize your findings.

&lt;span class="c"&gt;&amp;lt;!-- Example 2: Explicitly referencing #runSubagent --&amp;gt;&lt;/span&gt;
Use #runSubagent to comprehensively research the user’s task using read-only tools,
and once you reach 80% confidence, return the context needed for planning.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Combining with Custom Agents (Experimental)
&lt;/h3&gt;

&lt;p&gt;When &lt;code&gt;chat.customAgentInSubagent.enabled&lt;/code&gt; is enabled, you can have a subagent &lt;strong&gt;use a different custom agent&lt;/strong&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;&lt;span class="c"&gt;&amp;lt;!-- Run the "research" agent as a subagent --&amp;gt;&lt;/span&gt;
Run the research agent as a subagent
and investigate the best authentication methods for this project.

&lt;span class="c"&gt;&amp;lt;!-- Use the "plan" agent as a subagent to create a plan and save it to a file --&amp;gt;&lt;/span&gt;
Use the plan agent as a subagent to create an implementation plan for "myfeature"
and save it to plans/myfeature.plan.md.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Subagents vs Normal Agents
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Aspect&lt;/th&gt;
&lt;th&gt;Subagent&lt;/th&gt;
&lt;th&gt;Normal agent&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Execution host&lt;/td&gt;
&lt;td&gt;Inside the main session&lt;/td&gt;
&lt;td&gt;Separate session&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Context&lt;/td&gt;
&lt;td&gt;Isolated (efficient)&lt;/td&gt;
&lt;td&gt;Shared or fully independent&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;User feedback&lt;/td&gt;
&lt;td&gt;None (autonomous)&lt;/td&gt;
&lt;td&gt;Can request feedback as needed&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Result sharing&lt;/td&gt;
&lt;td&gt;Only returns the final result&lt;/td&gt;
&lt;td&gt;Full conversation history available&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Best suited for&lt;/td&gt;
&lt;td&gt;Research, analysis, subtasks&lt;/td&gt;
&lt;td&gt;Mainline development tasks&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  Why Subagents Matter: Solving the “Too Many Tools” Problem
&lt;/h2&gt;

&lt;h3&gt;
  
  
  More Tools ≠ Smarter Agents
&lt;/h3&gt;

&lt;p&gt;Research by the GitHub Copilot team shows that &lt;strong&gt;giving an agent too many tools can actually hurt performance&lt;/strong&gt;.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Reference&lt;/strong&gt;: &lt;a href="https://github.blog/ai-and-ml/github-copilot/how-were-making-github-copilot-smarter-with-fewer-tools/" rel="noopener noreferrer"&gt;How we're making GitHub Copilot smarter with fewer tools - GitHub Blog&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;VS Code’s GitHub Copilot Chat can access hundreds of tools via MCP.&lt;br&gt;
However, as the number of tools grows, the following issues appear:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Problem&lt;/th&gt;
&lt;th&gt;Details&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Response latency&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Tool selection reasoning becomes slower, adding 400ms+ on average&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Worse performance&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;2–5% lower success rate on the SWE-Lancer benchmark&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Wrong tool usage&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Ignores explicit instructions or calls unnecessary tools&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;API limit overrun&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Some models can exceed tool-related limits when too many tools exist&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;You may have seen a spinner like this in VS Code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;🔄 Optimizing tool selection...
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This appears while the model is trying to reason over a huge tool set.&lt;/p&gt;

&lt;h3&gt;
  
  
  GitHub’s Fix: Reduce the Tool Set
&lt;/h3&gt;

&lt;p&gt;(These are the states at the time of the GitHub blog above. With this VS Code update, additional changes have been made.)&lt;/p&gt;

&lt;p&gt;The GitHub team reduced the default 40 built-in tools down to &lt;strong&gt;13 core tools&lt;/strong&gt;.&lt;br&gt;
The remaining tools are grouped into “virtual tool groups” and expanded only when needed.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Core tool set (always available): 13 tools
├── Repository structure analysis
├── File read/write
├── Context search
└── Terminal operations

Virtual tool groups (expanded on demand):
├── Jupyter Notebook Tools
├── Web Interaction Tools
├── VS Code Workspace Tools
└── Testing Tools
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Results:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;TTFT (Time To First Token)&lt;/strong&gt;: ~190ms faster on average&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;TTLT (Time To Last Token)&lt;/strong&gt;: ~400ms faster on average&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  A New Approach with Subagents
&lt;/h3&gt;

&lt;p&gt;With subagents, we now get a &lt;strong&gt;new architecture&lt;/strong&gt; to tackle the too-many-tools problem.&lt;/p&gt;

&lt;h4&gt;
  
  
  Old Approach (Single Agent + Many Tools)
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;┌─────────────────────────────────────────┐
│ Main Agent                              │
│ ┌─────────────────────────────────────┐ │
│ │ Tools: 40+                         │ │
│ │ - File operations                  │ │
│ │ - Git commands                     │ │
│ │ - Web search                       │ │
│ │ - Databases                        │ │
│ │ - Test running                     │ │
│ │ - ... many more                    │ │
│ └─────────────────────────────────────┘ │
│ → Tool selection takes time              │
│ → Likely to pick the wrong tool          │
└─────────────────────────────────────────┘
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  New Approach (Orchestrator + Specialized Subagents)
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;┌─────────────────────────────────────────────────────┐
│ Main Agent (Orchestrator)                          │
│ ┌─────────────────────────────────────────────────┐ │
│ │ Tools: runSubagent only                        │ │
│ │ Model: Claude Sonnet 4.5 (copilot)             │ │
│ │        (for advanced reasoning)                │ │
│ └─────────────────────────────────────────────────┘ │
│                        ↓                            │
│    ┌───────────┬───────────┬───────────┬─────────┐ │
│    ↓           ↓           ↓           ↓         │ │
│ ┌──────┐  ┌──────┐  ┌──────┐  ┌──────┐          │ │
│ │Research││Impl.  ││Test   ││Git    │          │ │
│ │Agent   ││Agent  ││Agent  ││Agent  │          │ │
│ ├──────┤  ├──────┤  ├──────┤  ├──────┤          │ │
│ │Web   │ │File   │ │Test   │ │Git   │          │ │
│ │search│ │editing│ │running│ │ops   │          │ │
│ ├──────┤  ├──────┤  ├──────┤  ├──────┤          │ │
│ │Sonnet│ │Sonnet │ │Haiku  │ │Haiku │          │ │
│ │4.5   │ │4.5    │ │4.5    │ │4.5   │          │ │
│ └──────┘  └──────┘  └──────┘  └──────┘          │ │
│                                                     │
│ → Each agent has only the minimum tools it needs     │
│ → Tool calls are more accurate                       │
│ → The most suitable model can be chosen per task     │
│   (e.g. Sonnet for complex reasoning, Haiku for      │
│    simple repetitive work)                           │
└─────────────────────────────────────────────────────┘
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Concrete Implementation Example
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;&lt;span class="gh"&gt;&amp;lt;!-- Custom agent: research-agent.agent.md --&amp;gt;
---
&lt;/span&gt;name: research-agent
description: A research agent specializing in web search and information analysis
tools:
&lt;span class="p"&gt;  -&lt;/span&gt; web_search
&lt;span class="p"&gt;  -&lt;/span&gt; web_fetch
&lt;span class="gh"&gt;model: Claude Sonnet 4.5 (copilot)  # Needs strong analytical ability
---
&lt;/span&gt;
&lt;span class="gh"&gt;# Research Agent&lt;/span&gt;

You are an expert in information research and analysis.
Use web search extensively to conduct comprehensive research on technical topics.
...
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;&lt;span class="gh"&gt;&amp;lt;!-- Custom agent: test-agent.agent.md --&amp;gt;
---
&lt;/span&gt;name: test-agent
description: An agent specialized in generating and running tests
tools:
&lt;span class="p"&gt;  -&lt;/span&gt; codebase
&lt;span class="p"&gt;  -&lt;/span&gt; runTerminal
&lt;span class="gh"&gt;model: Claude Haiku 4.5 (copilot)  # Lightweight model is sufficient and faster for routine tasks
---
&lt;/span&gt;
&lt;span class="gh"&gt;# Test Agent&lt;/span&gt;

You are a test automation expert.
Analyze the existing codebase and generate appropriate unit tests.
...
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;&lt;span class="gh"&gt;&amp;lt;!-- Custom agent: orchestrator.agent.md --&amp;gt;
---
&lt;/span&gt;name: orchestrator
description: An orchestrator that analyzes tasks and delegates them to specialist agents
tools:
&lt;span class="p"&gt;  -&lt;/span&gt; runSubagent
&lt;span class="gh"&gt;model: Claude Sonnet 4.5 (copilot)  # Needs strong task decomposition and decision-making
---
&lt;/span&gt;
&lt;span class="gh"&gt;# Orchestrator Agent&lt;/span&gt;

You specialize in task analysis and delegation.
Analyze the user’s request and delegate appropriately to the following specialist agents:
&lt;span class="p"&gt;
-&lt;/span&gt; research-agent: Research and information gathering tasks (when web search is needed)
&lt;span class="p"&gt;-&lt;/span&gt; implementation-agent: Code implementation tasks
&lt;span class="p"&gt;-&lt;/span&gt; test-agent: Test generation and execution (routine work)
&lt;span class="p"&gt;-&lt;/span&gt; git-agent: Version control tasks

Do not write code or manipulate files directly.
Always delegate to the appropriate specialist agent.

Each agent has its own toolset and model,
optimized for the nature of its tasks.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Available models&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;Claude Sonnet 4.5 (copilot)&lt;/code&gt; – High-performance, well-balanced model&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;Claude Haiku 4.5 (copilot)&lt;/code&gt; – Fast, lightweight model&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;Claude Opus 4.5 (Preview) (copilot)&lt;/code&gt; – Top-tier performance (preview)&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;

&lt;p&gt;With this architecture:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Each agent’s toolset stays minimal&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Tool selection becomes more accurate&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Response time improves&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Toolsets can be tailored to each task domain&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cost efficiency&lt;/strong&gt;: Use Sonnet for complex reasoning, Haiku for routine tasks to optimize token usage&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Performance&lt;/strong&gt;: Choosing a model based on task complexity avoids unnecessary overhead&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  2. Isolating Background Agents with Git Worktrees
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Background and Challenges
&lt;/h3&gt;

&lt;p&gt;Background agents (Copilot CLI, OpenAI Codex, etc.) are designed to run tasks autonomously while you work in the editor.&lt;br&gt;
Traditionally, their changes were applied directly to the workspace, which caused several problems:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Conflicts with files currently being edited by the user&lt;/li&gt;
&lt;li&gt;Inability to safely run multiple background agents at once&lt;/li&gt;
&lt;li&gt;Difficult to safely review and roll back the agent’s changes&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Reference&lt;/strong&gt;: &lt;a href="https://code.visualstudio.com/docs/copilot/agents/background-agents" rel="noopener noreferrer"&gt;Background Agents in VS Code&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h3&gt;
  
  
  Solution: Git Worktrees
&lt;/h3&gt;

&lt;p&gt;Git Worktrees are a Git feature that lets you create multiple working trees from the same repository.&lt;br&gt;
In v1.107, VS Code automatically creates an independent worktree for each background agent session, providing complete isolation.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Reference&lt;/strong&gt;: &lt;a href="https://code.visualstudio.com/docs/sourcecontrol/branches-worktrees" rel="noopener noreferrer"&gt;Branches &amp;amp; Worktrees - VS Code Source Control&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h4&gt;
  
  
  How It Works
&lt;/h4&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Main Workspace: /project/main
├── src/
├── package.json
└── ...

Background-agent Worktree: /project/.worktrees/session-abc123
├── src/           # Agent makes changes here
├── package.json
└── ...
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;All files created or modified by the agent live under the worktree folder, so the main workspace remains untouched.&lt;/p&gt;
&lt;h4&gt;
  
  
  How to Use
&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;From the Chat view, select &lt;strong&gt;“New Background Agent”&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;For &lt;strong&gt;Isolation mode&lt;/strong&gt;, choose &lt;strong&gt;“Worktree”&lt;/strong&gt; (the default is “Workspace”).&lt;/li&gt;
&lt;li&gt;Enter a prompt to start the agent session.
&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;┌─────────────────────────────────────┐
│  Isolation mode: [Worktree ▼]       │
│  ┌─────────────────────────────────┐│
│  │ Worktree  ← isolated mode       ││
│  │ Workspace ← direct changes      ││
│  └─────────────────────────────────┘│
└─────────────────────────────────────┘
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h4&gt;
  
  
  Benefits
&lt;/h4&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Aspect&lt;/th&gt;
&lt;th&gt;Worktree mode&lt;/th&gt;
&lt;th&gt;Workspace mode&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Safety&lt;/td&gt;
&lt;td&gt;High (fully isolated)&lt;/td&gt;
&lt;td&gt;Low (direct changes)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Parallel run&lt;/td&gt;
&lt;td&gt;Possible&lt;/td&gt;
&lt;td&gt;Risk of conflicts&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Review&lt;/td&gt;
&lt;td&gt;Easy via diffs&lt;/td&gt;
&lt;td&gt;Changes are applied directly&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Rollback&lt;/td&gt;
&lt;td&gt;Delete worktree and done&lt;/td&gt;
&lt;td&gt;Requires Git revert&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;
&lt;h4&gt;
  
  
  Merging Changes
&lt;/h4&gt;

&lt;p&gt;When the agent finishes its task, you can bring its changes into the main branch via:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;“Apply Changes” button&lt;/strong&gt; – Apply worktree changes directly into the main branch.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Git operations&lt;/strong&gt; – Merge or cherry-pick as with any normal branch.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Source Control view&lt;/strong&gt; – Use the Repositories view to inspect the worktree and review diffs.&lt;/li&gt;
&lt;/ol&gt;


&lt;h2&gt;
  
  
  3. Integrating Custom Agents with Background Agents (Experimental)
&lt;/h2&gt;
&lt;h3&gt;
  
  
  What Are Custom Agents?
&lt;/h3&gt;

&lt;p&gt;Custom agents let you define specialized AI assistants for particular roles or tasks.&lt;br&gt;
They are configured in Markdown files, where you specify:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Persona (e.g. DBA specialist, frontend developer)&lt;/li&gt;
&lt;li&gt;Available tools&lt;/li&gt;
&lt;li&gt;Preferred language model&lt;/li&gt;
&lt;li&gt;Guidelines and instructions&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Reference&lt;/strong&gt;: &lt;a href="https://code.visualstudio.com/docs/copilot/customization/custom-agents" rel="noopener noreferrer"&gt;Custom Agents - VS Code Copilot Customization&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h3&gt;
  
  
  Using Them in Background Agents
&lt;/h3&gt;

&lt;p&gt;Previously, custom agents were only available in local chat sessions within VS Code.&lt;br&gt;
With the v1.107 experimental feature, you can now &lt;strong&gt;assign custom agents to background agent sessions&lt;/strong&gt; as well.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Reference&lt;/strong&gt;: &lt;a href="https://code.visualstudio.com/docs/copilot/agents/background-agents#_use-custom-agents-with-background-agents-experimental" rel="noopener noreferrer"&gt;Use custom agents with background agents&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h4&gt;
  
  
  Configuration
&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;Enable the feature in settings:
&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="w"&gt;   &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
     &lt;/span&gt;&lt;span class="nl"&gt;"github.copilot.chat.cli.customAgents.enabled"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="w"&gt;
   &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ol&gt;
&lt;li&gt;Create a custom agent in your workspace:
&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;   &lt;span class="c"&gt;&amp;lt;!-- .github/agents/code-reviewer.agent.md --&amp;gt;&lt;/span&gt;
&lt;span class="p"&gt;   ---&lt;/span&gt;
   name: code-reviewer
   description: A code review expert focused on security and performance
   tools:
&lt;span class="p"&gt;     -&lt;/span&gt; codebase
&lt;span class="p"&gt;     -&lt;/span&gt; textSearch
&lt;span class="p"&gt;   ---
&lt;/span&gt;
   # Code Reviewer Agent

   You are an expert in security and performance.
   During code review, focus especially on:
&lt;span class="p"&gt;   -&lt;/span&gt; Vulnerabilities such as SQL injection and XSS
&lt;span class="p"&gt;   -&lt;/span&gt; Performance issues like N+1 queries
&lt;span class="p"&gt;   -&lt;/span&gt; Proper error handling
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ol&gt;
&lt;li&gt;When creating a background agent session, select the custom agent:
&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzztvczip9nycr9qs5dzu.png" alt=" " width="355" height="229"&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h3&gt;
  
  
  Example Use Cases
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Custom agent&lt;/th&gt;
&lt;th&gt;Background task&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Code reviewer&lt;/td&gt;
&lt;td&gt;Security audit of an entire PR&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Test engineer&lt;/td&gt;
&lt;td&gt;Generating test cases for new features&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Documenter&lt;/td&gt;
&lt;td&gt;Automatic API documentation generation&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Refactoring expert&lt;/td&gt;
&lt;td&gt;Modernizing legacy code&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;
&lt;h3&gt;
  
  
  Combining with Git Worktrees
&lt;/h3&gt;

&lt;p&gt;By combining custom agents with worktree isolation, you can fully control &lt;strong&gt;who (which persona) does what, and where (in a separate environment)&lt;/strong&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;┌─────────────────────────────────────────────────────┐
│ Background agent session                            │
│                                                     │
│ Agent:     [code-reviewer]  ← Custom agent          │
│ Isolation: [Worktree]       ← Isolated mode         │
│ Task:      "Run a security review on this PR"       │
│                                                     │
│ → Specialized review                                │
│ → In a safe, isolated environment                   │
│ → Runs autonomously in the background               │
└─────────────────────────────────────────────────────┘
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Notes on Tool Compatibility Across Environments
&lt;/h2&gt;

&lt;p&gt;Custom agents can run in three main environments:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;VS Code (GitHub Copilot Chat)&lt;/strong&gt; – Interactive local IDE experience&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;GitHub.com (Copilot coding agent)&lt;/strong&gt; – Cloud-side background execution&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;GitHub Copilot CLI&lt;/strong&gt; – Command-line usage from the terminal&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The same &lt;code&gt;.agent.md&lt;/code&gt; definition can be shared across these environments, but &lt;strong&gt;supported tools and settings differ per environment&lt;/strong&gt;.&lt;br&gt;
In particular, some tools are specific to VS Code and unavailable on GitHub.com or in the CLI.&lt;br&gt;
Unsupported tools or properties are simply ignored.&lt;/p&gt;

&lt;p&gt;Because of this, behavior may differ depending on where the agent runs.&lt;br&gt;
For example, an agent that works perfectly inside VS Code might run in a partially degraded mode on GitHub.com if certain tools are not available.&lt;/p&gt;

&lt;p&gt;Custom agents are evolving rapidly, and supported properties and tools may change over time.&lt;br&gt;
Check the latest official docs for details:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Reference links&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://docs.github.com/en/copilot/reference/custom-agents-configuration" rel="noopener noreferrer"&gt;Custom agents configuration - GitHub Docs&lt;/a&gt; – Configuration properties and tool reference&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://docs.github.com/en/copilot/concepts/agents/coding-agent/about-custom-agents" rel="noopener noreferrer"&gt;About custom agents - GitHub Docs&lt;/a&gt; – Concept and basic usage&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://code.visualstudio.com/docs/copilot/customization/custom-agents" rel="noopener noreferrer"&gt;Custom agents in VS Code&lt;/a&gt; – VS Code–specific features and settings&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.blog/changelog/2025-10-28-custom-agents-for-github-copilot/" rel="noopener noreferrer"&gt;Custom agents for GitHub Copilot - GitHub Changelog&lt;/a&gt; – Feature announcement and latest updates&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/github/awesome-copilot" rel="noopener noreferrer"&gt;awesome-copilot&lt;/a&gt; – Community-maintained examples of custom agents&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  📋 Disclaimer
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Important&lt;/strong&gt;: This article was created through a conversation with Claude, and may contain inaccuracies in the following areas:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Exact setting and property names (such as &lt;code&gt;chat.customAgentInSubagent.enabled&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;Syntax used in custom agent implementation examples&lt;/li&gt;
&lt;li&gt;Existence and numbers of GitHub Issues or reference links&lt;/li&gt;
&lt;li&gt;Details of experimental features&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Always verify the latest information using the official resources below:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://code.visualstudio.com/updates/v1_107" rel="noopener noreferrer"&gt;VS Code Release Notes v1.107&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.github.com/en/copilot/reference/custom-agents-configuration" rel="noopener noreferrer"&gt;Custom agents configuration - GitHub Docs&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://code.visualstudio.com/docs/copilot" rel="noopener noreferrer"&gt;VS Code Copilot Documentation&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;p&gt;The GitHub Copilot updates in VS Code v1.107 push toward a balance between &lt;strong&gt;agent autonomy&lt;/strong&gt; and &lt;strong&gt;developer control&lt;/strong&gt;.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Feature&lt;/th&gt;
&lt;th&gt;Value&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Subagents&lt;/td&gt;
&lt;td&gt;Efficient context management and a solution to the “too many tools” problem&lt;br&gt;&lt;strong&gt;Per-task tools &amp;amp; models&lt;/strong&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Git Worktree isolation&lt;/td&gt;
&lt;td&gt;Safe parallel execution of background agents&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Integration with custom agents&lt;/td&gt;
&lt;td&gt;Specialized background tasks with tailored personas and tools&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;In particular, the &lt;strong&gt;orchestration pattern with subagents&lt;/strong&gt; offers a promising architectural answer to tool overload.&lt;br&gt;
By giving each specialist agent only the minimal toolset it needs, you can expect faster and more accurate behavior, consistent with the GitHub team’s findings.&lt;/p&gt;

&lt;p&gt;Moreover, combining subagents with custom agents lets you &lt;strong&gt;assign an independent model to each subagent&lt;/strong&gt;, enabling advanced optimizations:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Cost efficiency&lt;/strong&gt;: Use Sonnet for complex reasoning, Haiku for routine work&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Latency improvements&lt;/strong&gt;: Choose models based on task complexity&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Higher specialization&lt;/strong&gt;: Tailor the model–tool combination to each domain&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;All of these features are still &lt;strong&gt;experimental&lt;/strong&gt;, and will likely evolve based on user feedback.&lt;br&gt;
If you’re on the Insiders build, it’s a good time to experiment and send feedback to the GitHub repositories.&lt;/p&gt;




&lt;h2&gt;
  
  
  Reference Links
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://code.visualstudio.com/updates/v1_107" rel="noopener noreferrer"&gt;VS Code Release Notes v1.107&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://code.visualstudio.com/docs/copilot/chat/chat-sessions#_contextisolated-subagents" rel="noopener noreferrer"&gt;Chat Sessions - Context-isolated subagents&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://code.visualstudio.com/docs/copilot/agents/background-agents" rel="noopener noreferrer"&gt;Background Agents in VS Code&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://code.visualstudio.com/docs/copilot/customization/custom-agents" rel="noopener noreferrer"&gt;Custom Agents Documentation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://code.visualstudio.com/docs/copilot/customization/overview" rel="noopener noreferrer"&gt;Customization Overview&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.blog/ai-and-ml/github-copilot/how-were-making-github-copilot-smarter-with-fewer-tools/" rel="noopener noreferrer"&gt;How we're making GitHub Copilot smarter with fewer tools - GitHub Blog&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>ai</category>
      <category>githubcopilot</category>
      <category>vscode</category>
    </item>
  </channel>
</rss>
