Positron Assistant

Important

Positron Assistant is a preview feature in Positron 2025.07.0-204 and beyond.

As of Positron 2025.07.0-204, we support Anthropic for chat and GitHub Copilot for inline code completions.

In Positron 2025.10.0-199, we added GitHub Copilot for chat.

We will continue to add more language model providers in future releases.

We are actively improving the user experience and functionality, so please provide feedback and report any issues you encounter.

Positron Assistant is an AI client that provides LLM integration within Positron, both for chat and for inline completions. Use Positron Assistant to generate or refactor code, ask questions, get help with debugging, and get suggestions for next steps in your data science projects.

Getting started

Step 1: Enable Positron Assistant

  1. Opt in to the positron.assistant.enable setting to enable Positron Assistant.

  2. Restart Positron or run the Developer: Reload Window command in the Command Palette.

  3. Click on the chat robot icon in the sidebar, or run the Chat: Open Chat in Sidebar command in the Command Palette to open the chat.

Step 2: Configure language model providers

Supported model providers

Currently, we support Anthropic and GitHub Copilot for sidebar chat and inline chat. At this time, only GitHub Copilot is available for inline code completions.

Anthropic
Important

Positron Assistant requires a Claude Console account with API access. See Anthropic’s Claude API and Console documentation for more information.

Positron Assistant does not support logging into Anthropic with the Claude Pro Plan, Max Plan, or other Claude subscription plans.

To use Anthropic’s Claude models in Positron Assistant, you need to bring your own API key (BYOK). To obtain an API key from Anthropic:

  1. Log in to or create an account for Anthropic’s Claude Console.
  2. Navigate to the API keys management page.
  3. Click the Create Key button.
  4. Fill out any required information and click Add to generate your API key.
  5. Copy and save the API key to a password manager or another secure location.

After creating your API key, use it to add Anthropic as a language model provider in Positron.

GitHub Copilot

GitHub Copilot is a proprietary tool from GitHub. If you want to use GitHub Copilot, you need a subscription for GitHub Copilot in your personal GitHub account or to be assigned a seat by an organization with a subscription for GitHub Copilot for Business.

Students and faculty can use GitHub Copilot for free as part of the GitHub Education program. For more information, see the GitHub Education page.

Individual snippets of source code or the contents of entire files may be sent to GitHub’s servers to generate suggestions, for more information about how this information is handled, please see the Copilot Privacy Statement.

If you have a GitHub account with Copilot enabled, you can authenticate to GitHub Copilot in Positron Assistant. Follow the steps in adding language model providers to get started.

Tip

If you are using Positron with a remote SSH session, you will need to authenticate to GitHub on the remote server as well. Follow along on GitHub as we make improvements in this area.

Adding language model providers

  1. Run the Positron Assistant: Configure Language Model Providers command to open the language model provider dialog. You can also click the Add Model Provider… button in the Positron Assistant chat area.

  2. Select the model provider you want to add.

  3. Authenticate with the model provider.

    • For Anthropic, paste your API key into the input field and click Sign in.
    • For GitHub Copilot, click the Sign in button. This will open a browser window where you can authenticate with your GitHub account via OAuth.
  4. Once authenticated successfully, the Sign in button will change to Sign out, and available models from the provider will be registered.

  5. Click the Done button once you have added all the desired model providers. You can always come back to this dialog later to add or remove providers.

Removing language model providers

  1. Run the Positron Assistant: Configure Language Model Providers command to open the language model provider dialog. You can also click the Add Model Provider… button in the Positron Assistant chat area to open this dialog.

  2. Select the model provider you want to remove.

  3. Click the Sign out button to remove the provider from Positron Assistant.

  4. Click the Done button to close the dialog.

Step 3: Use Positron Assistant!

Use the Chat pane, inline chat, or code completions in an editor to interact with the language models.

Using Positron Assistant

Chat pane

Click on the chat robot icon in the sidebar, or run the Chat: Open Chat in Sidebar command in the Command Palette to open the chat.

Positron Assistant’s Chat pane (in the Activity Panel by default) has access to your R and Python console session inputs/outputs, as well as in-memory objects and dataframes as available in the Variables pane. Assistant can look at the Plots pane too, if instructed.

Chat modes

Positron Assistant supports three chat modes: Ask, Edit, and Agent. These modes are used to fine-tune Assistant to specific tasks by providing instructions unique to the mode, and tailoring what tools are accessible for use by Assistant.

