vscode

Opens file and git diffs in VS Code using the code CLI.

Updated Mar 12, 2026
One-click install
npx skills add https://github.com/RavitejaKarra24/dotfiles --skill vscode-ravitejakarra24
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vscode
Source: https://github.com/RavitejaKarra24/dotfiles/tree/main/pi/.pi/agent/skills/pi-skills/vscode
Command: npx skills add https://github.com/RavitejaKarra24/dotfiles --skill vscode-ravitejakarra24

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Reviewing file changes in a terminal is hard to read, and manually setting up side-by-side comparisons is tedious. This Skill lets you visually compare files and git revisions in VS Code's diff viewer with a single command. ## Core Features & Use Cases - File Comparison: Compare any two files side by side using code -d <file1> <file2>. - Git Revision Diffs: Extract a file from a previous commit, staged version, or specific commit hash to a temp file and diff it against the working tree. - Use Case: After refactoring a module, you want to show a teammate exactly what changed. Extract the version from the previous commit with git show HEAD~1:src/app.ts > /tmp/old and open code -d /tmp/old src/app.ts for a clean visual review. ## Quick Start Show me the diff of src/app.ts compared to the previous commit in VS Code.

Frequently Asked Questions about vscode

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I compare two files in VS Code from the command line?

Use the code CLI with the -d flag: `code -d <file1> <file2>`. This opens both files side by side in VS Code's built-in diff viewer, highlighting all differences between them.

How to view git diff of a file in VS Code?

Extract the old revision to a temp file with `git show HEAD~1:path/to/file > /tmp/old`, then run `code -d /tmp/old path/to/file`. This works for any commit hash, staged version, or branch reference.

Does the code -d command require any VS Code configuration?

No configuration is needed beyond having VS Code installed with the code CLI available in your PATH. On macOS, install the CLI via the VS Code command palette using 'Shell Command: Install code command in PATH'.

Why does git diff in VS Code show no changes?

The file must exist and have actual differences between the compared revisions. Verify the file has history first with `git log --oneline -5 -- path/to/file` before attempting the diff.

Can I compare the staged version of a file with the working tree?

Yes. Extract the staged version with `git show :path/to/file > /tmp/staged`, then run `code -d /tmp/staged path/to/file` to see unstaged changes against what is staged.