TRENDING NOW  ·  Loading date… Top 10  ·  How-To  ·  Comparisons  ·  AI Prompts  ·  Guides

NextGenAIVibe

LIVE
Loading latest headlines…

How to Use MAI Code 2 in GitHub Copilot in 2026: Step-by-Step Guide

Microsoft has a new coding model in GitHub Copilot, and it changes how the assistant handles serious engineering work. MAI Code 2 and its lighter sibling, MAI Code 2 Flash, became generally available in GitHub Copilot on 17 November 2026, announced during Microsoft Ignite 2026. Where the first MAI coding models were built for quick completions and short explanations, Code 2 is designed for agentic software engineering: planning a change, working across several files, debugging a stubborn fault and refactoring a whole section of a codebase.

This guide walks you through using MAI Code 2 in GitHub Copilot step by step: checking whether your plan includes it, finding it in the model picker, choosing between Code 2 and Code 2 Flash, running a proper plan-then-build workflow, and keeping an eye on usage-based billing. Everything here is based on GitHub's own changelog and the Ignite announcements, so the steps match what is actually live today.

What Is MAI Code 2?

MAI Code 2 is Microsoft's second-generation AI coding model, part of the Microsoft AI (MAI) family that the company is building as an alternative to relying entirely on models from other providers. GitHub describes the release as a major step forward for the MAI-Code family, expanding it from lightweight coding assistance to complex, agentic software engineering. In plain terms, the model is meant to take on work that spans more than one file and more than one step: understanding a repository, forming a plan, making coordinated edits and checking its own work.

It arrives alongside MAI Code 2 Flash, a faster, lighter model for everyday jobs. The two are designed to be used together rather than treated as rivals. A typical session starts with Code 2 doing the thinking and ends with Flash doing the typing, a pattern GitHub itself demonstrated in its launch video: the presenter selected MAI Code 2, asked it to plan a small game, reviewed the plan it produced, then switched to MAI Code 2 Flash to implement it.

MAI Code 2 vs MAI Code 2 Flash

The difference between the two models is the trade-off between depth and speed. MAI Code 2 is aimed at deep debugging, changes across multiple files, refactoring and reasoning across an entire code repository. MAI Code 2 Flash is the lightweight option for explanations, targeted edits, routine fixes and rapid iteration. If a task needs the model to hold a large amount of context in mind and reason about how parts of a system fit together, Code 2 is the right pick. If you already know what needs changing and just want it done quickly, Flash is the faster and cheaper route.

Both models are billed under usage-based billing in GitHub Copilot, so the model you choose affects what a session costs. That makes the habit of starting with a plan and switching to Flash for implementation genuinely useful, not just tidy: you pay for heavy reasoning only where it earns its keep.

Who Can Use MAI Code 2?

Availability depends on your Copilot plan. MAI Code 2 is available on Copilot Pro, Pro+, Max, Business and Enterprise. MAI Code 2 Flash is available on those plans and also on Copilot Free and Student. Both models are available to eligible subscribers on annual plans, according to GitHub's changelog.

One detail matters for Free and Student users: those plans do not get a manual model picker, so they reach models through Copilot's Auto routing rather than selecting MAI Code 2 Flash by name. Paid subscribers get the picker and can choose either model directly. If you are on a Business or Enterprise plan, your administrator controls model access through the model policy in Copilot settings. Under GitHub's default model-enablement setting, new models are switched on automatically unless an administrator has turned off the global default or explicitly disabled the model, so in most organisations Code 2 should simply appear in the picker without an admin having to do anything.

How to Use MAI Code 2 in GitHub Copilot: Step-by-Step Guide

Follow these eight steps to go from a blank editor to a working change built with MAI Code 2.

Step 1: Check Your Copilot Plan and Eligibility

Before you open the picker, confirm you are on a plan that includes MAI Code 2. Individual developers need Copilot Pro, Pro+ or Max; organisations need Business or Enterprise. Both models require an eligible subscription on an annual plan, and billing is usage-based, so check your plan page in GitHub settings if you are unsure. If you are on Copilot Free or Student, you will not see MAI Code 2 in the picker, but you can still use MAI Code 2 Flash through Auto routing. If you are on a work account and the model is missing, ask your administrator whether the MAI models are enabled in the Copilot model policy, since an explicit disable at organisation level overrides the default automatic enablement.

Step 2: Update Your Editor to the Latest Version

