Show file differences in VS Code from the shell - open side-by-side diffs of two files or git revisions using the code CLI, ideal for reviewing changes visually with the user.
---
name: vscode
description: VS Code integration for viewing diffs and comparing files. Use when showing file differences or git changes to the user side by side.
---
Uses the VS Code `code` CLI to present diffs visually.
## How to use
1. Ensure VS Code is installed with the `code` command on PATH.
2. Compare two files side by side with `code -d <file1> <file2>`.
3. For git diffs without extra config, dump the old version to a temp file and diff it, e.g. `git show HEAD~1:path/to/file > /tmp/old && code -d /tmp/old path/to/file`; use `git show :path` for the staged version.
4. Verify a file has history first with `git log --oneline -5 -- path/to/file`; the file must exist and differ between revisions.
Full skill & source: https://github.com/badlogic/pi-skills/tree/90bb51cae36515a648515b633a81c0c6efc8c74d/vscode