How to Migrate Code Studio Rules to Custom Instructions
Beginning with Code Studio version 2.0.0, legacy rule formats (config.yaml and .sfcoderules) are no longer supported. All rule definitions must be migrated to the Custom Instructions file format to ensure Code Studio continues applying your rules correctly.
Why Migration Is Required
Earlier versions of Code Studio automatically loaded rules from:
-
config.yaml (inside the user profile)
-
.sfcoderules (inside the workspace)
Starting from version 2.0.0, Code Studio only reads rules from the Custom Instructions file. Any rules stored in old file locations will not be detected.
Resolution Steps
Step 1: Create a New Instruction File
- Open Code Studio.
- Create a new instruction file following the Custom Instructions structure.
- Ensure you are using version 2.0.0 or later, as Custom Instructions are not supported in older versions.
Step 2: Migrate Existing Rules
You may have rules stored in either config.yaml or .sfcoderules. Follow the steps below depending on where your rules are located.
If Your Rules Were in config.yaml
Windows Location
C:\Users<YourName>.sfcodestudio.codestudio\config.yaml
macOS Location
/Users/
Migration Steps:
- Open the config.yaml file.
- Locate the rules: section.
- Copy all the rule definitions listed under it.
- Open your newly created instruction file.
- Paste the copied rules below the applyTo section.
- Save the file.
If Your Rules Were in a .sfcoderules File
Migration Steps:
- Open the .sfcoderules file in your workspace.
- Copy all the rules or lines contained in it.
- Open your new instruction file.
- Paste the content below the applyTo section.
- Save the file.
How Instruction Files Work in Version 2.0.0 and Later
Once your instruction file is saved:
- Code Studio will automatically detect and load it.
- All instructions will be applied to every future request.
Legacy files (config.yaml, .sfcoderules) will no longer be used.