Skip to content
| Marketplace
Sign in
Visual Studio Code>Programming Languages>Trace: AI Debugging AgentNew to Visual Studio Code? Get it now.
Trace: AI Debugging Agent

Trace: AI Debugging Agent

adilshaik

|
1 install
| (1) | Free
An autonomous AI agent that debugs your backend code using LSP navigation, live test feedback, and structured editing. Supports OpenAI, DeepSeek, Gemini, Kimi, Groq, Ollama, and more.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Trace: AI Debugging Agent for VSCode

An autonomous AI agent that debugs your backend code using LSP navigation, live test feedback, and structured editing.

Multi-Model • Get Started • How It Works • FAQ • Roadmap


Supported Models

Trace works with a wide range of LLM providers, including free options:

Provider Models Free Tier? Setup
OpenAI GPT-4o, GPT-4-turbo, o1-mini No platform.openai.com
DeepSeek DeepSeek-Chat, DeepSeek-Coder Very cheap ($0.14/M tokens) platform.deepseek.com
Google Gemini Gemini 2.0 Flash, 1.5 Pro Yes (15 RPM free) aistudio.google.dev
Kimi (Moonshot) moonshot-v1-8k/32k/128k Yes (free tier) platform.moonshot.cn
Groq Llama 3.1 70B, Mixtral Yes (free tier) console.groq.com
Ollama Llama 3.1, CodeLlama, Qwen 2.5 Fully free (local) ollama.com
Custom Any OpenAI-compatible API Varies Provide base URL + key

Get Started

Install

  1. Install the Trace extension from the VSCode marketplace
  2. Click the Trace icon in the activity bar (left sidebar)

Configure a Model

Open VSCode Settings (Cmd+, / Ctrl+,) and search for trace.model:

  • trace.model.provider — Choose: openai, deepseek, kimi, gemini, groq, ollama, or custom
  • trace.model.apiKey — Your API key (not needed for Ollama)
  • trace.model.modelId — Model to use (e.g., gpt-4o, deepseek-chat, gemini-2.0-flash)
  • trace.model.baseUrl — Custom endpoint (auto-filled for known providers)

Quick start with a free model:

{
  "trace.model.provider": "gemini",
  "trace.model.apiKey": "YOUR_GOOGLE_AI_STUDIO_KEY",
  "trace.model.modelId": "gemini-2.0-flash"
}

Or use a local model with Ollama (no API key needed):

{
  "trace.model.provider": "ollama",
  "trace.model.modelId": "llama3.1"
}

Use Trace

  1. Describe the bug in the chat input
  2. (Optional) Expand "Repro Steps" to configure build and test commands — this gives the agent access to runtime feedback
  3. Hit the Send button (purple arrow)
  4. Watch the agent navigate your code, make edits, and verify fixes
  5. Review the proposed changes and Apply or Revert

You can provide feedback to the agent while it's running — it will incorporate your input in the next step.

How It Works

Bug Description + Repro Steps
    |
    v
[Agent Loop — iterates until fixed or max iterations]
    |-- LLM generates thought + tool calls
    |-- Executes tools:
    |     |-- Navigation: ReadFile, GoToDefinition, GetAllReferences, FindTextInFiles
    |     |-- Editing: ReplaceText (match-and-replace with hallucination detection)
    |     |-- Verification: Run build + test commands, check output
    |-- Observation fed back to LLM
    |-- Repeat
    v
Proposed Fix (diff view with Apply/Revert)

Key Features

  • LSP Integration — GoToDefinition, GetAllReferences, GetFileSymbols for real IDE-level code navigation
  • Match-and-Replace Editing — The LLM must reproduce original code with line numbers before replacing, catching hallucinations and indentation errors
  • Live Verification — Runs your actual build and test commands, giving the agent real feedback
  • Backtracking — Agent can undo changes and try a different approach
  • Streaming Output — See the agent's reasoning in real-time
  • Diff View — Monaco-powered diff editor to review all changes before accepting

Agent Tools

Tool Description
ReadFile Read file contents with line numbers
GoToDefinition Jump to where a symbol is defined
GetAllReferences Find all usages of a symbol
GetFileSymbols List all symbols in a file
FindTextInFiles RipGrep text search across the project
FindFiles Glob-based file search
ReplaceText Match-and-replace editing with line numbers
CreateFile / DeleteFile / RenameFile File operations
Verify Run build + test commands and return output
Backtrack Undo changes and go back to a previous state