To switch between modes:

  1. Click the mode selector dropdown at the bottom of the Chat pane.
  2. Select Ask, Edit, or Agent as needed.
  3. The Chat pane updates to reflect the selected mode.

Ask mode

Use this mode to ask questions, get help with debugging, or request code generation. Ask mode may provide code you can apply in your editor or run in the Console, but it will not edit or run code automatically.

  • “How do I plot a histogram in Python?”
  • “Why am I getting a syntax error in my R script?”
  • “Can you explain what this function does?”

Edit mode

Use this mode to make code changes with the model’s help. The model suggests code changes based on your prompts, and you can apply those changes to your code.

  • “Refactor this function to improve readability.”
  • “Convert this R code to Python.”
  • “Add error handling to this script.”

Agent mode

Use this mode if you want Positron Assistant to determine the steps needed for your request and autonomously carry out the work. Positron Assistant can execute code in the Console, create and modify files, and identify the next steps based on previous results.

  • “Create a new Python file and set up a basic data analysis workflow.”
  • “Install the required packages and run the code in the Console.”
  • “Generate a summary report from my current dataset.”

For more details on chat modes and other chat features, see Get started with chat in VS Code.

Custom chat modes

Adding custom chat modes allows you to:

  • Create specialized modes for specific tasks or workflows
  • Tailor the model’s behavior and available tools for different use cases

To create a custom chat mode:

  1. Run the command Chat: New Mode File… in the Command Palette.
  2. Choose a location for the new chat mode file from the dropdown.
  3. Name the file and press Enter.
  4. Edit the newly created .chatmode.md file to specify the chat mode description, the tools the chat mode can use, as well as the chat mode prompt content.

Once you have created a custom chat mode, it will appear in the mode selector dropdown in the Chat pane, allowing you to select and use it like the default chat modes.

To configure your custom chat modes:

  • Run the command Chat: Configure Chat Modes… in the Command Palette.

Additional resources

Custom chat modes are now called custom agents in VS Code documentation. To learn more about the format of custom agents, see the following VS Code documentation:

Attaching context

Providing context to the model is crucial for getting accurate and relevant responses. To attach specific files or directories as context for your prompts, you can either:

  • Click the Add Context… button in the Chat pane and choose “Files & Folders…” in the quickpick to select relevant items; or
  • Drag files to the Chat pane as attachments
Interpreter session context

By default, Positron Assistant can see the active R or Python interpreter session in the Chat pane. The chat input box displays the active Console session as an attachment.

When an interpreter session is attached, Positron Assistant can access:

  • Code inputs and outputs in that session
  • In-memory objects and data frames in the Variables pane
  • The active plot in the Plots pane
  • Tool calls that require the interpreter session

You can manage the attached interpreter session context in the following ways:

  • To switch the attached interpreter session for chat, click the interpreter session in the Console pane to make it active. Positron Assistant automatically updates to use the newly active interpreter session.

  • To attach more than one interpreter session, click the Add Context… button in the Chat pane and choose “Interpreter Sessions…” to select additional interpreter sessions.

  • To toggle the visibility of the active Console session, click the eye button on the Console session attachment in the Chat pane. When the eye icon appears without a slash through it, the Console session is visible. When the eye icon has a slash through it, the Console session is hidden.

  • To change the default visibility of the active interpreter session, modify the chat.implicitSessionContext.enabled setting. By default, the panel setting is always, which always attaches the Console session in the Chat pane. To disable the Console session context in the Chat pane, change the panel setting to never.

Code generation and execution

Code generated by Assistant can be run in the Console, copied to the clipboard, or sent to the Editor via controls attached to code output blocks.

Slash commands

Slash commands provide quick access to common tasks without writing long prompts. Start by typing / in the chat box to see available commands. For example, the /quarto command converts the current chat conversation into a Quarto document.

Chat participants

Tip

Currently, chat participants are only available in Ask mode.

Chat participants provide specialized knowledge to Positron Assistant. You can add a chat participant by clicking the button or typing @ in the Chat pane plus the chat participant name. Please reference the Shiny Assistant section for more information on the use of a Shiny chat participant.

Chat conversation history

It’s important to start a new chat conversation for each new task, so the model has the most relevant context. To create a new chat conversation, click the button in the top right of the Chat pane or run the Chat: New Chat command in the Command Palette.

To view your chat conversations, click the clock icon in the top right of the Chat pane or run the Chat: Show Chats… command in the Command Palette. You can then select a previous conversation to switch back to it.