MAI Code 2 is available across GitHub Copilot's development tools: Visual Studio Code, Visual Studio, the Copilot CLI, the Copilot cloud agent, the Copilot app, github.com, GitHub Mobile for iOS and Android, JetBrains IDEs, Xcode and Eclipse. Update your editor or Copilot extension to the latest version before you start, because the model list in the picker is tied to the version you are running. In VS Code, check the Extensions view for updates to the GitHub Copilot and GitHub Copilot Chat extensions; in Visual Studio, use the installer to bring the IDE up to date. If the model still does not appear after updating, sign out of Copilot and back in, which forces the extension to refresh its model list.

Step 3: Open Copilot Chat and Find the Model Picker

Open Copilot Chat in your editor. In VS Code, click the Chat icon in the activity bar or choose View and then Chat; in Visual Studio, open the Copilot Chat pane from the View menu. At the top of the chat pane you will see the model picker, which shows the model currently selected for the conversation. Click it to open the full list of models available on your plan. Paid subscribers can pin frequently used models so they stay at the top of the picker, which is worth doing once you settle on a favourite.

Step 4: Select MAI Code 2 from the Picker

In the model picker, find and select MAI Code 2. The entry may appear with a variant suffix, as in GitHub's own demonstration where the presenter selected MAI-Code-2-x1, but the name to look for is MAI Code 2. Selecting it applies to the current chat session, so you can switch models between conversations without changing any global setting. If you only need a quick explanation or a small edit, select MAI Code 2 Flash instead and save the heavier model for work that justifies it. Remember that the picker is per conversation: starting a new chat resets the choice, so check the picker each time you begin a fresh task.

Step 5: Plan First, Then Build

The most effective way to use MAI Code 2 is the plan-then-build pattern that GitHub demonstrated at launch. Start by describing the outcome you want and ask the model to produce a plan before it writes any code. In Copilot's agent mode, the model will ask clarifying questions about the details, just as it did in the launch demo when it asked about gameplay mechanics and cover art before building a small game. Review the plan it produces, correct anything it misunderstood, and only then tell it to implement. This extra minute of review catches misunderstandings early, when they cost a sentence to fix rather than a broken build. For large changes, ask the model to break the work into small steps and confirm each one before moving on.

Step 6: Switch to Flash for Implementation and Quick Edits

Once the plan is agreed, switch the model picker to MAI Code 2 Flash for the implementation pass. Flash is built for exactly this: following an existing plan, making targeted edits, fixing routine errors and iterating quickly. Because both models are billed on usage, doing the heavy reasoning once with Code 2 and the bulk of the typing with Flash keeps the cost of a session down. The same switch works in reverse during debugging: if Flash gets stuck on a fault, switch back to Code 2 and ask it to reason about the failure across the whole repository. Treat the two models as a team with different strengths rather than as two versions of the same tool.

Step 7: Try Copilot Fusion for Automatic Model Routing

If choosing a model for every task feels like overhead, try Copilot Fusion, which GitHub expanded at Ignite 2026. Fusion is a router and orchestrator rather than a single model: you select it in the model picker, set an effort level, and it chooses and coordinates the models for the task. Standard selects one model for everyday work, while High and Max can spend additional time and AI credits on model coordination. MAI Code 2 sits in the Fusion Standard pool, and the expanded pool also adds Claude Sonnet 5.5 to Fusion Max and GPT-6.1 Terra to Fusion High. Fusion is billed for the models it uses, with no separate Fusion charge, and GitHub is currently offering paid subscribers a 30 percent discount on model costs through 30 November 2026. Fusion reached Visual Studio and the GitHub.com and GitHub Mobile beta apps as part of the same Ignite announcement.

Step 8: Review, Test and Commit the Changes

Never accept an AI-generated change without reading it. Review the diff the model produced, run your tests, and check that the change does what the plan promised. MAI Code 2 is good at reasoning across a repository, but it can still misunderstand a requirement or introduce a subtle regression, and agentic sessions that touch several files deserve a careful review precisely because they touch so much. If a test fails, paste the failure back into the chat and let the model fix it; this debugging loop is one of the jobs Code 2 is specifically built for. Only commit once the tests pass and you understand every change in the diff.

MAI Code 2 vs MAI Code 2 Flash: Which Should You Pick?

