concept

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

Common mistakes

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.

Last updated: 2026-06-01. Raw markdown: https://promtable.com/glossary/code-action.md.