Customizing prompts and instructions

Extend the default prompt

Extending the default prompt allows you to:

  • Add project-specific coding standards or conventions
  • Include domain-specific terminology or context
  • Define preferred libraries or frameworks for your project

To customize Positron Assistant’s behavior, create one or more of these files in your workspace root directory:

  • agents.md
  • agent.md
  • positron.md
  • claude.md
  • gemini.md
  • llms.txt

Positron Assistant looks for these files and appends each file’s content to the default prompt for all chat and inline chat interactions. This customization does not affect code completions. Note that the order in which these files are appended is not guaranteed. Follow issue #10571 for updates.

Custom prompt files

Adding custom prompt files allows you to:

  • Reuse prompts across chat requests and sessions
  • Explicitly apply prompts to specific chat requests

To create a custom prompt file:

  1. Run the command Chat: New Prompt File… in the Command Palette.
  2. Choose a location for the new prompt file from the dropdown.
  3. Name the file and press Enter.
  4. Edit the newly created .prompt.md file to specify the prompt description, chat modes the prompt should be available for, the tools the prompt can use, as well as the prompt content.

To use a custom prompt in a chat or inline chat session:

  1. Type / in the chat input box to open the slash command menu
  2. Continue typing the custom prompt name or select the prompt from the slash command menu.
  3. Finish your message and send it to the model. Your custom prompt will be included in the request.

For example, if you have a prompt file named emojis.prompt.md, you can type /emojis in the chat input box to use that prompt.

To configure your custom prompt files:

  • Run the command Chat: Configure Prompt Files… in the Command Palette.

Additional resources

To learn more about the format of custom prompt files, see the following VS Code documentation:

Custom instructions

Define custom instructions to apply specific prompts to files that match glob patterns. This allows you to:

  • Enforce coding standards for specific file types, such as Python or R scripts
  • Provide context-specific guidelines for different parts of your project, such as data processing or visualization scripts

To define custom instructions:

  1. Run the command Chat: New Instructions File… in the Command Palette.
  2. Choose a location for the new instructions file from the dropdown.
  3. Name the file and press Enter.
  4. Edit the newly created .instructions.md file to specify the applyTo file glob pattern and the instructions you want to apply.

Once you have created custom instructions files, Positron Assistant will automatically apply the relevant instructions based on the file glob patterns when you interact with the model in chat or inline chat.

To configure your custom instructions files:

  • Run the command Chat: Configure Instructions… in the Command Palette.

Additional resources

To learn more about the format of custom instructions files, see the following VS Code documentation:

Inline chat

Inline chat is very useful for asking questions in the context of your code, and also includes an interface for integrating changes suggested by the model.

To open this mini chat interface can in an editor or terminal, use the default keybinding , or run the command Inline Chat: Editor Inline Chat while your cursor in an editor or the command Inline Chat: Terminal Inline Chat while your cursor is in a terminal.

Completions

Code completions are code suggestions that appear inline as you type in an editor.

Interact with suggestions by:

  • Pressing the Tab key to accept the entire suggestion.
  • Pressing to accept the suggestion word-by-word for a single line suggestion, or line-by-line for multi-line suggestions.
  • Continuing to type to reject the suggestion.

If you are not receiving suggestions, please:

Set minimum delay before showing completions

By default, completion suggestions are shown immediately as you write code.

To configure a minimum delay before showing completions, modify the setting editor.inlineSuggest.minShowDelay, which defaults to 0 milliseconds. For example, setting this value to 500 introduces a half-second delay before showing completion suggestions.

Pause code completions temporarily

Completions from an LLM such as GitHub Copilot can be super useful, but sometimes they can be distracting or interfere with other completions from the Python or R LSP.

To pause code completions temporarily, the following methods are available:

  • Run the command Snooze Inline Suggestions in the Command Palette and select the duration to snooze completions for; or
  • Click on the Assistant status bar icon, then the Snooze button to snooze completions Snooze these completions temporarily from the Assistant status bar popup

To view the remaining time on a snooze, hover over the Assistant status bar icon to see a popup with the remaining time.

To cancel the snooze early, the following methods are available:

  • Run the command Cancel Snooze Inline Suggestions in the Command Palette; or
  • Click on the Assistant status bar icon, then the stop button

Disable code completions

