Code action
A code action is an IDE-level quick-fix or refactor offered by an LLM-driven extension — light-bulb suggestions, right-click 'fix with AI', 'explain this error' — the smallest unit of AI-assisted edit in 2026.
AI code actions live in the IDE's existing extension surfaces: VS Code's code-action API, JetBrains intentions, Neovim's LSP code actions. Common types: 'fix this lint error', 'add missing type annotations', 'extract function', 'add tests for this', 'explain this error message', 'translate this regex'. Compared to chat or agent mode, code actions are surgical: one button click, one small edit, no multi-turn conversation. Cursor, Copilot, Continue.dev, Cody, Codeium all expose code actions; quality depends on context capture (just the function vs whole-file vs repo-wide). The right primitive for in-flow micro-fixes; not the right primitive for multi-file refactors ([[background-agent]] handles that).
When to use code action
- In-flow micro-fixes (lint, types, small refactors).
- Explain-this-error one-shot lookups.
Common mistakes
- Trying to do agent-style multi-file work via code actions — wrong primitive, use agent mode instead.
FAQ
What is code action?
A code action is an IDE-level quick-fix or refactor offered by an LLM-driven extension — light-bulb suggestions, right-click 'fix with AI', 'explain this error' — the smallest unit of AI-assisted edit in 2026.
When should I use code action?
In-flow micro-fixes (lint, types, small refactors). Explain-this-error one-shot lookups.
What are the most common mistakes with code action?
Trying to do agent-style multi-file work via code actions — wrong primitive, use agent mode instead.
Related terms
- IDE agent — An IDE agent is an AI coding assistant embedded inside an integrated development environment — Cursor, Cline, Windsurf, Roo Code, GitHub Copilot agent mode — that can edit multiple files, run commands, and run tests autonomously from inside the editor.
- Code completion (AI) — AI code completion is the inline suggestion of code as a developer types — the autocomplete category dominated by Cursor Tab, GitHub Copilot, Windsurf, Tabnine, and Codeium in 2026.
- AI pair programming — AI pair programming is the practice of working alongside an AI coding assistant continuously — sharing intent, reviewing suggestions, accepting / rejecting / refining — instead of using AI for occasional one-off tasks.
Last updated: 2026-06-01. Raw markdown: https://promtable.com/glossary/code-action.md.