Copilot CLI Model Settings A developer documented how GitHub Copilot CLI resolves model settings through a layered precedence hierarchy, where repository-level configuration files override global user settings whenever commands run from within that directory. The writeup recommends inspecting the installed CLI version, session state, explicit flags, environment variables, user and repository settings, and managed policies, and using the `github-copilot-cli --help` output to confirm the active model without running token-heavy prompts. It attributes unexpected model switching between projects to these competing configuration layers. When working with GitHub Copilot https://raylabs.app/articles/choosing-github-copilot-cli-models/ , you may encounter a situation where the selected model changes unexpectedly when moving between different repositories or invocation surfaces. Understanding why this happens requires inspecting your installed CLI version, session state, explicit flags, environment variables, user settings, repository settings, and managed policies before modifying your configuration. Quick solution: To inspect your active model selection and configuration directories, run the following diagnostic command in your terminal: github-copilot-cli --help For deeper official documentation, consult the Copilot CLI programmatic model configuration https://docs.github.com/en/copilot/reference/copilot-cli-reference/cli-programmatic-reference and Copilot CLI configuration directory https://docs.github.com/en/copilot/reference/copilot-cli-reference/cli-config-dir-reference guides. The Copilot CLI model settings are typically configured using a JSON file located in your local configuration directory. However, these settings can be dynamically overridden by various runtime layers. To properly manage your environment, you must account for the following precedence factors: To establish a baseline configuration, create or edit your local settings file to specify your preferred model explicitly. Maintaining a clear JSON structure ensures predictable behavior across different workflows. { "model": "gpt-4o" } When managing complex environments or multiple developer workflows https://raylabs.app/articles/choosing-between-chatgpt-and-claude-for-developer-workflows/ , ensuring your project files remain clean is critical. For broader insights into maintaining agent configurations, many developers also reference guides such as Configuring Mcp Json Files For Ai https://raylabs.app/articles/configuring-mcp-json-files-for-ai-agents/ to align their local setups. When debugging why a model switched without your direct input, evaluate the hierarchy of configuration layers. The execution engine resolves settings in the following strict order from highest to lowest precedence: If a repository contains a local configuration file, it will override your global user settings whenever you execute commands from within that directory. This explains why a model selection appears correct in one project but reverts or changes in another. To confirm which model is currently active without executing token-heavy prompts or logging sensitive data, inspect the local runtime output and help flags. Checking the installed help output reveals active runtime defaults and helps isolate whether an environment variable is actively masking your JSON configuration file. When model drift occurs between projects, work through this systematic troubleshooting workflow: .github or configuration files that might contain repository-specific model overrides.