If you prefer not to receive code completions from Positron Assistant, you can disable them for all files or specific file types and patterns using the following methods:

  • To toggle completions on or off for all files: Run the command Positron Assistant: Toggle (Enable/Disable) Completions in the Command Palette

  • To disable completions for all files or for the current file type: Click the Assistant status bar icon, then in the popup, uncheck All files to disable completions for all files, or uncheck the current file type to disable completions for that file type

  • To configure the languages for which inline completions are enabled or disabled: Modify the setting positron.assistant.inlineCompletions.enable

  • To specify glob patterns for which inline completions should be disabled: Modify the setting positron.assistant.inlineCompletionExcludes

Console actions

Positron Assistant provides quick help for errors in the Console. When you see an error, you can choose Fix or Explain to send your session to Assistant for immediate feedback.

  • Fix: Assistant diagnoses the error and suggests a corrected version of your code. Use Fix to resolve errors quickly or apply recommended changes.

  • Explain: Assistant describes what your code does, analyzes the error, and suggests possible solutions. Use Explain to learn more about your code or get advice on complex issues.

You can review your Fix and Explain history by searching for Open Quick Chat in the Command Palette.

Fix and Explain inherits these options from the sidebar chat:

  • Selected model
  • Files added or removed from context
  • Console session visibility

Disabling Console actions

Console actions are enabled by default when Assistant is active and you are signed into a model provider. Disable Console actions with the positron.assistant.consoleActions.enable setting.

Shiny Assistant

Shiny Assistant is a chat participant available within Positron Assistant that provides context-aware assistance for developing Shiny applications in Python or R. It can help you with tasks such as generating Shiny UI components, server logic, and reactive expressions.

Shiny Assistant enhances the default prompt with additional information about Shiny that we have found improves the quality of generated apps and Shiny components. It is also kept up to date with the latest Shiny features and best practices, in a way that is not practical with foundation models or fine-tuning.

Shiny Assistant is available in the chat once you have installed the Shiny extension. Like other chat participants, Shiny Assistant can be invoked by typing @shiny in the Chat pane or Inline Chat, followed by your question or request related to Shiny development.

Why use Positron Assistant over other AI clients?

Positron Assistant offers novel data science and Positron-specific context compared to other IDE AI tooling. We provide a data-science-centric IDE and allow the LLM to interact with the most important parts of Positron to get better context for better results!

A majority of data science work happens interactively with live data during development. You can load local or remote data, seek to understand it via cleaning, transformations, visualizations, and then modeling, then ultimately generate reproducible code.

While the full code on disk is the ultimate source of truth and gives you the ability to reproduce the results, the ephemeral state is where a data scientist is actually working the majority of the time. As such, existing AI clients that only have access to the code on disk are limited in their ability to provide useful suggestions and context-aware completions for data science.

We use tool-calling heavily within Positron to allow the LLMs to directly interact with Positron’s novel data science features. We have built out key integration points that allow the LLM to parse and interact with the current state of the Positron IDE, and will continue to expand these capabilities over time.

A few examples of these integration points include Positron’s:

  • Variables pane, providing names, dimensions, and column names of dataframes and Python/R based database connections, as well as metadata for arrays, lists, and other objects in memory
  • Plots pane for describing the current plot or suggesting variations and next steps for iterating on the current plot
  • Console, available to the model for viewing inputs and code outputs, as well as allowing a user or an AI agent to execute code in the console and view the output
  • Session state, providing what language is active in the console session (Python or R, including version), what packages are loaded, and what packages are installed

All of that Positron-specific context is in addition to the core capabilities of what traditional software-oriented GenAI clients have (active files, selected lines of code, files in project, training data in the model, etc.).

Support and terms of service

Posit does not provide support or assistance for any code written or generated in Positron, with or without Positron Assistant via any model provider. Posit does not support the Anthropic or GitHub Copilot output, or test the logic used by either to generate code from prompts.

Anthropic

By using Anthropic Claude, you acknowledge that your use of Anthropic Claude is subject to the Anthropic Terms of Service and Privacy Policy. Anthropic Claude is considered “Third Party Materials” as defined in the Posit End User License Agreement and Posit assumes no liability or other obligations with respect thereto and, without limiting the foregoing, is not liable for any loss or damage resulting from the use or access thereof.

GitHub Copilot

By using GitHub Copilot, you acknowledge that your use of GitHub Copilot is governed by their terms of service and you agree to abide by their terms of service. GitHub Copilot is considered “Third Party Materials” as defined in the Posit End User License Agreement and Posit assumes no liability or other obligations with respect thereto and, without limiting the foregoing, is not liable for any loss or damage resulting from the use or access thereof.