Configuration Reference

Model Settings

Setting Type Default Description
trace.model.provider enum openai LLM provider
trace.model.modelId string gpt-4o Model ID
trace.model.apiKey string — API key
trace.model.baseUrl string — Custom endpoint URL
trace.model.maxCalls number 50 Max LLM calls per session

Agent & Session Settings

Setting Type Default Description
trace.agent.maxIterations number 50 Max agent loop iterations per session (graceful stop, partial diff shown)
trace.agent.sessionTimeoutMs number 1800000 Wall-clock session limit (30 min default)
trace.agent.approvalMode enum auto auto (no gates), edits (confirm file edits), all (also confirm Verify)
trace.agent.editScope string[] [] Allow-globs for editable files (e.g. ["src/**"]). A built-in denylist always protects .git, CI configs, .env*, lockfiles, node_modules
trace.agent.useSessionBranch boolean false Create a trace/session-<id> git branch with a commit per applied edit batch — every agent step becomes git-diffable
trace.agent.useSessionMemory boolean false Experimental: inject a digest of previous sessions (what was tried, how it ended) into the agent's context
trace.session.tracingEnabled boolean true Record session traces to .trace/sessions/ in the workspace

Transcript export: Cmd+Shift+P → Trace: Export Session opens any recorded session as a shareable markdown transcript (thoughts, tool calls, observations, diffs, token/cost totals).

Safety: Trace warns when your working tree has uncommitted changes at session start (with a one-click stash). With approvalMode set to edits or all, the agent pauses before each mutating batch and shows an approval card in the sidebar — rejections (with your reason) are fed back so the agent adjusts instead of retrying.

Session traces & resume: Trace records each debugging session (tool calls, LLM token usage, verify results) as JSONL under .trace/sessions/ in your workspace (the directory self-gitignores). If VSCode restarts mid-session, Trace offers to resume the interrupted session on next activation.

Repro Settings

Setting Type Description
trace.repro.buildCommand string Command to start the server/build
trace.repro.buildReadyText string Stdout pattern indicating build is ready
trace.repro.buildInactivityTimeout number ms of silence = build done
trace.repro.buildProcessTimeout number Hard max ms for build
trace.repro.testCommand string Command to run tests
trace.repro.testInactivityTimeout number ms of silence = test done
trace.repro.testProcessTimeout number Hard max ms for test

FAQ

How is Trace related to SWE-agent?

We were inspired by SWE-agent and extended their core insight around building good agent-computer interfaces. We added LSP navigation tools (GoToDefinition, GetAllReferences), embedded the agent directly in VSCode for real-time developer feedback, and implemented match-and-replace editing to reduce hallucination errors.

Why match-and-replace editing?

LLMs struggle with large edits. Our technique forces the agent to generate the original text with line numbers alongside the replacement. This catches hallucinated code (if the original doesn't match, the edit fails gracefully) and enforces correct indentation.

Why does Verify take long?

Check the output for common issues:

  1. Port conflict — Kill any processes using the same port in your terminal
  2. Build detection — Configure trace.repro.buildReadyText if the default patterns don't match your build output
  3. Slow builds — Some projects just take time to build

Can I use free models?

Yes! Gemini 2.0 Flash (free tier), Groq (free tier), Kimi/Moonshot (free tier), and Ollama (fully local, no cost) all work with Trace. See the Supported Models table, and MODELS.md for the measured reliability matrix and how to benchmark a model yourself.

How do I customize prompts?

Edit src/config/default.yaml and rebuild the extension with npm run package.

Development

# Install dependencies
npm run install:all

# Build (development)
npm run compile

# Build (production — extension + webview)
npm run package

# Watch mode
npm run watch

# Lint
npm run lint

Roadmap

See IMPROVEMENT_PLAN.md for the full prioritized engineering backlog (session persistence, eval harness, approval gates, safety guardrails, model reliability matrix) with execution order and progress tracking.

High-level themes:

  • Automated repro step creation (LLM-assisted test generation)
  • Better history management (summarization, embedding-based pruning)
  • Stateful file representation (avoid re-reading unchanged files)
  • Improved context discovery with embeddings
  • Frontend/UI bug support (beyond backend)
  • Comprehensive test suite

License

MIT


If you find Trace helpful, please give the repo a star to show your support!

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft