Skip to content
| Marketplace
Sign in
Visual Studio Code>Programming Languages>Mentat — Resource Efficiency AnalyzerNew to Visual Studio Code? Get it now.
Mentat — Resource Efficiency Analyzer

Mentat — Resource Efficiency Analyzer

EverDev

|
1 install
| (0) | Free
Find potentially wasteful repeated work in Go, JavaScript, and TypeScript.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Mentat for VS Code

Mentat detects code patterns that can amplify CPU, I/O, and memory usage as applications scale.

It analyzes Go, JavaScript, and TypeScript and surfaces findings directly in VS Code with a Resource Waste Score (RWS), confidence level, supporting evidence, and suggested review steps.

Findings appear in the Problems panel and directly at their source locations, so potentially wasteful repeated work can be reviewed without leaving the editor.


Features

  • Supports Go
  • Supports JavaScript
  • Supports TypeScript
  • Reports findings in the VS Code Problems panel
  • Highlights findings directly at their source locations
  • Includes a Resource Waste Score (RWS)
  • Includes confidence information
  • Provides evidence for each finding
  • Provides suggested review steps
  • Can automatically analyze supported files after they are saved
  • Supports configurable severity and confidence thresholds
  • Supports bundled or external Mentat binaries

See Mentat in Action

Mentat integrates directly with VS Code diagnostics, so performance findings appear alongside the rest of your development workflow.

Workspace Analysis

Run Mentat: Analyze Workspace to inspect supported files across the project.

Findings are reported in the Problems panel with their Resource Waste Score, confidence, rule identifier, and source location.

Mentat findings displayed in the VS Code Problems panel

Inline Diagnostics

Mentat highlights suspicious patterns directly where they occur.

Mentat detecting nested traversal amplification

Example:

Potential nested traversal amplification
RWS 60 · confidence 70%
PERF-CPU-001

Detect Loop-Invariant Work

Mentat can highlight operations that may be unnecessarily repeated inside loops.

Mentat detecting a potential loop-invariant call

Example:

Potential loop-invariant call
RWS 48 · confidence 55%
PERF-CPU-004

Detect Repeated Expensive Operations

Mentat can identify operations such as serialization being performed repeatedly inside loops.

Mentat detecting serialization inside a repeated path

Example:

Serialization inside repeated path
RWS 60 · confidence 80%
PERF-CPU-003

Detect Repeated Sorting

Sorting collections repeatedly during iteration can amplify CPU usage as the data set grows.

Mentat detecting repeated sorting inside iteration

Example:

Repeated sort inside iteration
RWS 57 · confidence 80%
PERF-CPU-002

Additional Examples

Additional Mentat performance diagnostics


Understanding a Finding

A Mentat diagnostic can look like this:

Repeated sort inside iteration (RWS 57, confidence 80%)
Mentat(PERF-CPU-002)

Resource Waste Score (RWS)
A normalized indication of the potential resource impact of the detected pattern.

Confidence
How confident Mentat is that the detected code represents the reported pattern.

Rule ID
A stable identifier such as PERF-CPU-002 that identifies the analysis rule.

The diagnostic location points directly to the operation that triggered the finding.


Usage

Open a supported project in VS Code and run:

Mentat: Analyze Workspace

Mentat will analyze the workspace and publish its findings as VS Code diagnostics.

You can inspect them from:

View → Problems

or directly from the highlighted source code.


Automatic Analysis

By default, Mentat analyzes supported files after they are saved.

This behavior can be configured using:

  • mentat.analyzeOnSave
  • mentat.saveDelayMs

Mentat currently analyzes the saved version of workspace files.

Unsaved editor changes are not included in the analysis yet.


Configuration

Mentat exposes the following VS Code settings:

Setting Description
mentat.binaryPath Optional path to the Mentat executable. If not configured, the extension first attempts to use its bundled platform binary and then falls back to mentat from PATH during development.
mentat.analyzeOnOpen Analyze the first workspace folder when the extension starts.
mentat.analyzeOnSave Analyze supported files after they are saved.
mentat.saveDelayMs Debounce delay before running analysis after rapid file saves.
mentat.timeoutSeconds Maximum execution time for a single analysis.
mentat.minimumSeverity Lowest severity that should be displayed.
mentat.minimumConfidence Lowest confidence level that should be displayed.

Example:

{
  "mentat.analyzeOnOpen": false,
  "mentat.analyzeOnSave": true,
  "mentat.saveDelayMs": 500,
  "mentat.timeoutSeconds": 30
}

Current Limitations

The current version has a few known limitations:

  • Analysis operates on saved workspace files
  • Unsaved editor changes are not analyzed
  • Platform-specific Mentat binaries must be bundled for Marketplace distribution
  • Supported languages are currently limited to Go, JavaScript, and TypeScript

Supported Languages

Language Status
Go Supported
JavaScript Supported
TypeScript Supported

Additional language analyzers may be added in future versions.


Troubleshooting

Mentat executable not found

If the extension cannot locate Mentat, configure:

{
  "mentat.binaryPath": "/path/to/mentat"
}

Make sure the binary is executable.

On Linux or macOS:

chmod +x /path/to/mentat

No findings appear

Check that:

  • the workspace contains supported files
  • files have been saved
  • Mentat completed before mentat.timeoutSeconds
  • your severity threshold is not filtering the finding
  • your confidence threshold is not filtering the finding

You can also manually run:

Mentat: Analyze Workspace

from the Command Palette.


How Mentat Fits Into Development

Mentat is intended to complement existing developer tooling such as:

Compiler
    ↓
Linter
    ↓
Static Analysis
    ↓
Mentat
    ↓
Tests
    ↓
Build

Rather than focusing only on correctness or style, Mentat focuses on patterns that may represent unnecessary repeated computation or resource usage.


Feedback and Contributions

Bug reports, feature requests, analyzer improvements, and language support contributions are welcome.

If you encounter an unexpected diagnostic, including a minimal reproducible example in the issue can help improve Mentat's analysis.


License

See the repository license for details.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
  • Your Privacy Choices
  • Consumer Health Privacy
© 2026 Microsoft