Use MAI Code 2 when the task is open-ended or spans a system: debugging a fault you cannot localise, refactoring a module, adding a feature that touches several files, or understanding an unfamiliar codebase. Use MAI Code 2 Flash when the task is bounded and clear: explaining a function, fixing a named error, writing a small utility, or applying a change you have already designed. A useful rule is to ask yourself whether the model needs to discover the answer or merely execute it. Discovery belongs to Code 2; execution belongs to Flash. If you are unsure, start with Code 2 and the plan step will quickly tell you whether the heavy model was needed.

Tips for Getting the Best Results from MAI Code 2

Good results with an agentic coding model come from good instructions. Give the model the goal and the constraints, not just the task: mention the language and framework, the files involved, the behaviour you expect, and anything it must not change. Keep each request focused on one outcome, and break large features into smaller requests that you can review one at a time. Point the model at the relevant code rather than assuming it will find it, and paste error messages in full instead of summarising them. Ask for tests alongside the code, and ask the model to explain any change you do not understand before you commit it. Finally, remember that the model works best when the repository is in a clean state: commit your own work first, so the AI's diff is easy to review on its own.

Pricing and Billing: What to Know

Both MAI Code 2 and MAI Code 2 Flash use usage-based billing inside GitHub Copilot, and both are available to eligible subscribers on annual plans. GitHub has not published a single flat price for the models, because the cost of a session depends on how much work the model does. The practical consequence is that model choice is also a cost choice: Code 2 for the reasoning-heavy parts of a task and Flash for the rest. Administrators on Business and Enterprise plans can manage which MAI models their organisation can use through the Copilot model policy, and paid subscribers currently get a 30 percent discount on model costs through 30 November 2026. Check GitHub's Copilot models and pricing page for the latest rates before running a large agentic session, since pricing for new models can change in the first weeks after launch.

What Happens Next for MAI Code 2

MAI Code 2 is part of a much larger push. At the same Ignite event, Microsoft introduced a whole family of specialised MAI models covering coding, cybersecurity, images and speech, including MAI Image 2.7 and Flash for image generation and Cyber 2 Flash for security-agent workflows. The models are also available in Microsoft Foundry, and enterprises can access the model weights through MAI Licensed Weights to customise them with proprietary data, deployed within Azure. The direction is clear: Microsoft wants its own models to be a first-class choice inside Copilot, not just an alternative in the picker. For developers, the immediate next step is simpler: try Code 2 on a real task, compare it with the Claude and GPT models already in the picker, and see where it earns a permanent place in your workflow.

Frequently Asked Questions

Is MAI Code 2 free to use?

MAI Code 2 itself requires a paid Copilot plan: Pro, Pro+, Max, Business or Enterprise. MAI Code 2 Flash is also available on Copilot Free and Student, although those plans reach it through Auto routing rather than a manual picker. Both models use usage-based billing.

Which editors support MAI Code 2?

Visual Studio Code, Visual Studio, the Copilot CLI, the Copilot cloud agent, the Copilot app, github.com, GitHub Mobile on iOS and Android, JetBrains IDEs, Xcode and Eclipse.

Does MAI Code 2 replace Claude and GPT models in Copilot?

No. It joins them in the model picker as another option, and Copilot Fusion can route between MAI Code 2, Claude Sonnet 5.5, GPT-6.1 Terra and others depending on the task and the effort level you choose.

What is the difference between MAI Code 2 and MAI Code 1?

MAI Code 2 is the next generation of the family. Where the first MAI coding models were aimed at lightweight assistance, Code 2 is built for complex, agentic software engineering across a whole repository, with Flash handling the quicker jobs.

Can I use MAI Code 2 with Copilot Fusion?

Yes. MAI Code 2 is part of the Fusion Standard model pool. Select Copilot Fusion in the model picker, choose an effort level, and Fusion will route suitable tasks to MAI Code 2 automatically.

MAI Code 2 is the most capable coding model Microsoft has shipped inside Copilot, and the plan-then-build workflow is the key to getting value from it: let Code 2 think, let Flash type, and review everything before you commit. If you write code for a living, it is worth an afternoon of your time to try it on a real task this week. For more on Microsoft's AI push, read our guide to using Microsoft Agent 365 and our Gemini Tasks step-by-step guide, and see how the newest models compare in Claude Fable 5.2 vs GPT-6.2 Astra.

#MAICode2 #GitHubCopilot #AICoding #MicrosoftAI #CodingTools

Sponsored

Comments (0)

Blog Archive

Powered by Blogger.

How to Use AnythingLLM in 2026: 7 Steps

AnythingLLM is an all-in-one AI application for turning documents and other resources into context that a large language model can use dur...