Skip to main content
skill CX Codex

vscode — Claude Code skill: what it does, how to install

Connects your coding agent to the VS Code diff viewer to inspect file changes side by side.

MIT 155 installs ★ 2,663 updated 2026-06-06

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add badlogic/pi-skills --skill vscode -a claude-code
Open on GitHub

What vscode does

The skill provides workflow rules for comparing code using VS Code rather than reading raw terminal patches. It instructs the assistant to trigger code -d <file1> <file2> whenever you need visual confirmation of changes.

For Git tracking, it relies on a temp-file pattern. The agent pipes output from git show into /tmp/old or /tmp/staged, then brings up the editor diff view against your working tree. You can inspect changes relative to HEAD~1, an explicit commit SHA, or the index.

The environment must have the editor installed with the code binary available inside PATH. It also validates that target files contain actual history using git log --oneline -5 -- path/to/file before attempting the diff.

What it helps with

  • launch side-by-side file comparisons in the editor
  • review uncommitted working tree changes against Git revisions
  • inspect staged Git modifications side by side

Example prompts for the agent

  • Compare my working file against the previous commit in VS Code
  • Show a side-by-side diff of schema.v1.json and schema.v2.json
  • Open the diff between staged changes and current file in VS Code

How to install vscode

1Skills CLI (Vercel)

npx skills add badlogic/pi-skills --skill vscode -a claude-code

2Manually: put the files in place

~/.claude/skills/vscode/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/vscode/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about vscode

How to install vscode in Claude Code?

Run npx skills add badlogic/pi-skills --skill vscode -a claude-code in your terminal. This creates the skill definition under ~/.claude/skills/vscode/SKILL.md.

What does the vscode skill do?

It gives the agent instructions to display code diffs and inspect Git history visually using the code -d command.

What prerequisites are needed for this skill?

VS Code must be installed locally, and its code executable must be reachable in your system PATH.

Source text

SKILL.md · MIT
---
name: vscode
description: VS Code integration for viewing diffs and comparing files. Use when showing file differences to the user.
---

# VS Code CLI Tools

Tools for integrating with VS Code, primarily for viewing diffs.

## Requirements

VS Code must be installed with the `code` CLI available in PATH.

## Opening a Diff

Compare two files side by side in VS Code:

```bash
code -d <file1> <file2>
```

## Git Diffs in VS Code

### Simple Approach (no config needed)

Extract the old version to a temp file, then diff:

```bash
# Compare with previous commit
git show HEAD~1:path/to/file > /tmp/old && code -d /tmp/old path/to/file

# Compare with specific commit
git show abc123:path/to/file > /tmp/old && code -d /tmp/old path/to/file

# Compare staged version with working tree
git show :path/to/file > /tmp/staged && code -d /tmp/staged path/to/file
```

### Gotchas

- File must exist and have changes between the compared revisions
- Use `git log --oneline -5 -- path/to/file` to verify file has history before diffing

## When to Use

- Showing the user what changed in a file
- Comparing two versions of code
- Reviewing git changes visually

© badlogic · MIT · badlogic/pi-skills

Similar skills

All skills for Code review and refactoring →

From the same set8

Project sponsors

Companies that keep this analytics open