Try this tool today
Accelerate your vibe coding workflow with our partner link.
Continue.dev is an open-source, AI-powered code editor that runs locally or in the cloud, designed to help developers write, understand, and refactor code with real-time AI assistance. It matters most when you're writing new code, debugging complex functions, or exploring unfamiliar codebases — especially when you're in the flow and need immediate context, suggestions, or automated edits.
Writing Code with AI Assistance
When you start typing in a file, Continue.dev listens and responds instantly. As you type, it suggests the next lines, completes function bodies, and proposes variable names. The editor uses a local model (typically Llama 3 or Mistral) and a cloud-based model (via a server) to balance speed and intelligence. The AI responds to your cursor position, selected text, and the full context of the current file.
Triggering AI Suggestions
To invoke AI assistance, press Ctrl+Enter (or Cmd+Enter on macOS). This sends the current selection and surrounding context to the AI engine. The request is a JSON object sent over HTTP to http://localhost:8000/api/ai/suggest, with the following structure:
{
"text": "def calculate_total(items):\n total = 0\n for item in items:\n total += item.price\n return total",
"cursor": 42,
"file": "shopping_cart.py",
"project": "ecommerce"
}
The response is a JSON object containing the suggestion:
{
"suggestion": " # Add tax to total\n tax_rate = 0.08\n total += total * tax_rate\n return total",
"context": [
"The function calculates the total price of items in a shopping cart.",
"It assumes each item has a 'price' attribute."
],
"confidence": 0.87,
"source": "local"
}
The suggestion appears in a sidebar, and you can accept it with Enter or Ctrl+Enter.
Customizing AI Behavior
You configure the AI behavior in a continue.json file in the project root. This file uses standard JSON syntax and is read on startup.
{
"ai": {
"model": "llama3-8b",
"temperature": 0.6,
"max_tokens": 1024,
"context_window": 4096,
"prompts": {
"completion": "Write the next lines of code based on the context and current cursor position. Keep the style consistent with the surrounding code.",
"refactor": "Refactor the selected code to improve readability, performance, or maintainability. Include comments and explain the changes.",
"explain": "Explain the selected code in simple terms, suitable for a junior developer. Include a high-level overview and a breakdown of key parts."
}
},
"plugins": [
"git",
"python",
"test",
"docker"
]
}
The temperature key controls randomness in the generated text: 0.0 is deterministic, 1.0 is very creative. A value of 0.6 is ideal for code generation.
Refactoring Code with AI
Refactoring is where Continue.dev truly shines. Select a block of code and run Ctrl+Shift+Enter. The editor sends the selection to the AI with the refactor prompt, and the AI returns a full rewrite of the selected code, often with added comments, type hints, and improved structure.
Refactoring Example
You select the calculate_total function and run the refactor command. The AI returns:
{
"refactored": "def calculate_total(items: list[Item]) -> float:\n \"\"\"\n Compute the total price of a list of items, including 8%% sales tax.\n\n Args:\n items: A list of Item objects with a 'price' attribute.\n\n Returns:\n The total price with tax applied.\n \"\"\"\n total = sum(item.price for item in items)\n tax_rate = 0.08\n total_with_tax = total * (1 + tax_rate)\n return total_with_tax",
"changes": [
"Added type hints to function signature",
"Replaced for-loop with generator expression",
"Extracted tax calculation into a separate step",
"Added docstring with Google-style formatting"
],
"explanation": "The refactored function is more concise and readable. Using a generator expression improves performance and memory usage. The docstring helps other developers understand the function's purpose, inputs, and outputs."
}
You can accept the refactor with Enter, or apply it incrementally by accepting one change at a time.
Common Refactoring Pitfalls
- Over-Refactoring: The AI often adds too much structure. A simple loop becomes a class. Use
temperature: 0.4to keep output tighter. - Missing Context: If the AI doesn’t see the
Itemclass definition, it may miss thepriceattribute. Ensure the project root includes all relevant files in the context window. - Inconsistent Style: The AI may use
snake_casein acamelCaseproject. To fix this, add astyle_guideprompt:
"prompts": {
"refactor": "Refactor the selected code to improve readability, performance, and consistency with the project's style guide. Use snake_case for variables and functions, and follow PEP 8 for formatting.",
"style_guide": "Use snake_case for variable and function names. Indent with 4 spaces. Use double quotes for strings. Align function parameters across lines. Keep line length under 88 characters."
}
Explaining Code with AI
Select any code block and press Ctrl+Shift+I to explain it. The editor sends the selection to the AI with the explain prompt, and the AI returns a clear, natural-language breakdown.
Explaining a Complex Function
You select a function that processes a JSON configuration and returns a validated result:
def load_and_validate_config(config_path: str) -> dict:
with open(config_path, 'r') as f:
raw = json.load(f)
schema = {
"type": "object",
"properties": {
"database": {"type": "object", "properties": {"host": {"type": "string"}, "port": {"type": "integer"}}},
"logging": {"type": "object", "properties": {"level": {"type": "string", "enum": ["DEBUG", "INFO", "WARNING", "ERROR"]}}}
}
}
validator = jsonschema.Draft7Validator(schema)
errors = []
for error in validator.iter_errors(raw):
errors.append(f"{error.path}: {error.message}")
if errors:
raise ValidationError(errors)
return raw
The AI explains:
> This function loads a JSON configuration file and validates it against a predefined schema. > > 1. It opens the file at config_path and parses the JSON content. > 2. It defines a schema that specifies the expected structure: > - The config must be an object with two keys: database and logging. > - The database object must have host (a string) and port (an integer). > - The logging object must have level (a string, restricted to DEBUG, INFO, WARNING, or ERROR). > 3. It creates a validator using jsonschema and checks the loaded data against the schema. > 4. It collects all validation errors, each with a path (e.g., ['database', 'host']) and a message. > 5. If any errors exist, it raises a ValidationError with the full list. > 6. If all checks pass, it returns the validated configuration as a dictionary. > > The function is robust: it ensures the configuration is not only present but also correctly structured and typed.
You can copy this explanation into documentation, or use it as a starting point for a team onboarding guide.
Debugging with AI
When a test fails or a runtime error appears, use Ctrl+D to open the debugger panel. The AI analyzes the error and suggests fixes.
Analyzing Error Logs
You run a test suite and get this error:
Traceback (most recent call last):
File "tests/test_user.py", line 14, in test_create_user
assert user.email == "[email protected]"
AssertionError: assert '[email protected]' == '[email protected]'
Select the error message and press Ctrl+D. The AI returns:
{
"analysis": "The test expects the user's email to be '[email protected]' but received '[email protected]'. The difference is in the domain: 'example.com' vs 'exampl.com'.",
"suggestions": [
"Check the user creation function for typos in the email string.",
"Add a test case for email formatting in the user creation process.",
"Use a regex validator to catch typos in email addresses.",
"Add a step in the test to log the actual email before assertion."
],
"fix": [
"def create_user(name: str, email: str) -> User:\n # Ensure email is correctly formatted\n assert '@' in email, 'Email must contain @ symbol'\n assert email.count('@') == 1, 'Email must have exactly one @ symbol'\n assert email.endswith('.com'), 'Email must end with .com'\n \n return User(name=name, email=email)",
"test_create_user():\n user = create_user('Alice', '[email protected]')\n assert user.email == '[email protected]', 'Email mismatch: expected [email protected], got ' + user.email"
]
}
You can apply the fix directly in the editor, or generate a new test case.
Running and Managing AI Tasks
Continue.dev runs AI tasks asynchronously. You can view the task queue with Ctrl+T, which shows a list of pending, running, and completed tasks.
Task Queue Interface
Each task has the following properties:
id: A UUID string.type: One ofcompletion,refactor,explain,debug,test.status:pending,running,completed,failed.progress: A number from 0.0 to 1.0.error: Optional, if the task failed.
When a task fails, the error message is logged in the task list. Common failures include:
- Model Not Found: The requested model (
llama3-8b) is not available. Check theai/modelsdirectory and ensure the model files are inmodel.bin,config.json, andtokenizer.json. - Context Too Large: The combined text exceeds the model's context window (e.g., 4096 tokens). The AI truncates the input and logs a warning.
- Network Timeout: The cloud-based AI server is unreachable. The editor falls back to local model, but results are less accurate.
Managing Multiple Projects
Continue.dev automatically detects projects based on the presence of a continue.json file. You can switch between projects with Ctrl+P, which opens a list of projects in the current workspace.
Each project can have its own configuration, models, and plugins. When you open a file, the editor loads the project's continue.json, sets the AI model, and enables plugins.
Plugin Integration
Plugins extend Continue.dev’s capabilities. The git plugin, for example, adds commands like git commit and git push that are powered by AI.
To create a new commit, run Ctrl+G while in a file. The editor prompts:
Enter commit message (AI will suggest one):
> Add user authentication and login flow
The AI suggests a commit message based on the changes:
> Add user authentication and login flow > > - Implement login form with email and password > - Add session management using JWT > - Integrate with database to store user credentials > - Add middleware to protect routes > - Add test cases for login and session handling
You can accept, edit, or generate a new message.
Failure Modes and Best Practices
- Silent Model Loading: If
continue.jsonspecifies a model not inai/models, the editor logs a warning but continues with a default model. - Cursor Position Mismatch: The AI sometimes uses the wrong line for the cursor. Ensure the
cursorfield in the request is the byte offset from the start of the file, not the line number. - Context Truncation: When the context exceeds the model’s token limit, the AI truncates from the top. To preserve file structure, include the file header and first 100 lines in the context.
- Plugin Conflicts: Two plugins may define the same command. Use
plugin_orderincontinue.jsonto resolve conflicts.
Use Ctrl+Shift+P to open the command palette. It lists all available commands, including AI-specific ones:
AI: Suggest— invoke AI with current selection.AI: Refactor— refactor selected code.AI: Explain— explain selected code.AI: Debug— analyze error and suggest fixes.AI: Run Task— queue a new AI task.
Each command is available from the editor’s menu, the status bar, and the command palette.
Continue.dev is not a tool that you install and forget. It learns with you, adapts to your codebase, and becomes a true partner in writing software.
This page was rewritten on 11 October 2026. It replaced a templated version that was not specific to its own title. How these pages are written and checked. If anything here is wrong, tell us at [email protected] and we will correct it.