A VS Code extension that uses AI to comment, format and lint your code, then fixes what it finds in one click.
Features
Add Comments (Cmd/Ctrl+Alt+C): adds idiomatic doc comments to the selection, or to the whole file if nothing is selected. It changes comments only and can be undone with a single Undo. A safety check compares the code before and after (ignoring comments and docstrings); if the AI changed any code, nothing is applied and you can review a diff first.
Lint Current File (Cmd/Ctrl+Alt+Shift+L): the AI reviews the file for bugs, security issues, performance and error handling. Findings show in the Problems panel. Afterwards it offers Fix All (one Undo reverts every fix); set codetidy.fixOnLint to always to skip the prompt, or never to only report. Single fixes are in the lightbulb (Cmd+.).
Format Current File: uses your installed formatter (Prettier, Black, etc.). If there is none, it offers to format with AI.
On save (opt-in): codetidy.lintOnSave and codetidy.formatOnSave. Files that haven't changed are not sent again.
Add Comments, before and after:
Choosing an AI provider
Run CodeTidy AI: Select AI Provider, or set codetidy.provider:
Provider
Setup
Notes
claude (default)
Run Set Anthropic API Key
Best quality, pay per use
vscode
Install and sign in to a chat extension such as GitHub Copilot
No API key; VS Code asks for permission the first time
Free and fully local; quality depends on the model
Getting started
Install CodeTidy AI from the Extensions view (Cmd/Ctrl+Shift+X).
Pick a provider (above). For Claude, run CodeTidy AI: Set Anthropic API Key from the Command Palette. The key is kept in VS Code's encrypted secret storage; if none is stored, ANTHROPIC_API_KEY is used.
Open a file and press Cmd/Ctrl+Alt+Shift+L to lint it, or Cmd/Ctrl+Alt+C to add comments.
Results and token usage are logged under View → Output → CodeTidy AI.
Privacy
What is sent: the selected code or the current file, and its language and relative file path. Nothing else from your workspace is sent.
When: only when you run a command, or on save if you turn on lintOnSave (and formatOnSave with no AI involved). Nothing runs at startup.