đŚ Iâve been writing these weekly Copilot posts since June and itâs been great⌠but (of course there has to be a âbutâ) I feel like I've hit a wall on topics. Maybe I could poke at the new CLI (seems unimpressive so far), maybe Iâd wait out the rate limits and finally wrestle with Codex, I might even take a week or two off. Then someone asked a new question and I realizedânope. None of that is happening, at least not yet.
Iâve covered pretty much every major Copilot angle except this one: chat modes. Iâve been dropping random asides about them for weeks while studiously avoiding a full post. Well, I guess timeâs up. Chat modes are the last trick in the setâthe third and final way to shape Copilot without breaking it. At least, Iâm gonna try to explain my thought process in a way that makes sense to someone who isnât already living inside my head.
And while weâre here, current me is once again making promises that future me will probably regretânext week Iâll show you how to put your shiny new chat mode to work. Spoiler: youâll want VS Code (or Insiders) installed before then.
What are Chat Modes? đ¤
You can thank my friends at work for asking me this question directly, or I mightâve successfully dodged this post entirely. I donât think I even answered in the momentâI spun into a whirlwind of deep thought and then sprinted back to whatever I was supposed to be doing after some undetermined amount of time I spent over-thinking Copilot. đ
Iâve thought about writing this up several times, but after a couple of false starts I started actively avoiding it. Oneâitâs highly specific. Twoâitâs the hardest of my Copilot approaches to explain in a way that doesnât sound made up. Which⌠is fair, because I did make a lot of it up for my own workflows.
Before we dig into my thought process, letâs take inventory of the âofficialâ GitHub story.
Conveniently, GitHub doesnât mention chat modes at all (at least not anywhere I could find). Why? No clue! They do exist, though, and theyâre a visible part of GitHubâs own awesome-copilot repo. After some digging, I landed on VS Codeâs explanationâwhich at least proves theyâre real:
How I Explain It, Instead đ
There are three unique ways to shape how Copilot behaves, and Iâve already written whole series on the first two:
Instructions â These are your foundation. They ground Copilot in a methodology or approach, almost like a README for AI that explains how to behave. If you want to see the full breakdown, check out my Everything I Know About GitHub Copilot Instructions series.
Reusable prompts â These are your recipes, a full printout of step-by-step directions that break a complex task into smaller manageable pieces. Theyâre the âdo these parts in this order to reach a specific goalâ instructions I covered in my Everything You Wanted to Know About Reusable (and Experimental) Prompts series.
Chat modes â These are your characters. Itâs the agentâs state of being, and it can combine both instructions and reusable prompts into a larger directive. Give the same task to two different characters and youâll get two very different resultsâboth technically correct, but not even remotely the same.
đŚ Nobody expects House to solve a problem like Daenerys Targaryen. If you hand them the same problem, youâll get two wildly different outcomesâboth accurate and valid, neither boring.
Build From Scratch đ ď¸
I mostly follow my PRIOR model for these, the exact same one I use for all prompts in general. The order doesnât matter nearly as much as keeping things logical and cutting anything that doesnât apply.
Also, donât misunderstand. Iâm not saying order never mattersâbecause sometimes it absolutely does. What Iâm trying to say is worry less about how the steps look on the page and more about the substance youâre feeding into them. As long as it makes sense to you, then it will most likely make sense to Copilot, too.
đŚ You can paint like Picasso or carve like Michelangeloâboth masterpieces, completely different processes. The point isnât which steps you followed, itâs whether what you built holds up as art.
Frontmatter đ
Remember that a chat mode is essentially a character sheet for Copilot to use every time it completes a task with that costume on. The YAML frontmatter helps define exactly what that task looks like and identifies all the tools your agent will be able to access in that mode.
---
description: |
Automates secure, structured, and centralized logging implementation and reviews across your codebase, wielding JSON like a switchblade and enforcing structured readability like a made man.
model: claude-sonnet-4
tools:
- search
- editFiles
- readFiles
- runInTerminal
- runTests
- findTestFiles
---
đĄ ProTip: If you leave the
model
definition out of the frontmatter, then the model selected in the user's dropdown will be the default selection. A lot of people will leave these blank intentionally so the user can pick, but other times it's beneficial to limit this to a very specific model instead.
Persona đ
This is your chance to really have some fun with Copilot. Want a sleek vampire voice or iZombie-style debugging? Go for it! Some people complain that personas waste context space or distract from the goal. My counter: you can define a character in under fifty tokens, you can absolutely make this a logical part of the goal, and honestlyânobody wants a boring Copilot.
đŚ Well, I donât want a boring Copilot! Even my âpragmatistâ mode has dry wit baked inâand itâs supposed to be the quiet one.
A persona should define everything about a character, including moods, style, and a reason to exist. If you only tell it how to respond then youâll end up with a simple tone. But if you tell it why it exists and give it a driving force, youâll see the real usefulness. Tone becomes a quick addition to steer the dialog.
đŞ Voila! Suddenly your Copilot isnât just wearing a costumeâit knows why it walked on stage in the first place.
- You are **The Logfather** â the quiet but commanding force of logging order.
- You're confident, unshakeable, and precise.
- You enforce structure, security, and clarity without touching business logic.
- Every log has a place, every level a purpose.
- Your job is to clean up logging across the codebase without rewriting the soul of the app.
- You like your logs structured, injected, and environment-aware.
- And if someone tries to sneak in an unstructured debug print? Fuhgeddaboudit.
đĄ ProTip: Skip all the over-inflated titles (âexpert,â âexperienced,â â10x,â etc.). They do nothing to change the modelâs trainingâbut they absolutely shape the confidence level of every response you get.
Requirements đ
This is your definition of done. How does the actor know when the job is finished? Maybe itâs once a specific output appears; maybe itâs an ongoing mission. Either way, spell it out.
For the Logfather, the job is to help with enterprise-ready structured logs in any languageâand even scaffold centralized logging if your repo hasnât adopted that practice yet.
Your goals include:
- Detect and fix poor logging practices (e.g., wrong levels, missing logs, noisy debug prints)
- Insert or upgrade structured logging using appropriate libraries per language
- Ensure logging setup is centralized and DI-compliant (if possible)
- Verify that logging levels are configurable via environment, not static config
- Provide a clear, concise summary of the changes
Impediments â
This is where you call out what will trip Copilot up or drag results off-course. For the Logfather, that means zero changes to business logicâits one job has nothing to do with rewriting code or tests.
Guidance like RFC 2119 (MAY / SHOULD / MUST, and all their bossy friends) is controversial. My advice is to use it carefully. Donât flood your instructions with absolutes unless youâve thoroughly tested how Copilot reacts. Sometimes they save you; other times they back you into a corner you never meant to be in. Use them when they truly add value, be strategic, and remember that flexibility often delivers better, more consistent results.
- NEVER alter or refactor application logic outside of logging concerns
- AVOID inserting logs globally unless explicitly told to
- MUST respect the userâs scoped intent (default to most valuable module or path, if unclear)
- MUST maintain compatibility with existing test suites (update mocks as needed but AVOID logic changes)
đŚ Iâm using them here because, in this limited context, it made sense and test results were good. Also know, it once took me three days to realize
EXCEPT
does not always do what you think it does. If an agent misbehaves, do yourself a favor and stop for a minute. Ask it why. A decent model can explain its reasoning and then jump right back into the work once the instructions align with the goal again.
Outcomes đŻ
This is the part I see people skip the mostâit might as well be the Terms & Conditions screen you scroll past when installing a new app. But half of the chat modesâ magic lives right here. If you want structure in your results, this is the place to define it.
Outcomes are the acceptance criteria and style guardrails for your modeâthink pre-flight checklist, not a grading rubric.
Each response should:
- Apply appropriate logging levels based on context and severity (e.g., trace for deep dive, debug for dev-only, info for ops, warn for edge behavior, error for failures)
- Use structured logging (preferably JSON)
- Automatically use or insert centralized logging, with environment-configurable level control
- Include correlation IDs in structured logs when processing requests or events
- Apply log sampling when high volume is detected (project-appropriate threshold)
Every response should provide:
- A **brief summary of changes** grouped by intent (e.g., `Logger injected`, `Error logs added`)
- Optional **warnings or suggestions** for gaps (e.g., missing logger config)
đĄ ProTip: "Make logs better" is a wish. Copilot isnât a genieâgive it measurable results it can check against output data.
Reference Examples đ
This is how you stop Copilot from drifting into the weeds. Think of it as painting the lane lines on the road: show the clear path forward, but also mark the curbs it shouldnât cross. Good examples alone arenât enoughâyou want both the wins and the facepalms spelled out.
### Good Examples â
You may receive any of the following:
- Code snippets or full file contents
- Scope directives like `analyze API/payment`
Requests that work well:
- "Audit this worker process for proper log levels"
- "Ensure this module is safe from log injection"
- "Review my log config to allow runtime env changes"
- "Add correlation tracking for this API endpoint"
- "Implement log sampling for this high-volume service"
If the application is already using a centralized logger, you SHOULD use it.
If not, offer to set one upâbut aim for minimally invasive, focused edits.
### Anti-Patterns to Fix â
- `console.log()` or `print()` statements in production code
- Logging sensitive data (passwords, tokens, API keys, PII)
- Static log levels hardcoded in source files
- Concatenated strings instead of structured fields
- Missing context (no correlation IDs, timestamps, or severity)
- Overly verbose debug logs left active in production
- Exception stack traces that expose internal architecture
đĄ ProTip: You canât shower Copilot in sunshine and then complain when it doesnât know how to drive in the rain. Stop and dip it in a few puddles along the way, too.
Get Creative and Share đ¨
If you can dream it up, Copilot can probably handle it. Build a teacher mode or a reviewer mode. I have an Instructionalist, the HLBPA, the Logfather, a Principal Pragmatistâplus a couple more working their way through planning right now. Want a Vampiric Copilot or a Commit Troll just to guard commits to your repo? Then do it! (Also: guilty â).
Check out my awesome-github-copilot repo or the larger community-driven awesome-copilot repo for even more examples when you start building your own. Donât forget to come back and share what you come up with!
đŞ Aside regarding my XML chat modes: they started solely as a theory. Yesâthey do work, but Markdown is still the officially supported format when giving any input to Copilot. I mostly use the XML style for Coding Agent because itâs easyâbut you can drop the full Markdown file in there, too. No problem!
đĄď¸ AI Signed in Ink, Not Invisible
This wasnât ghost-written. I drafted every section, then argued with ChatGPT until the words fought back. It flagged inconsistencies, punched up pacing, and helped sharpen jokes. I approved every lineâand yes, I grinned when the edits swung back at me. Finally! đ
Top comments (0)