AI Actions
Wing provides quick access to several AI agent-driven actions. These create a dedicated Claude Code instance, compose a detailed request from the relevant context, and submit it automatically. The results are either reported to the user or applied as code changes.
Editor Code Actions
The AI actions icon in the top right of the editor provides a dropdown menu of AI-driven code actions. These send a request to a dedicated Claude Code instance that reads the code and either reports findings or makes changes.
Report actions analyze code and report their findings without making any changes:
- Explain Code -- Explains the code's purpose, structure, and key design decisions.
- Review for Code Quality -- Reviews code for quality issues including structure, naming, error handling, maintainability, and clarity.
- Review for Security Risks -- Reviews code for security vulnerabilities including injection, authentication, data exposure, input validation, and other OWASP top 10 risks.
Fix actions modify the code to address the requested issue:
- Fix Code Warnings -- Fixes code issues that would cause warnings, such as unused imports, undefined names, type errors, and style issues.
- Optimize Code -- Optimizes code for performance by identifying and fixing inefficiencies, unnecessary allocations, and algorithmic improvements.
- Update Comments & Docstrings -- Adds or updates docstrings and comments to accurately describe the code's purpose and behavior.
Choosing a Scope
When the cursor is inside a class or function, each action offers a submenu to choose the scope:
- Whole File -- Applies the action to the entire file.
- Scope names -- One entry for each enclosing scope at the cursor position. For example, if the cursor is inside MyClass.my_method, the submenu offers both MyClass and MyClass.my_method.
- Current Selection -- Available when text spanning multiple lines is selected. Applies the action only to the selected code.
When no scopes are available and there is no selection, clicking the action applies it to the whole file directly without a submenu.
Custom Actions
You can define your own code actions using Manage Actions... at the bottom of the dropdown menu. Each custom action has a name, a type (report or fix), and a description that serves as the instruction sent to Claude Code.
Custom report actions appear alongside the built-in report actions, and custom fix actions appear alongside the built-in fix actions.
One-Click Fixes
Other parts of Wing's user interface also offer options for sending targeted fix requests to Claude Code, for common problems encountered during development. These create a dedicated Claude Code instance with a descriptive tab label (Fix Test, Fix Bug, Fix Warning, or Write Tests) and automatically submit the request:
- Fix This Test / Fix Tests -- Available from the Testing tool when one or more failed tests are selected, and from the Fix Failed Tests command in the Testing menu. When a single test is selected, sends the test failure details, exception, and output to Claude Code and asks it to analyze and fix the code. When multiple failed tests are selected, sends the list of failing tests and asks Claude Code to work through them one at a time, running each test to get failure details, fixing the code, and moving on to the next. See Fixing Tests.
- Fix This Bug -- Available from the Exceptions tool and the AI menu when the debugger is stopped at an exception. Sends the exception and traceback to Claude Code and asks it to fix the underlying bug. See Fixing Exceptions. This action reuses the existing Claude Code instance, since it often contains relevant context.
- Fix This Warning -- Available from the Code Warnings tool and editor warning tooltips. Sends the warning details and source context to Claude Code and asks it to fix the underlying issue. See Fixing Code Warnings.
- Write Tests -- Available from the Testing menu when the active editor contains a Python file. Sends the file contents and project test framework configuration to Claude Code and asks it to write unit tests. When text spanning one or more complete scopes (functions or classes) is selected, only the selected code is sent.
When Claude Code needs initial setup (approving directory trust, MCP servers, etc.), Wing will show a dialog asking you to complete the setup in the Claude Code tool before retrying the fix request.
Fix Completion Action
Fix actions from both the editor code actions and the one-click fixes follow the Fix Completion Action preference, which controls what happens after a fix completes (review changes, commit, or do nothing). See Configuration for details.
Concurrent Fix Warning
If a fix action or task is already running when you start another fix action, Wing warns you that running multiple fix actions at once may cause conflicts, and lets you choose whether to proceed or cancel. This warning can be disabled with the Warn on Concurrent Task Execution preference. See Configuration for details.
Concurrently running Claude Code instances working on the same code may overwrite each other's changes or be confused by ongoing changes.
Running concurrently is, however, not a problem if the fixes are not working on the same code files.
