Real-time visibility into what your AI coding agent is doing with its context window.
AgentLens is a VS Code sidebar extension that surfaces the information normally hidden between you and your AI assistant — context usage, active model, files loaded into context, documentation health, and inferred agent behavior. Every metric comes from real telemetry. No simulated data.
Whether you're debugging prompt bloat, tracking which files your agent is referencing, or monitoring token consumption in real time, AgentLens gives you a transparent window into the agent's decision-making environment — without leaving your editor.
| Card | What You See |
|---|---|
| Context Window | Token count, utilization percentage, and capacity for the active model |
| Model Detection | Automatically identifies the AI model currently in use |
| File Tracking | Lists files loaded into the agent's context with size and relevance |
| Documentation Health | Scores the quality and coverage of docs referenced by the agent |
| Agent Behavior | Inferred activity patterns based on real telemetry signals |
- Visual Studio Code v1.80.0 or later
- Node.js v18+
Download the latest pre-built package directly from this repository:
- Go to the
VSIX/folder in this repo and downloadagentlens-4.3.0.vsix. - Open VS Code → Extensions (
Ctrl+Shift+X) →...→ Install from VSIX... - Select the downloaded file and reload when prompted.
git clone https://github.com/ravisha22/AgentLens.git
cd AgentLens
npm installCompile the full project (extension + webview):
npm run compileOr compile individually:
npm run compile:ext # Extension host only
npm run compile:webview # Webview UI only- Open the project in VS Code.
- Start the watchers in separate terminals:
npm run watch:ext
npm run watch:webview- Press F5 to launch the Extension Development Host.
- Open the AgentLens panel from the sidebar.
npm run packageThis produces a .vsix file you can install locally or distribute.
Once the extension is active, the AgentLens sidebar panel appears automatically. Each card updates in real time as you interact with your AI coding assistant.
Open the sidebar and check the Context Window card. It displays current token utilization against the model's maximum capacity, helping you understand when context is getting crowded and performance may degrade.
The File Tracking card shows exactly which files have been loaded into the agent's context. Use this to verify the agent is referencing the right sources — or to catch unnecessary files inflating your token budget.
The Documentation Health card evaluates referenced documentation for completeness and freshness, giving you actionable signals about whether the agent has enough high-quality context to work effectively.
src/
├── extension.ts # Extension entry point
├── types.ts # Shared type definitions
├── core/ # Core telemetry engine and context tracking
├── adapters/ # Integrations with AI provider APIs
├── providers/ # VS Code tree/webview data providers
└── test/ # Unit and integration tests
| Script | Description |
|---|---|
npm run compile |
Full build (extension + webview) |
npm run compile:ext |
Compile extension host code |
npm run compile:webview |
Compile webview UI |
npm run watch:ext |
Watch mode for extension code |
npm run watch:webview |
Watch mode for webview UI |
npm test |
Run the test suite |
npm run package |
Package as .vsix |
npm testTests live in src/test/ and validate core telemetry logic, adapter behavior, and provider output.
- Fork the repository.
- Create a feature branch:
git checkout -b feat/my-feature - Commit your changes with clear messages.
- Open a pull request against
main.
Please ensure npm test passes and there are no TypeScript compilation errors before submitting.
MIT
AgentLens — because you should see what your agent sees.