← Back to tech insights

February 19, 2026 · 8 min

Integrating AI in VS Code for Productivity Boost

A practical guide to supercharging your VS Code setup with AI — from extensions and keybindings to building your own AI-powered commands.

Integrating AI in VS Code for Productivity Boost

TL;DR: Most developers use maybe 20% of what VS Code and AI tools together can do. Here's a practical guide to setting up a genuinely AI-augmented development environment — not just Copilot autocomplete, but intelligent workflows that save real time.


The Productivity Stack

My full AI-augmented VS Code setup:

| Tool | Purpose | |------|---------| | JarvisX Extension | Project-aware AI assistant with memory | | GitHub Copilot | Inline completions | | Error Lens | Inline error display (AI explains on hover) | | GitLens | AI git commit messages | | REST Client | API testing with AI-generated payloads |


Setting Up GitHub Copilot Properly

Most developers install Copilot and accept defaults. A few settings changes make it significantly better:

// .vscode/settings.json (per-project)
{
  // Enable inline completions
  "editor.inlineSuggest.enabled": true,
  
  // Faster completions (reduce delay)
  "github.copilot.inlineSuggest.enable": true,
  "github.copilot.editor.enableAutoCompletions": true,
  
  // Copilot Chat: reference open files automatically
  "github.copilot.chat.scopeSelection": "referenceFiles",
  
  // Custom instructions per project
  "github.copilot.chat.codeGeneration.instructions": [
    { "text": "Use TypeScript with strict mode. Prefer functional patterns. Use Prisma for database queries. Follow Next.js App Router conventions." }
  ]
}

The codeGeneration.instructions field is underused. Adding project-specific instructions reduces back-and-forth corrections significantly.


AI Tasks Menu: Quick Actions

I use VS Code tasks as an AI launcher:

// .vscode/tasks.json
{
  "version": "2.0.0",
  "tasks": [
    {
      "label": "AI: Explain Current File",
      "type": "shell",
      "command": "curl -s -X POST http://localhost:3721/ask -H 'Content-Type: application/json' -d '{\"query\":\"Explain this file: ${file}\"}'",
      "presentation": { "reveal": "always", "panel": "shared" }
    },
    {
      "label": "AI: Generate Tests",
      "type": "shell",
      "command": "curl -s -X POST http://localhost:3721/generate-tests -H 'Content-Type: application/json' -d '{\"file\":\"${file}\"}'",
      "presentation": { "reveal": "always", "panel": "new" }
    },
    {
      "label": "AI: Review This PR Diff",
      "type": "shell",
      "command": "git diff HEAD~1 | curl -s -X POST http://localhost:3721/review-diff --data-binary @-",
      "presentation": { "reveal": "always", "panel": "new" }
    }
  ]
}

Run with Ctrl+Shift+P → Tasks: Run Task.


Custom Keybindings for AI Actions

// keybindings.json
[
  // Ask JarvisX about selected code
  {
    "key": "ctrl+shift+j",
    "command": "jarvisx.askAboutCode",
    "when": "editorTextFocus"
  },
  
  // Explain the error under cursor
  {
    "key": "ctrl+shift+e",
    "command": "jarvisx.explainError",
    "when": "editorTextFocus && editorHasErrors"
  },
  
  // Generate test file for current file
  {
    "key": "ctrl+shift+t",
    "command": "jarvisx.generateTests",
    "when": "editorTextFocus"
  },
  
  // Open Copilot Chat with current selection as context
  {
    "key": "ctrl+shift+c",
    "command": "github.copilot.interactiveEditor.explain",
    "when": "editorHasSelection"
  }
]

AI Git Commit Messages

Writing commit messages is tedious. GitLens + Copilot + this script makes commit messages automatic:

#!/bin/bash
# scripts/ai-commit.sh
# Usage: ./scripts/ai-commit.sh

DIFF=$(git diff --staged)

if [ -z "$DIFF" ]; then
  echo "No staged changes. Stage your changes first with: git add"
  exit 1
fi

echo "Generating commit message with AI..."

COMMIT_MSG=$(echo "$DIFF" | curl -s -X POST https://api.openai.com/v1/chat/completions \
  -H "Authorization: Bearer $OPENAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d @- << 'CURL_EOF'
{
  "model": "gpt-4o-mini",
  "messages": [{
    "role": "user",
    "content": "Write a concise git commit message for this diff. Use conventional commit format (feat/fix/refactor/docs/chore). Max 72 chars for header, optional body. Only output the commit message:\n\n$(cat)"
  }]
}
CURL_EOF
| python3 -c "import sys,json; print(json.load(sys.stdin)['choices'][0]['message']['content'])")

