Update all internal documentation links to reflect the new structure where customization-related docs were moved from various locations to the 'agent-behavior' section. This includes: - Custom modes: /features/custom-modes → /agent-behavior/custom-modes - Custom rules: /advanced-usage/custom-rules → /agent-behavior/custom-rules - Custom instructions: /advanced-usage/custom-instructions → /agent-behavior/custom-instructions - Prompt engineering: /advanced-usage/prompt-engineering → /agent-behavior/prompt-engineering - Settings management: /features/settings-management → /basic-usage/settings-management Fixed links in both English and Chinese (zh-CN) documentation.
4.9 KiB
Auto-Launch Configuration
Auto-Launch Configuration allows you to automatically start a Kilo Code task when opening a workspace, with support for specific profiles and modes. This was originally developed as an internal test feature, but we decided to expose it to users in case anyone finds it useful!
:::info Auto-Launch Configuration is particularly useful for testing the same prompt against multiple models or project directories. :::
How It Works
When you open a workspace in VS Code, Kilo Code automatically checks for a launch configuration JSON file. If found, it:
- Switches to the specified provider profile (if provided)
- Changes to the specified mode (if provided)
- Launches a task with your predefined prompt
This happens seamlessly in the background, requiring no manual intervention.
Creating a Launch Configuration
Basic Setup
- Create a
.kilocodedirectory in your workspace root (if it doesn't exist) - Create a
launchConfig.jsonfile inside the.kilocodedirectory - Configure your launch settings using the JSON format below
Configuration Format
{
"prompt": "Your task description here",
"profile": "Profile Name (optional)",
"mode": "mode-name (optional)"
}
Required Fields
prompt(string): The task message that will be sent to the AI when the workspace opens
Optional Fields
-
profile(string): Name of an existing API Configuration Profile to use for this task. Must exactly match a profile name from your settings. -
mode(string): The Kilo Code mode to use for this task. Available modes:"code"- General-purpose coding tasks"architect"- Planning and technical design"ask"- Questions and explanations"debug"- Problem diagnosis and troubleshooting"test"- Testing-focused workflows- Custom mode slugs (if you have custom modes)
Example Configurations
Basic Task Launch
{
"prompt": "Review this codebase and suggest improvements for performance and maintainability"
}
Profile-Specific Task
{
"prompt": "Create comprehensive unit tests for all components in the src/ directory",
"profile": "GPT-4 Turbo"
}
Architecture Planning with Claude
{
"prompt": "Design a scalable microservices architecture for this e-commerce platform with focus on security and performance",
"profile": "🎻 Sonnet 4",
"mode": "architect"
}
Model Comparison Setup
{
"prompt": "Optimize this algorithm for better time complexity and explain your approach",
"profile": "🧠 Qwen",
"mode": "code"
}
Use Cases
Development Workflows
- Project Templates: Include launch configurations in project templates to immediately start with appropriate AI assistance
- Code Reviews: Automatically trigger code review tasks when opening pull request branches
- Documentation: Launch documentation generation tasks for new projects
Testing and Comparison
- Model Testing: Create different configurations to test how various AI models handle the same prompt
- A/B Testing: Compare approaches by switching between different profiles and modes
- Benchmarking: Systematically test AI performance across different scenarios
Team Collaboration
- Consistent Setup: Ensure all team members use the same AI configuration for specific projects
- Onboarding: Help new team members start with optimal AI settings automatically
- Standards: Enforce coding standards by launching with specific profiles and modes
File Location
The configuration file must be located at:
your-workspace/
└── .kilocode/
└── launchConfig.json
This file should be at the root of your workspace (the same level as your main project files).
Behavior and Timing
- Auto-launch triggers approximately 500ms after Kilo Code extension activation
- The sidebar automatically receives focus before the task launches
- Profile switching happens before mode switching (if both are specified)
- The task launches after all configuration changes are applied
- If profile or mode switching fails, the task continues with current settings
Troubleshooting
Configuration Not Loading
- Verify file location:
.kilocode/launchConfig.jsonin workspace root - Check JSON syntax with a JSON validator
- Ensure
promptfield is present and not empty - Check VS Code Developer Console for error messages
Profile Not Switching
- Verify the profile name exactly matches one from your settings
- Profile names are case-sensitive and must match exactly (including emojis)
- Check that the profile exists in your API Configuration Profiles
Mode Not Switching
- Verify the mode name is valid (code, architect, ask, debug, test)
- For custom modes, use the exact mode slug from your configuration
- Mode names are case-sensitive and should be lowercase