Configuring your IDE Interpreter
Codegen creates a custom Python environment in.codegen/.venv. Configure your IDE to use this environment for the best development experience.
VSCode, Cursor and Windsurf
VSCode, Cursor and Windsurf
- Open the Command Palette (Cmd/Ctrl + Shift + P)
- Type “Python: Select Interpreter”

- Choose “Enter interpreter path”
- Navigate to and select:
.vscode/settings.json:PyCharm
PyCharm
- Open PyCharm Settings/Preferences
- Navigate to “Project > Python Interpreter”
- Click the gear icon ⚙️ and select “Add”
- Choose “Existing Environment”
- Set interpreter path to:
- Right-click on
.codegen/.venv - Mark Directory as > Sources Root
Troubleshooting
Troubleshooting
Common issues and solutions:
- Missing Completions: Make sure the interpreter is correctly set and the environment has
codegeninstalled - Import Errors: Verify the environment is activated and Python path includes the virtual environment
- Wrong Python Version: Check that you’re using Python 3.11 or higher in
.codegen/.venv
Create a New Codemod
Generate the boilerplate for a new code manipulation program using codegen create:- Create a new codemod in
.codegen/codemods/organize_types/ - Generate a custom
system-prompt.txtbased on your task - Set up the basic structure for your program
The generated codemod includes type hints and docstrings, making it easy to get IDE autocompletion and documentation.
Iterating with Chat Assistants
When you docodegen init, you will receive a system prompt optimized for AI consumption at .codegen/codegen-system-prompt.txt.
If you reference this file in “chat” sessions with Copilot, Cursor, Cody, etc., the assistant will become fluent in Codegen.
Collaborating with Cursor’s assistant and the Codegen system prompt.codegen/codemods/{name}/{name}-system-prompt.txt. This prompt contains:
- Relevant Codegen API documentation
- Examples of relevant transformations
- Context about your specific task