Gnawky manual
Gnawky docs
Gnawky is a local security scanner for Node.js projects. It runs proven open-source scanners in one go, puts every finding in one report, and lets you decide finding by finding: fix, ignore with a reason, or skip.
Fixes are applied safely: on a new git branch, with install scripts turned off, checked with your own tests if you want, and audited again afterwards. Guards stop risky packages before they reach your project, and a Claude Code plugin explains findings in plain language and applies fixes only after you agree.
npm install, commits and pushes.
Claude CodeAsk in plain words: "gnawky anything critical?"
Command lineEvery command and flag, plus CI mode.
How it works, in short
- Scan. Gnawky runs
npm auditoryarn audit, a check of the React that Next.js bundles, gitleaks for secrets and semgrep for risky code. Scanning is read-only. - Prioritize. Findings are grouped by the package you'd upgrade, and critical and high findings that ship to production come first.
- Decide. Go through them one by one. Optionally, Claude first labels each one as a real issue or a likely false positive.
- Fix safely. Confirm a plan, and Gnawky applies it on a new branch. You keep it or undo it in one step.
Install
Gnawky needs Node 18 or newer and has no npm dependencies of its own. Install it globally with npm or Yarn 1, or try it once with npx:
npm install -g gnawky # npm yarn global add gnawky # Yarn 1 (classic) npx gnawky # run it once, without installing
It works the same however you install it: Gnawky checks which package manager the scanned project uses. Yarn 2+ has no global installs, so on Yarn 2+ use npm or npx to install Gnawky itself.
The pre-commit and pre-push hooks and the package check call the gnawky command, so they need a global install. With npx only, they skip themselves quietly.
Optional scanners
The dependency audit works out of the box. gitleaks and semgrep are optional but recommended; Gnawky offers to install them during setup, or you can do it yourself:
brew install gitleaks semgrep # macOS pipx install semgrep # alternative for semgrep
From source
Clone the repository and run npm link inside it.
Updating
Run the install command again (npm install -g gnawky). If you use the package check, Gnawky updates its shell block automatically when a new version changes it.
First run
Start Gnawky inside the project you want to scan, the folder with package.json:
cd ~/code/my-app gnawky
The first time, a short setup runs. You can run it again later from Settings.
- Your project. Gnawky detects the stack (TypeScript, Express, React, Next.js, Docker, GitHub Actions, databases, auth libraries), checks for a lockfile and git, and warns if a
.envfile isn't ignored by git. It only readspackage.jsonand file names. - Network access. Choose Online (recommended) or Offline.
- Online: the dependency audit sends your dependency list to the npm registry, semgrep downloads its rulesets, and the AI tools are available.
- Offline: nothing leaves the computer. Only gitleaks runs, unless you add a local semgrep rules file, and the AI tools are off.
gnawky --offlinepre-selects Offline. - Recommended tools. Gnawky shows which scanners fit the project and which are missing, and installs them with Homebrew (or pipx for semgrep) if you agree. It also recommends the package check, the pre-commit check and the pre-push warning when they aren't on yet.
- First scan. It saves semgrep rules that match your stack (for example
p/expressjs,p/react,p/dockerfile) and offers to run the first scan.
What it checks
| Scanner | Finds | Required? |
|---|---|---|
npm audit / yarn audit | Known-vulnerable dependencies, from package-lock.json or a Yarn 1 yarn.lock | Yes. npm comes with Node; Yarn projects need yarn. |
| Next.js bundled React | React Server Components advisories in the copy of React that Next.js bundles, which npm audit can't see | Built in, Next.js projects only. Needs node_modules and Online mode. |
| gitleaks | Secrets in files and git history | Optional, recommended |
| semgrep | Risky code: injection, XSS, unsafe eval and more | Optional, recommended |
| Full audit (Claude) | Flaws in your own logic that pattern scanners miss, like access control and auth flows | Optional, started from AI tools |
- Nothing is silently ignored. A missing optional scanner is reported as "skipped".
- Live progress. Each scanner shows a line with a running clock, and the summary lists how long each one took.
- No hanging. semgrep stops after 30 minutes with a clear message.
- Secrets stay secret. gitleaks runs with
--redact, so secret values are never written to the reports.
Next.js bundled React
Next.js ships its own copy of React's server code and patches it without changing its version, so neither npm audit nor a version check can tell whether your Next.js has a given React fix. Gnawky reports only what is certain: React Server Components advisories disclosed after your installed Next.js was released, which that release can't contain. It stays quiet for newer releases; once Next.js publishes its own advisory, npm audit reports it.
Release dates come from the GitHub API (60 requests an hour without a token; set GITHUB_TOKEN for more) and are cached in .gnawky/cache/.
semgrep rules
By default semgrep uses p/javascript and p/nodejsscan, plus rules for your stack picked during setup. Change them in Settings, or pass --semgrep-config in headless mode. Test and mock files (__mocks__, __tests__, fixtures, test(s)/, *.spec.*, *.test.*) are skipped by default, which is much faster on big projects; gitleaks still scans them for secrets.
Reports
Every scan writes three files to .gnawky/:
| File | Contents |
|---|---|
security-report.html | A single self-contained file (no external scripts, styles or fonts, so it works offline): severity tiles, a scanner summary, every finding with full details, filters by severity, tool and production scope, and a text search. Each finding starts with Claude's take (verdict, urgency and reason) once a triage exists, then the suggested fix. Dark mode, and it prints cleanly. |
security-report.md | The same report in Markdown, handy for tickets and PRs. |
findings.json | Machine-readable findings, one entry per advisory. |
Open the report from View report, or with gnawky report --open. Both reports group advisories the same way as the app, include Claude's verdicts once a triage exists, and then list findings in Claude's order (the HTML report's Sort menu switches back to production first). In CI, keep the HTML report as a build artifact.
Production first
Every dependency finding says whether it ships to production. Gnawky works this out from package.json, without Claude:
- A package that one of your
dependenciesbrings in counts as production. - One that only
devDependenciesbring in counts as dev-only. - Test and lint tools (jest, vitest, eslint,
@types/…) count as dev-only even when they're listed underdependencies, and the finding suggests moving them. - In Next.js projects, devDependencies that aren't test or lint tools count as production, because the app can bundle them.
- Code and secret findings always count as production, and so does a finding whose dependency path can't be found, to be safe.
Critical and high findings that ship to production come first everywhere: the header ("53 to fix for production first"), Browse and Review & fix, both reports (with a Fix for production first tile and an All / Production only / Dev only filter in the HTML), the workspace view, and gnawky findings (--prod-only hides dev-only findings). Claude triage then checks whether the vulnerable code is actually used; its filter starts with production critical and high only, so it reads far fewer findings.
Several projects (workspaces)
Start Gnawky in a folder that holds several projects and has no package.json of its own, for example ~/code/acme with an API, a shared library and two apps:
cd ~/code/acme gnawky
- Pick the projects that belong together. The list shows which ones use each other.
- See how they're linked. Gnawky reads each
package.jsonand lockfile and shows who uses whom, at which installed version, and when projects use different releases of a shared one (a fix there only reaches the projects that move to it). It also suggests a fix order: shared projects first, then the ones that use them. - Check every project's dependencies (npm/yarn audit plus the React bundled in Next.js) in one go. The results show advisories found in more than one project, and the advisories each shared project brings into the projects that use it. The workspace report starts with the link map and lists the projects in fix order; click a project in the map to open its findings.
Open a project to fix, ignore, triage, or run secret and code checks: it opens the normal Gnawky inside that project, straight in its Findings menu, using the workspace's results so it isn't scanned twice. Leaving it brings you back to the workspace. Full scan there adds secrets and code checks.
Claude triage works across the workspace too, right after a scan or from the menu, one project at a time; verdicts are saved in each project's .gnawky/triage.json.
Results go to .gnawky/ in the workspace folder (workspace.json, workspace-findings.json, workspace-report.md and .html, with a map of the links). The workspace scan writes nothing into the projects; only Claude triage saves its verdicts there.
gnawky workspace # list the projects and how they use each other gnawky workspace --projects api,web,utils # pick projects (saved for next time) gnawky workspace scan # check them all and write the workspace report gnawky workspace report # show the last workspace scan
npm, Yarn and lockfiles
Gnawky needs a package-lock.json or a Yarn 1 (Classic) yarn.lock. pnpm and Yarn 2+ (Berry) lockfiles aren't supported yet.
More than one lockfile (say a stale, git-ignored package-lock.json in a Yarn project)? Gnawky decides by, in order: the packageManager field in package.json, the lockfile committed to git, the one git doesn't ignore, then the most recently changed. It tells you which one it chose and why in the fix plan and the workspace notes.
How Yarn projects are fixed
Gnawky uses yarn audit and works out a fix for each vulnerable package, without extra registry calls:
- Direct dependency: the version in
package.jsonis raised to the first patched version (exact pins stay exact,^/~ranges keep their operator), thenyarn install. - Installed by other packages, and the patch fits their ranges: the vulnerable
yarn.lockentries are re-resolved, the Yarn equivalent ofnpm audit fix. - Installed by other packages that pin an old version: a
"resolutions"override inpackage.json. See Forcing a sub-dependency.
Upgrades run before overrides, and an override is skipped when an earlier upgrade already removed the vulnerable versions.
Review & fix
Findings → Review & fix walks you through the findings one at a time. For each one you choose:
- Fix: add it to the fix plan.
- Ignore, with a reason: hide it, with the reason saved for your team. See Ignoring.
- Skip: decide later.
Nothing happens until you confirm the final plan. The plan lists every step in the order it will run, which upgrades are major (breaking) ones, and the branch it will use.
The order
- Review & fix goes production first: critical and high findings that ship to production, then the rest. Items Claude marked as likely false positives move to the end, labelled as such.
- Review & fix in Claude's order appears once a triage exists, and is then listed first: fix now, then fix soon and low priority, then findings Claude hasn't triaged, then likely false positives.
- If Claude hasn't triaged anything yet, or a rescan found new findings your last triage's filter would have covered, Gnawky first offers a triage (once per session; Settings turns this off).
Browse findings
Open any finding for its full details and act on just that one. On a grouped item you can fix, ignore or ask Claude about all its advisories at once, or open a single advisory.
Grouped advisories
Dependency advisories that one change fixes are one item, so an old Next.js with 36 advisories is one decision instead of 36. Items are grouped by the package the fix upgrades: a postcss advisory fixed by upgrading next sits in the next item, as "Also covers: postcss (4)".
Partial fixes are spelled out. npm audit suggests one version per package even when it fixes only some of its advisories. For next 14.0.0 it suggests 14.2.35, which leaves 23 of 36 open. Gnawky checks each advisory's vulnerable range against that version and lists the ones it doesn't fix separately, with the version they need ("Fixing all of them needs a release of next after 15.5.27"). For packages installed by the upgraded one, npm's expectation can't be checked before the fix; the audit after the fix shows what was really fixed.
- Ignoring an item ignores each of its advisories, so a new advisory for that package still shows up.
- Browse and both reports group the same way;
findings.jsonstays one entry per advisory. - Claude's triage still judges each vulnerable package on its own, so a grouped item shows Claude's take for each one and is ranked by the most urgent.
Verified fixes
Before applying dependency fixes, you can have Gnawky run your test, build, lint and typecheck scripts before and after the change. This runs your project's own code, so it's opt-in every time and shows the exact commands.
- One at a time (the default) applies and checks each upgrade separately, so you know which one broke something. All at once is faster.
- It also checks
npm ls(oryarn check --verify-tree) for broken dependency trees, warns about packages that don't support your Node version, and compares the audit before and after. - Then you keep the branch, undo everything, or have Claude fix a failure.
When an upgrade breaks your scripts
With one at a time, Gnawky stops and asks instead of undoing the change:
- Fix it with Claude: Claude adapts your code, tests or config to the new version, you approve each change, then the scripts run again and the upgrade stays if they pass.
- Run them again after your own change.
- Undo this change and go on with the next one.
- Keep it anyway.
With all at once, the results screen offers Fix it with Claude the same way. Code changed this way goes in the same commit; Undo only reverts the dependency changes and tells you which other files stay.
When npm refuses an upgrade
For a peer dependency conflict or an override, the results screen shows why, keeps the full output in .gnawky/fix-failed-<package>.log, and offers Fix the failed upgrade with Claude. Claude explains the conflict, proposes ways to do it (for example upgrading related packages together) and makes the change you pick, asking before every change and install. Install scripts stay disabled. Back in Gnawky, it checks the new version is installed, runs your scripts and the audit again, and updates the results.
Uncommitted changes
A fix starts from a clean state on a new branch. If you have uncommitted changes, Gnawky offers to stash them (git stash, untracked files included) and continue. Undo gives them back right away. After Keep, the main menu offers Restore your changes stashed before the fix once you're back on the branch you started from (or run git stash pop). gnawky fix on the command line asks you to commit or stash first.
When tests already fail
Gnawky runs your scripts once before changing anything. If they already fail, it says so and lets you choose:
- Fix them first with Claude. Claude Code opens with the failing output and fixes only the scripts or tests, without touching dependencies. You approve each change; afterwards Gnawky offers to commit them on the branch you started from, then runs the scripts again.
- Run them again, for example after you fixed something yourself.
- Go on with the fix anyway. The results then compare against the failures that were already there.
- Cancel.
The before-run is reused for the fix, so the scripts don't run twice.
Forcing a sub-dependency
When a vulnerable package is only installed by other packages and they pin an old version, npm audit fix can't help. Gnawky then forces the lowest patched version: with "overrides" in npm projects and "resolutions" in Yarn projects, looking up the published versions with npm view from the registry your project uses.
- Forced versions are labelled risky, and breaking when they cross a major version.
- Gnawky never moves healthy copies of a package to another major version; in that case it suggests a nested (path-specific) override instead.
Before the plan runs, Gnawky asks how to write each forced version and marks one as recommended:
| Choice | Means | Recommended when |
|---|---|---|
^2.5.6 (range) | Later 2.x releases still arrive, including future security fixes. | By default. |
2.5.6 (exact) | Stays on that version until you change it. Pick this if a newer release is broken. | package.json already pins that package exactly, or the project pins its dependencies exactly (save-exact, or every dependency is an exact version). |
To force a version Gnawky didn't suggest (an older one, because the latest has a bug), edit the entry yourself: Gnawky keeps it, and recommends keeping it exact the next time it has to change it. On the command line, --pin caret or --pin exact picks the other choice.
Keep, undo and the fix log
After a fix runs, the results screen shows each step (applied, skipped, reverted, failed), your scripts before and after, new dependency problems, and the audit afterwards: fixed, still open, and new. Then you choose:
- Keep: the branch stays, with the changes uncommitted so you can review them with
git diff. Gnawky prints the commit command. - Undo: back to the branch you started from, and the fix branch is deleted.
Until you choose, no other fix can start. On the command line: gnawky fix --keep or gnawky fix --undo.
Fixed advisories log
When you keep a fix, Gnawky saves the advisories it removed, with their GHSA and CVE IDs, to .gnawky/fixes/<date>.json and a .md table ready to paste into a PR or ticket. The list comes from the audit run after the fix; without one (offline, or the dependency scanner off) it lists what the applied changes target, and says so. npm audit doesn't report CVE IDs, so for npm projects they're looked up from the GitHub advisory API (up to 40 per fix).
Browser smoke test
After a dependency fix, the results screen offers Smoke test in the browser with Claude. It's optional and needs Claude Code plus Chrome with the Claude in Chrome extension; it's off in offline mode. The first time, you set it up for the project:
- The app's local URL. Gnawky guesses one from the dev script.
- Who starts the app. Gnawky runs a script it finds (
dev,start, …), waits for the URL and stops the app after the test. Or you start it yourself and Gnawky waits until the URL answers. - The pages to check, as paths such as
/, /cart.
Claude Code then opens with --chrome and visits each page: it checks that the page renders, reads console errors and failed requests, and looks harder at features that use the upgraded packages. You watch, and can step in when a page needs a login. Claude only writes its report, to .gnawky/smoke/. When you exit Claude, the results screen shows PASS, FAIL or PARTIAL, and you still choose Keep or Undo.
What Claude sees in the browser is sent to Anthropic, so test a local or test environment, not production.
Later: if you keep a fix without a smoke test, Gnawky remembers the fix branch. While you're on it, the main menu offers Smoke test the fix on <branch> in the browser, and the header shows the last result.
Ignoring with a reason
Some findings don't apply to you: a vulnerable function you never call, a package only used in build scripts. Ignore them with a reason, from Review & fix, Browse, or the command line:
gnawky ignore lodash --reason "only used in build scripts" gnawky ignore GHSA-35jh-r3h4-6jhm --reason "we never call _.template"
- Targets can be finding IDs, GHSA or CVE IDs, or a package name, which ignores its whole grouped item.
- Ignores are saved in
.gnawky-ignore.jsonin the project, with the finding's title, your reason and the date. Commit this file so your team shares the decisions and the reasons. - New advisories for the same package still show up.
- Findings → Ignored findings lists every ignore with its reason, and restores any of them.
- Ignored findings don't block the pre-commit check and are left out of the pre-push warning.
Claude triage
AI tools → Triage findings has Claude read your code and label each finding:
- a verdict: real issue, likely false positive, or needs a human;
- an urgency: fix now, fix soon, or low priority;
- and a short reason.
You tick which severities (critical, high, …) and sources (dependencies, code, secrets) to triage, and see how many Claude runs that takes before you start. The default is critical and high findings that ship to production. Up to 3 runs can go at the same time: faster, same tokens, heavier on rate limits. Your choice is remembered per project.
- Read-only: Claude can't edit files or run commands during triage.
- Efficient: advisories are grouped per package and secrets per file, so each package or file is checked once.
- Saved: results go to
.gnawky/triage.json, are kept across rescans, and show in Browse, Review & fix and both reports. - Suggestions only: nothing is fixed or ignored automatically.
- Secrets protected:
.envfiles, keys and.npmrcare blocked. For files gitleaks flagged, Claude reads a temporary copy with the flagged lines hidden; Gnawky re-scans each copy with gitleaks first and keeps the file blocked if anything is still found.
Needs Claude Code; off in offline mode; not on Windows yet. On the command line, gnawky triage shows the plan (what would be sent, how many runs, an estimate) and gnawky triage --yes runs it.
Full security audit
AI tools → Run a full security audit starts Claude Code with the bundled security-audit skill by Cloudflare. It audits the codebase for what scanners miss (broken access control, injection, data leaking between users, unsafe auth flows), and a separate verifier checks every candidate.
| Size | What runs |
|---|---|
| Quick | The whole project, one pass. |
| Full | The whole project with the standard workflow. Often 30+ minutes and a lot of tokens on a real project. |
| Custom | Tick folders in a tree (open folders to pick subfolders), then choose the quick, standard or deep profile and an optional cap on sub-agents. The report marks everything else out of scope. Remembered per project. |
Reports go outside the project, to ~/security-audit-skill/<project>-<id>/run-N/ (REPORT.md, findings.json, NEEDS-VALIDATION.md). When you exit Claude, Gnawky imports the confirmed findings as a fourth source, claude-audit, with severity, trace, conditions and fix strategy, and keeps them on every later scan. Credentials files and files flagged for secrets are blocked for the session.
Ask Claude for help
AI tools → Ask Claude for help starts Claude Code with the scan results, so you can ask anything about them. A privacy notice comes first: anything Claude reads is sent to Anthropic. Claude is told not to open .env files, keys, or files flagged as containing secrets; for a hard block, add deny rules in Claude Code's permission settings. Needs Claude Code; off in offline mode.
Three layers stop vulnerable packages at different moments. Each one is turned on in Settings, and the first-run setup recommends them.
| Guard | When | Blocks? | Covers |
|---|---|---|---|
| Package check | npm install <pkg>, yarn add | Asks first | Your terminal, every project |
| Pre-commit check | git commit that changes a lockfile | Only new high/critical | The repository (shared via husky) |
| Pre-push warning | Every git push | Never, only warns | The repository (shared via husky) |
Check before npm install
Turn on Settings → Check packages before npm install / yarn add and Gnawky checks every package you add, including commands pasted from the web. It applies to every project on the computer.
When you run npm install <pkg> (or npm i, npm add, yarn add, yarn workspace <name> add), Gnawky first resolves the new packages in a temporary folder with npm install --package-lock-only --ignore-scripts: nothing is downloaded into your project and no install scripts run. Only packages that aren't already in your lockfile are checked.
$ npm install [email protected] ✖ 1 new package checked, 2 problem(s) (2s) ✖ HIGH [email protected]: Command Injection in lodash ✖ HIGH [email protected]: lodash vulnerable to Code Injection via `_.template` imports key names • MEDIUM [email protected]: Regular Expression Denial of Service (ReDoS) in lodash Recommended: [email protected] fixes these advisories → npm install [email protected] gnawky: install anyway? [y/N] n gnawky: not installed. Nothing was changed.
What it asks about
- High and critical advisories, including malware advisories.
- Versions published in the last 2 days, before most malicious releases are caught.
- Install scripts and lower-severity advisories are shown without a question.
The recommended version
For each flagged package Gnawky recommends the lowest version outside every advisory's range, says whether it's the latest, and rewrites your command to use it. It recommends a version only after a real npm audit of that version's dependency tree finds no high or critical advisories. When there's no fixed version, it says so.
Good to know
- Everything else runs unchanged:
npm install,npm run …,yarn build. Global installs, git URLs, local paths and tarballs aren't checked. - Skip it once:
GNAWKY_SKIP=1 npm install <pkg>. - Never breaks an install: if the check can't run (no network, a resolution error, offline mode in that project), the command runs as usual with a note. If Gnawky can't start, the command runs; Ctrl+C during the check stops it.
- How it's installed: a few shell functions in a marked block in
~/.zshrc(for bash:~/.bash_profileon macOS,~/.bashrcelsewhere). Settings removes the block again. - Node version managers: works with nvm (also lazy loading), fnm, Volta, asdf and corepack. When Gnawky isn't installed for the Node version in use, you get a one-time note and the command runs unchecked.
- Privacy: advisories come from your configured registry, like
npm audit. Publish dates come from deps.dev, only for packages from the public npm registry, so private package names never leave your registry. - Limits: it covers your own terminal (zsh and bash), not CI, IDE buttons or teammates. A malicious package published hours ago has no advisory yet; the 2-day check is the only signal for those.
Pre-commit check
The package check only covers your terminal. The pre-commit check is the next layer: turn it on in Settings → Pre-commit dependency check. When a commit changes package-lock.json or yarn.lock, Gnawky audits the dependencies in the commit, compares them with the last commit, and blocks the commit only if it adds high or critical findings.
$ git commit -m "Add lodash" ✖ package-lock.json: 2 new finding(s), 2 lower-severity (1s) HIGH lodash: Command Injection in lodash Non-breaking update available (npm audit fix). HIGH lodash: lodash vulnerable to Code Injection via `_.template` imports key names Non-breaking update available (npm audit fix). Commit blocked: this commit adds 2 high/critical finding(s). Fix them (gnawky → Findings), ignore them with a reason in gnawky, or commit anyway with git commit --no-verify.
- Old findings never block, so a project with known issues can still commit. Ignored findings don't block either.
- Never blocks for its own problems: in offline mode, without a network, if the audit fails, or for teammates who don't have Gnawky installed, the commit goes through, with a note.
- Commit anyway with
git commit --no-verify. - Run it by hand with
gnawky pre-commit;--min-severity criticalblocks only critical findings.
Pre-push warning
The pre-commit check only looks at what a commit adds. The pre-push warning reminds you of what is already there: turn it on in Settings → Pre-push production warning. Before every git push, Gnawky lists the packages with critical or high advisories that ship to production, old ones included, grouped by the package to upgrade.
$ git push ! my-app: 2 package(s) with critical/high advisories ship to production (2s) HIGH axios 11 advisories: upgrade axios to 1.12.0 (direct dependency) HIGH express 6 advisories: upgrade express to 4.22.3 (direct dependency) gnawky: pushing anyway; this is a reminder, not a block.
- It never blocks. The push always goes through, also when the audit fails or the project is offline.
- A fresh audit on every push, so advisories published since your last scan show up too. It usually takes a few seconds. If the audit fails (no network, registry down), Gnawky shows the last results for the same dependencies, with their date and a note that newer advisories are missing.
- Production only, worked out like Production first. Dev-only packages and ignored findings are left out.
- Every project in the repository: each folder with a lockfile tracked by git is checked, so it works in monorepos.
- Run it by hand with
gnawky pre-push(--jsonfor scripts), or ask Claude with/gnawky:prod.
Where the hooks go
Gnawky installs the pre-commit and pre-push hooks where your project already keeps its hooks:
| Your setup | Where Gnawky adds the hook | Shared with the team? |
|---|---|---|
| husky | .husky/pre-commit, .husky/pre-push | Yes, when you commit those files |
Another core.hooksPath | That folder | If that folder is committed |
| Plain git | .git/hooks/ | No, this clone only |
| lefthook | Gnawky shows a snippet for lefthook.yml, because lefthook rewrites its hook scripts | Yes, via lefthook.yml |
- Existing hooks keep working. Gnawky adds a marked block at the top and removes only that block when you turn it off.
- Teammates without Gnawky aren't affected: the block checks that the
gnawkycommand exists first. - Other pre-push tools keep working: the pre-push block reads nothing from the hook's input, so tools like git-lfs still get it.
Install the plugin
Gnawky is also a Claude Code plugin, so you can talk to it in a Claude Code session. Add it straight from GitHub by running these two commands in Claude Code:
/plugin marketplace add andreiciungan/gnawky /plugin install gnawky@gnawky-marketplace
From a local clone, use its path instead: /plugin marketplace add /path/to/gnawky.
The plugin brings its own copy of Gnawky, so it works without the npm package. Install the npm package too for the terminal app and the git hooks.
If the commands differ in your Claude Code version, check the Claude Code docs.
Talking to Gnawky
Start a request with "gnawky" and Claude uses the Gnawky skill:
gnawky find any security issues gnawky generate the report gnawky triage the findings, high and critical only gnawky what's wrong with next? gnawky anything critical in production? gnawky ignore the lodash advisories, we only use it in build scripts gnawky fix next
The skill runs the matching Gnawky command and explains the results as grouped items, with Claude's verdicts where there are any. It follows the same rules as the app:
- Triage: it shows what will be sent to Claude and asks before starting.
- Ignores need your reason; it asks if you didn't give one.
- Fixes: it shows Gnawky's plan, suggests an order (or splitting a risky major upgrade into its own branch), asks whether to verify with your scripts, and applies it with
gnawky fixonly after you agree. You then choose keep or undo. - Claude doesn't install packages or edit the lockfile itself, and never commits or pushes unless you ask.
Claude picks skills by their description, so a request without "gnawky" in it may not use it. The slash commands always do.
Slash commands
| Command | What it does |
|---|---|
/gnawky:scan | Scan the project and summarize the findings, most severe first. |
/gnawky:prod | The quick production check: a fresh audit listing critical and high advisories that ship to production, in a few seconds, without a full scan. The same check as the pre-push warning. |
/gnawky:triage | Claude triage of the findings, after showing you the plan. |
/gnawky:fix | Plan and apply fixes on a new branch, after you agree. |
/gnawky:report | Write the reports and open the HTML one, scanning first if there's no scan yet or it's out of date. |
Agent and audit skill
security-revieweragent: read-only triage of true and false positives, and drafts of minimal fix diffs.gnawky:security-auditskill: Cloudflare's multi-phase audit skill, bundled unmodified under its MIT license. It's the same skill as Run a full security audit in the app, which loads it with--plugin-dir, so that menu item works without installing the plugin.
Command line
Run these inside the project. All but scan use the last scan in .gnawky/.
| Command | What it does |
|---|---|
gnawky | The interactive app. In a folder without package.json, the workspace view. |
gnawky scan [path] [--json] | Scan, then list the findings grouped like the app. |
gnawky findings [--json] [--prod-only] | The last scan's findings, grouped, with Claude's verdicts. Production critical/high first; --prod-only hides dev-only ones. |
gnawky report [--open] | Rewrite the Markdown and HTML reports, optionally opening the HTML one. |
gnawky triage [options] | Show what Claude triage would check and send. Add --yes to run it. Options: --severity critical,high, --sources dependencies,code,secrets, --scope production,dev-only, --all (redo everything), --parallel 1-3. |
gnawky ignore <target>... --reason "why" | Ignore findings by ID, GHSA, CVE, or package name (its whole grouped item). The reason is required. |
gnawky fix <target>... | --all | Show the fix plan; add --yes to apply it on a new branch. Options: --scripts test,build or --scripts all, --one-at-a-time, --pin caret|exact, --json. |
gnawky fix --keep | --undo | Keep the fix branch (and log the fixed advisories), or throw it away. |
gnawky pre-commit [--min-severity <level>] | Check the staged lockfile (what the hook runs). Fails only on new high/critical findings. |
gnawky pre-push [--json] | Fresh audit of critical/high advisories that ship to production (what the hook runs). Always exits 0. |
gnawky workspace [--projects a,b | --all] | List the workspace projects and how they use each other. |
gnawky workspace scan [--json] [--offline] | Check every picked project's dependencies. |
gnawky workspace report | Show the last workspace scan. |
gnawky --help | The full help text. |
gnawky fix is the app's Review & fix without the menus: the same order, branch, disabled install scripts, script verification (only with --scripts, since it runs your project's code), audit afterwards and fixed-advisories log. After --yes, the branch waits for --keep or --undo.
CI and headless mode
Without the menus, Gnawky scans and writes the reports, which suits CI and scripts:
gnawky --no-ui # scan and write the reports gnawky --ci --min-severity high # exit 1 if findings remain, 2 if no scanner could run gnawky --json # findings as JSON on stdout (one entry per advisory) gnawky --offline # nothing leaves this computer
| Option | Meaning |
|---|---|
--min-severity <level> | critical, high, medium, low or info |
--offline | Skip everything that would leave the computer |
--semgrep-config <cfg> | A semgrep ruleset or local rules file; repeat it for more than one |
These options override .gnawky/config.json. Headless and --ci runs never run your project's scripts and never change anything.
Exit code with --ci | Means |
|---|---|
0 | No findings at or above the minimum severity |
1 | Findings remain |
2 | No scanner could run, so the result proves nothing |
Files Gnawky writes
Everything goes into .gnawky/ in the project, which ignores itself in git (it contains a .gitignore with *). The one file meant to be committed is .gnawky-ignore.json, next to it.
| Path | Contents |
|---|---|
.gnawky/config.json | Settings for this project. See Settings. |
.gnawky/findings.json | The last scan's findings, one entry per advisory. |
.gnawky/security-report.md, .html | The reports. |
.gnawky/triage.json | Claude's verdicts. |
.gnawky/fixes/<date>.json, .md | The fixed advisories log. |
.gnawky/fix-failed-<package>.log | npm's full output when it refused an upgrade. |
.gnawky/verify-after-*.log | Script output from a verified fix. |
.gnawky/smoke/ | Browser smoke test reports. |
.gnawky/cache/ | Cached lookups, such as Next.js release dates and the last pre-push results. |
.gnawky-ignore.json | Ignored findings with reasons. Commit it. |
In a workspace folder, .gnawky/ holds workspace.json, workspace-findings.json and the workspace reports.
Settings and config.json
Change settings in the app's Settings menu. They're saved per project in .gnawky/config.json:
| Key | Default | Meaning |
|---|---|---|
minSeverity | "low" | Lowest severity to report: critical, high, medium, low, info |
offline | false | Offline mode: nothing leaves the computer |
scanners | all true | Turn scanners on or off: npm-audit, next-bundled-react, gitleaks, semgrep |
semgrepConfigs | ["p/javascript", "p/nodejsscan"] | semgrep rulesets or local rules files; setup adds rules for your stack |
semgrepSkipTests | true | Skip test and mock files in semgrep |
The file also remembers choices like your last triage filter and custom audit scope. The guards and hooks are turned on and off in Settings too, but live outside this file: the package check in your shell startup file, and the hooks in your hooks folder.
Environment variables
| Variable | Effect |
|---|---|
GITHUB_TOKEN | Raises the GitHub API rate limit (60 requests an hour without it), used for Next.js release dates and CVE lookups in the fix log. |
GNAWKY_SKIP=1 | Skips the package check for one command: GNAWKY_SKIP=1 npm install <pkg>. |
Safety model
- The scan is read-only. Nothing changes unless you choose a fix and confirm the plan.
- Fixes happen on a new git branch, from a clean working tree, so you can review them with
git diffand throw everything away in one step. - No install scripts run during fixes (
--ignore-scriptsfor npm and Yarn), andnpm audit fix --forceis never used. Major upgrades are labelled breaking and need their own approval.npm rebuildis only offered when a check fails, with its own warning. - Your project's code only runs if you say so. Verifying a fix runs your package.json scripts: opt-in every time, with the exact commands shown. Never in headless or
--cimode. - Secrets are never written to reports. gitleaks runs with
--redact, and code snippets are excluded. - No shell. External tools are launched with argument arrays, so file names or package data can't inject commands. Package specs are validated before
npm install. - Reports stay out of git:
.gnawky/ignores itself.
What leaves your computer
Your source code is never uploaded by the scan. Here's everything that does leave, and when:
| What | Where to | When |
|---|---|---|
| Your dependency list | Your npm registry | The dependency audit, the package check and the hooks (Online mode only) |
| Nothing is sent; rulesets are downloaded | semgrep registry | semgrep with registry rulesets (like p/javascript), with metrics turned off |
| Next.js version, advisory IDs | GitHub API | Next.js projects; CVE lookups for the fix log |
| Public package names and versions | deps.dev | Publish dates in the package check, public registry packages only |
| The code Claude reads | Anthropic | Only the AI tools, after you start them: triage, full audit, Ask Claude, fixes with Claude, smoke tests |
Offline mode turns all of it off: the npm/yarn audit is skipped, semgrep only uses local rule files, and the AI tools are disabled.
Platforms and limits
- macOS and Linux are fully supported.
- Windows: run Gnawky inside WSL (for example Ubuntu) for full support. Natively, the dependency audit and gitleaks should work but haven't been tested yet; semgrep may not be available, the tool installer offers nothing, and Claude triage is off.
- Lockfiles:
package-lock.jsonand Yarn 1yarn.lock. pnpm and Yarn 2+ aren't supported yet. - The package check covers zsh and bash in your own terminal.
- The AI tools need Claude Code and use your Claude plan.
Ideas on the roadmap
- Built-in Node-specific checks, for example
helmetmissing in Express, or cookies withouthttpOnly/secure. - Applying semgrep autofixes with per-edit approval.
- SARIF output for GitHub code scanning.
- A GitHub Actions workflow for pull requests that change dependencies, plus a weekly run for new advisories.
- Support for pnpm and Yarn 2+ lockfiles.