echo "Suggested commit: $COMMIT_MSG"
echo ""
read -p "Use this message? (y/n/edit): " choice

case $choice in
  y) git commit -m "$COMMIT_MSG" ;;
  e) git commit -e -m "$COMMIT_MSG" ;;
  n) echo "Commit cancelled. Write your own with: git commit -m '...'" ;;
esac

Add to VS Code task:

{
  "label": "AI Git Commit",
  "type": "shell",
  "command": "bash ${workspaceFolder}/scripts/ai-commit.sh",
  "presentation": { "reveal": "always", "panel": "shared" }
}

AI-Powered Code Review

Before submitting a PR, I run this to catch issues:

// scripts/ai-review.ts
import { execSync } from 'child_process';
import { OpenAI } from 'openai';

const client = new OpenAI();

async function reviewCurrentChanges() {
  // Get git diff of staged or uncommitted changes
  const diff = execSync('git diff HEAD').toString();
  
  if (!diff) {
    console.log('No changes to review');
    return;
  }
  
  console.log('🤖 Reviewing your changes...\n');
  
  const stream = await client.chat.completions.create({
    model: 'gpt-4o',
    stream: true,
    messages: [{
      role: 'user',
      content: `Review this git diff for:
      1. Logical bugs or edge cases
      2. Security vulnerabilities
      3. Performance issues
      4. Missing error handling
      5. Code style inconsistencies
      
      Be concise. Only flag real issues, not style preferences. Format as:
      [HIGH/MEDIUM/LOW] File:Line - Issue description
      
      Diff:
      \`\`\`
      ${diff.slice(0, 8000)} // Trim for context limit
      \`\`\``,
    }],
  });
  
  for await (const chunk of stream) {
    process.stdout.write(chunk.choices[0]?.delta?.content || '');
  }
  
  console.log('\n\n✅ Review complete');
}

reviewCurrentChanges();
// package.json scripts
{
  "scripts": {
    "review": "ts-node scripts/ai-review.ts"
  }
}

Run with npm run review before every PR.


AI-Assisted Debugging Workflow

When I hit a bug, I follow this workflow:

1. Run the failing code and capture output

npm run dev 2>&1 | tee /tmp/error.log

2. Send to JarvisX (or any AI) with context

cat /tmp/error.log | curl -X POST http://localhost:3721/debug \
  -H "Content-Type: application/json" \
  -d "{\"error\": \"$(cat /tmp/error.log | head -50 | python3 -c 'import sys,json; print(json.dumps(sys.stdin.read()))')\"}"

3. Get structured diagnosis The AI returns:

  • Root cause identification
  • File and line number (when determinable)
  • Suggested fix
  • Related issues to watch for

The .vscode/ Folder as Team AI Config

For team projects, I commit the .vscode/ folder with AI configurations so everyone gets the same setup:

.vscode/
├── settings.json    # Copilot instructions, editor config
├── tasks.json       # AI tasks (commit helper, review, test gen)
├── extensions.json  # Recommended extensions
└── launch.json      # Debug configurations
// .vscode/extensions.json
{
  "recommendations": [
    "github.copilot",
    "github.copilot-chat",
    "usernamehw.errorlens",
    "eamodio.gitlens",
    "humao.rest-client",
    "prisma.prisma",
    "bradlc.vscode-tailwindcss"
  ]
}

When someone clones the repo, VS Code automatically suggests installing all recommended extensions.


Productivity Metrics: Before vs After

After 6 months of this setup (tracked via WakaTime):

| Metric | Before AI Setup | After AI Setup | |--------|----------------|----------------| | Time to write boilerplate | 15 min | 2 min | | Time to debug TypeScript errors | 12 min | 4 min | | Time to write commit messages | 3 min | 30 sec | | Time to write test files | 45 min | 15 min | | Bugs caught before PR review | Low | High |

The biggest win isn't the obvious ones (autocomplete) — it's the debugging and PR review workflow that saves the most actual time.


Quick Setup Checklist

  • [ ] Install GitHub Copilot + configure project instructions in settings.json
  • [ ] Install Error Lens (show errors inline, not in gutter)
  • [ ] Add custom keybindings for AI actions
  • [ ] Create scripts/ai-commit.sh for automated commit messages
  • [ ] Add npm run review script for pre-PR code review
  • [ ] Commit .vscode/ folder with AI config for team consistency

The JarvisX VS Code extension mentioned here is available at: GitHub More developer tooling posts: Portfolio