Infracost's VS Code extension shows you cost estimates for Terraform right in your editor! It also surfaces FinOps policies and tagging issues so you can catch problems before they reach production.
See cost estimates as code lenses directly above Terraform resource definitions. Costs update as you edit.

Click a code lens to open the resource details panel, showing a full cost component breakdown, FinOps policy violations, and tagging issues.

The extension highlights FinOps policy violations (with risk, effort, and potential savings) and tag policy issues directly in the sidebar. Blocking violations are clearly marked.

In addition to Terraform (.tf) files, the extension supports CloudFormation templates in YAML and JSON.
[!NOTE] Prerequisites: Make sure you have VS Code v1.100.0 or above and an Infracost account. See Requirements for details.
Open VS Code and go to the Extensions view (Ctrl+Shift+X / Cmd+Shift+X). Search for Infracost, select the extension published by Infracost, and click Install.
Alternatively, use the Quick Open command:
ext install Infracost.infracost
Installing a pre-release version
Download the .vsix file for your platform from the latest pre-release. Then install it manually:
code --install-extension infracost-0.2.35-darwin-arm64.vsix
Or in VS Code: open the Command Palette (Cmd+Shift+P / Ctrl+Shift+P), run Extensions: Install from VSIX..., and select the downloaded file.
[!TIP] Using a different IDE? See the official installation docs for instructions on other supported editors.
Open the Infracost sidebar and click Login to Infracost. This will open a browser window to authenticate your editor with your Infracost account.

Open a workspace containing Terraform files. The extension will start the language server and begin scanning your project. Cost estimates will appear as code lenses above resource blocks.
Use our CI/CD integrations to add cost estimates to pull requests, giving your team visibility into cloud costs as part of your workflow.
| Setting | Description | Default |
|---|---|---|
infracost.serverPath |
Path to the lsp binary. Leave empty to use the bundled binary. |
(bundled) |
infracost.currency |
Currency to use for cost estimates. Options include all currencies supported by the pricing API. | USD |
infracost.displayRemoteModulesInTree |
Show resources from remote modules in the Explorer tree. Remote module sources cannot be opened from the tree. | false |
infracost.runParamsCacheTTLSeconds |
How long (in seconds) to cache run parameters between API calls. Set to 0 to disable. | 300 |
| Command | Description |
|---|---|
Infracost: Login |
Authenticate with your Infracost account |
Infracost: Restart Language Server |
Restart the LSP if it gets into a bad state |
If you're having issues, please start a thread in GitHub Discussions with as much log information as you can, along with your OS and VS Code version.
We welcome contributions! Please start by opening a thread in GitHub Discussions to discuss your idea before submitting a PR.
To set up a local development environment:
npm install to install dependencies.$ claude mcp add vscode-infracost \
-- python -m otcore.mcp_server <graph>