My personal approach to staying safe from package supply-chain attacks (npm, PyPI, VS Code extensions, Claude Code plugins), written down so I can share it and reuse it.
This repo is not a tool you install. It's two things:
- A document that describes the security posture I run on my machine.
- A script that can reproduce that posture on another machine.
If you only read one file, read
PACKAGE_AWARE_PLATFORM_SETTINGS.md.
During the active npm/PyPI supply-chain incidents, "just npx it" or "let the editor
auto-update extensions" became real risks. So I tightened a handful of settings across
Claude Code and VS Code: no ad-hoc package execution, no silent updates, exact version
pins, audited installs. This repo captures those decisions in a form I can share with a
team and re-apply later instead of re-explaining from memory.
package_aware/
├─ README.md ← you are here
├─ PACKAGE_AWARE_PLATFORM_SETTINGS.md ← THE shareable summary (read this)
└─ package-aware-hardening/ ← a Claude Code skill that automates it
├─ SKILL.md ← how Claude runs this workflow
├─ scripts/
│ ├─ apply_package_aware_hardening.ps1 ← applies the posture to a machine
│ ├─ export_shareable_settings.ps1 ← regenerates the summary doc
│ └─ release.ps1 ← tags + publishes a GitHub Release from CHANGELOG.md
└─ references/
├─ settings-map.md ← every setting + the reason for it
└─ shareable-template.md ← the source the summary doc is built from
| Layer | File(s) | What it's for |
|---|---|---|
| Human-readable summary | PACKAGE_AWARE_PLATFORM_SETTINGS.md |
What to read or hand to a teammate. Describes the posture and gives copy-paste baseline snippets. It is generated from references/shareable-template.md. |
| Automation (a Claude Code skill) | package-aware-hardening/ |
Lets Claude Code (or you) apply the posture to a machine and regenerate the summary. Optional — the doc stands on its own. |
Open PACKAGE_AWARE_PLATFORM_SETTINGS.md. It's
organized by layer (Claude Code, VS Code, package ecosystems, GitHub, Supabase) with a
copyable snippet under each.
The apply script edits user-level config (~/.claude/settings.json, ~/.claude/CLAUDE.md,
and VS Code settings.json). It backs up every file first to
~/.claude/backups/package-aware-hardening/<timestamp>/.
# See what it would change — writes nothing:
powershell -ExecutionPolicy Bypass -File .\package-aware-hardening\scripts\apply_package_aware_hardening.ps1 -DryRun
# Actually apply it:
powershell -ExecutionPolicy Bypass -File .\package-aware-hardening\scripts\apply_package_aware_hardening.ps1It sets: DISABLE_AUTOUPDATER=1, autoUpdatesChannel=stable, allowedHttpHookUrls=[],
disableBypassPermissionsMode=disable, disables the Supabase plugin, adds the
package-manager + extension-install deny rules, sets VS Code updates to manual, and writes
a managed hardening block into CLAUDE.md.
CLAUDE.mdis never clobbered. The script writes its managed block only when there's no existing hardening section, or when a previous run left its<!-- PACKAGE-AWARE-HARDENING:START -->/<!-- PACKAGE-AWARE-HARDENING:END -->marker pair (which it then refreshes in place). If it finds a hand-written "Global hardening overrides" section without those markers, it leaves the file untouched and tells you so (ClaudeMdAction: skipped-existing-unmarked-section). So on the machine that authored the posture, apply safely no-ops onCLAUDE.md.
Edit the source (references/shareable-template.md), then:
powershell -ExecutionPolicy Bypass -File .\package-aware-hardening\scripts\export_shareable_settings.ps1This rewrites PACKAGE_AWARE_PLATFORM_SETTINGS.md and fails loudly if it detects a
username, home path, or C:\Users\... — the public doc must stay sanitized.
- Prefer exact version pins and committed lockfiles over
latestand loose ranges. - No ad-hoc fetch-and-run (
npx,pipx run,pnpm dlx,bunx,yarn dlx). - No silent editor/extension/CLI updates — keep a review window.
- Prefer standalone, auditable CLIs over marketplace/plugin paths.
- Treat the editor and CI as part of the supply chain, not separate from it.