Dev Env Diff

VS Code extension that kills "works on my machine".
Record → compare → investigate. Capture your environment, compare it with a teammate's or a previous capture, and see suggested checks before digging into raw data. Snapshots are manual, with an optional capture on startup — this is not a continuous flight recorder.
100% local. No telemetry. No network calls (except the explicit Import from URL command).
What gets captured
| Category |
Sources |
| Host |
platform, arch, kernel release |
| Runtimes |
node, npm, pnpm, yarn, python, go, java, ruby, rustc, dotnet, git |
| Docker |
engine version, containers (incl. compose) with state + ports |
| Ports |
listening TCP via lsof / ss / netstat |
| Env |
.env* keys and process.env (masked by default) |
| Scripts |
package.json, Makefile, .vscode/launch.json, docker-compose.yml |
| Lockfiles |
SHA-256 of package-lock.json, yarn.lock, pnpm-lock.yaml, Pipfile.lock, poetry.lock, go.sum, Cargo.lock, Gemfile.lock, composer.lock, requirements.txt |
| Git |
branch, commit, dirty, remote, ahead/behind upstream |
| VS Code extensions |
id + version of every installed (non-builtin) extension |
| Shell config |
SHA-256 fingerprints of ~/.zshrc, ~/.bashrc, fish config, .tool-versions, .nvmrc, … |
| PATH |
ordered list of $PATH entries (order matters for shadowing) |
Snapshots land in <project folder>/.dev-env-diff/ as snapshot-<timestamp>-<host>-<id>.json. This folder is excluded from the Git “uncommitted changes” check, so saving a snapshot never makes the next one look dirty. Unique IDs prevent repeated imports from overwriting an existing snapshot. Files are published through a temporary sibling and rename, so readers do not see partially written JSON on local filesystems. Without an open workspace, snapshots are saved and listed in the extension's global storage.
Retention also applies to imports. The snapshot explicitly being imported is kept even if its capture date is old; older stored snapshots are moved to Trash as needed. File watching follows changes to snapshotDir and workspace folders.
Comparisons ignore process PIDs, container uptime text, and JSON object key order. Image, container state, port, and listening-process changes still count as drift. Failed or explicitly disabled collection categories are excluded from comparison and shown as warnings, rather than treated as empty data. Recommendations are suggestions for manual review, never automatic actions; container drift does not trigger a recommendation to stop an entire Compose stack.
Project baseline: one-click checks
- Record a snapshot while your project works, then right-click it → Set as Project Baseline (or choose Set as baseline right after recording).
- Whenever something breaks — after an upgrade, a pull, a new laptop — click Check Against Baseline (check icon in the Snapshots view, or the status bar item).
- The extension records the current state and compares it with the baseline (A = baseline, B = now). If everything matches and every check succeeded you get a short confirmation; otherwise the comparison opens with suggested checks.
The baseline is stored in the snapshot itself, survives restarts, is never removed by retention, and can be replaced at any time (with confirmation). Imported or shared snapshots never carry the baseline mark.
Which folder is inspected
The project folder is shown next to the Snapshots title (Project: …). If the open folder has no supported project files — for example your home directory — the extension says so before recording and offers Choose Project Folder, which lists projects detected up to two levels below the workspace, all workspace folders and a folder browser. The choice is remembered per workspace. In multi-root workspaces the first folder that is a project is used until you choose another. Snapshots and the baseline are stored per project.
A snapshot taken outside any project is still useful for machine-level data, but its project scripts, dependency files, .env files and Git are not compared — they are not reported as missing.
Honest results
Every project and shell file is read with one of three outcomes: absent, could not be read (for example permission denied) or could not be parsed (invalid JSON/YAML, oversized). Only truly absent files count as missing. Unreadable or broken files are listed under Comparison incomplete, and only the entries from that file are excluded; everything else is still compared. launch.json is parsed like VS Code parses it (comments and trailing commas allowed) and Compose files with a real YAML parser (any indentation, flow style, merge keys; alias expansion is bounded).
Usage
- Activity Bar → Dev Env Diff → Record Snapshot, or import a teammate's JSON from the welcome screen. With one snapshot, the view explains how to get a second.
- Click a snapshot row to choose A — reference, then another for B — compared. Or right-click and use Use as Reference (A) / Use as Compared (B). Names use your label or the machine name, with branch and time as secondary text. Raw JSON opens only through an explicit action.
- Read the summary and Suggested checks. Expand coverage to distinguish failed checks from switched-off collection. Differences are not a diagnosis.
- Change either side or Swap A and B in the header. Search names/values, filter by category or status, and expand Full comparison data when needed. Filters, expansion and scroll are retained for the current comparison; filters affect the list, not the complete report or suggestions.
- Copy Markdown only copies; Save report… only saves to a chosen file. Compare with previous after recording really uses the previous capture as A and the new capture as B, without a picker.
- Share Snapshot… creates a copy with env values omitted, workspace folder removed, HTTP repository credentials removed and home paths stripped. Preview it, save JSON or copy JSON. Other sensitive content can remain in scripts, paths and metadata — review before sharing. Nothing is uploaded.
Commands
| Command |
Description |
Dev Env: Record Snapshot |
Capture current environment. |
Dev Env: Check Against Baseline |
Record now and compare with the project baseline. |
Dev Env: Set as Project Baseline |
Mark a known working snapshot as the reference (right-click). |
Dev Env: Remove Baseline Mark |
Keep the snapshot, remove the mark. |
Dev Env: Choose Project Folder… |
Choose which folder to inspect; remembered per workspace. |
Dev Env: Choose Two Snapshots… |
Choose stored or external JSON captures. |
Dev Env: Compare Latest Two |
Compare previous A with latest B, without prompts. |
Dev Env: Use as Reference (A) / Use as Compared (B) |
Assign a side explicitly. |
Dev Env: Swap A and B |
Reverse the reference and compared environments. |
Dev Env: Name Snapshot… |
Add a memorable label without renaming the stored file. |
Dev Env: Copy Markdown Report |
Copy the complete report; no editor tab or file is created. |
Dev Env: Save Markdown Report… |
Save the complete report to a chosen Markdown file. |
Dev Env: Share Snapshot… |
Preview/save/copy JSON with env values removed. |
Dev Env: Import Snapshot JSON… |
Import a local JSON file. |
Dev Env: Import Snapshot from Clipboard |
Paste a snapshot JSON. |
Dev Env: Import Snapshot from URL… |
Fetch a snapshot over HTTP(S) (≤ 5 MB, ≤ 10 s). |
Move Snapshot to Trash (context menu) |
Confirm removal; never deletes permanently as a fallback. |
Dev Env: Refresh |
Refresh the Snapshots view. |
Dev Env: Preferences |
Open extension settings. |
Settings
| Setting |
Default |
Description |
devEnvDiff.envValueMode |
keysOnly |
keysOnly / masked / full. full is not recommended. |
devEnvDiff.excludePorts |
[] |
Ports to omit from snapshots. |
devEnvDiff.stripHomePaths |
true |
Replace $HOME with ~ in stored strings. |
devEnvDiff.autoSnapshotOnStartup |
false |
Auto-record on workspace open. |
devEnvDiff.snapshotDir |
.dev-env-diff |
Folder for snapshots, relative to the project folder; ignored by the Git dirty check. |
devEnvDiff.execTimeoutMs |
5000 |
Per-command timeout (500…60000 ms). |
devEnvDiff.retentionKeep |
50 |
Keep the last N snapshots (1…1000) plus the baseline. |
devEnvDiff.collectExtensions |
true |
Record installed VS Code extensions. |
devEnvDiff.collectShellRc |
true |
Hash shell rc files (~/.zshrc, ~/.bashrc, …). |
devEnvDiff.collectPath |
true |
Record $PATH entries (ordered). |
Privacy & Security
- No telemetry and no network calls except the explicit Import from URL command.
- Env values are keys-only by default; secrets are masked even in
masked mode by pattern (secret, token, password, api_key, …).
- Home-directory paths are replaced with
~ before persistence.
- Sharing removes all env values from a separate copy; it is not a complete secret scanner. Reports contain the captured data, so review them before sharing, especially if
envValueMode was set to full.
- All external commands run without
sudo, with a bounded timeout and 4 MB output cap.
- Remote imports are capped at 5 MB and a 10 s total deadline (including redirects and body download), with at most 5 redirects; only
http/https URLs accepted. Imported snapshots are structurally validated before saving.
- For vulnerability reports, see the bundled
SECURITY.md (in the extension folder).
Snapshot schema (v3)
{
"schemaVersion": 3,
"timestamp": "2026-05-25T09:14:10Z",
"tag": "before-upgrade",
"host": { "platform": "darwin", "arch": "arm64", "release": "23.0.0" },
"git": { "available": true, "branch": "main", "commit": "abc1234", "dirty": false },
"runtimes": { "node": "20.11.1", "python": "3.12.3" },
"docker": { "available": true, "version": "26.1.1", "containers": [] },
"ports": [{ "port": 3000, "protocol": "tcp", "process": "node" }],
"env": [{ "key": "DATABASE_URL", "source": "dotenv", "file": ".env" }],
"scripts":[{ "source": "package.json", "name": "dev", "command": "vite" }],
"lockfiles":[{ "file": "package-lock.json", "manager": "npm", "sha256": "…", "size": 12345 }],
"extensions":[{ "id": "ms-python.python", "version": "2024.1.0", "builtin": false }],
"shellRc": [{ "file": "~/.zshrc", "sha256": "…", "size": 4096 }],
"path": ["/opt/homebrew/bin", "/usr/local/bin", "/usr/bin", "/bin"],
"warnings": []
}
v1 and v2 snapshots are auto-migrated to v3 on read. Categories not recorded by those versions are marked unavailable, not interpreted as empty.
New v3 snapshots can include optional collection metadata, for example:
{
"collection": {
"runtimes": { "status": "ok" },
"ports": { "status": "error", "message": "listener probe unavailable" },
"extensions": { "status": "disabled" }
}
}
Older v3 snapshots remain readable; their collection status is unknown when metadata is absent. A successful but empty collection remains distinct from a failed or disabled one.
New snapshots also include optional runtimeStatus entries using the same status shape, keyed by tool name. A timed-out or unparseable version probe is excluded individually, while other tools are still compared. A confirmed missing executable can still receive installation advice. Both python and python3 probes are preserved; legacy snapshots that deduplicated Python aliases are handled conservatively.
Feedback
Bug reports, support and feature requests: contact@alekseialeinikov.com.
Publisher website: alekseialeinikov.com.
License
MIT © Aleksei Aleinikov