npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

artifact-guard

v0.1.6

Published

Privacy-aware artifact lifecycle manager for AI-assisted development workflows.

Downloads

644

Readme

ArtifactGuard

CI npm version npm downloads license

ArtifactGuard is a privacy-aware CLI for AI-assisted development workflows. It snapshots your workspace, detects agent-created artifacts, classifies source/temporary/sensitive files, safely deletes disposable artifacts, and generates end-of-session cleanup reports.

Problem

AI coding agents often create temporary files while solving tasks: downloaded documents, extracted archives, debug logs, scratch scripts, JSON dumps, and one-off reports. These artifacts can clutter workspaces and may create privacy risk when sensitive files are left behind.

ArtifactGuard provides a lightweight artifact lifecycle layer for these sessions.

Install

From npm:

npm install -g artifact-guard

From source:

git clone https://github.com/ekta-chaudhry/artifact-guard.git
cd artifact-guard
pnpm install
pnpm build
pnpm link --global

Then run from any workspace:

artifact-guard --help

Commands

artifact-guard start                 # Capture a baseline workspace snapshot
artifact-guard status                # Show files changed since the snapshot
artifact-guard finish                # Classify artifacts and print a cleanup report
artifact-guard finish --delete-safe  # Delete created files classified as safe temporary artifacts
artifact-guard finish --interactive  # Review safe temporary artifacts before deleting
artifact-guard finish --report       # Write .artifact-guard/report.md
artifact-guard finish --clean-state  # Remove .artifact-guard/session.json after finish

Flags can be combined:

artifact-guard finish --interactive --report --clean-state
artifact-guard finish --delete-safe --report --clean-state

--delete-safe and --interactive are mutually exclusive.

Example Workflow

artifact-guard start

# Simulate agent work
echo "debug" > debug.log
echo "SECRET=value" > .env.test
echo "# Notes" > notes.md

artifact-guard status
artifact-guard finish --delete-safe --report

Example report categories:

  • Source changes: Git-tracked files, code, docs, config, and deleted tracked files
  • Temporary artifacts: logs, archives, scratch/debug files
  • Sensitive / needs review: env files, credentials, resumes, patient/customer exports
  • Deliverables: reports or document outputs
  • Unknown / needs review: untracked files not matched by current rules

Safe Deletion Policy

finish --delete-safe deletes only files classified as both:

  • temporary
  • created

finish --interactive uses the same safety boundary, but asks before deleting each safe candidate.

ArtifactGuard does not auto-delete or offer interactive deletion for:

  • modified files
  • source changes
  • sensitive files
  • deliverables
  • unknown files
  • deleted-file records

Git-Aware Classification

When run inside a Git repository, ArtifactGuard uses git ls-files to identify tracked files.

This means:

  • modified Git-tracked files are classified as source-impacting changes even if their extension is unknown
  • untracked files are still classified by sensitive, temporary, deliverable, source-extension, or unknown rules
  • sensitive patterns take priority over Git tracking for privacy-first reporting

If Git is unavailable or the workspace is not a Git repository, ArtifactGuard falls back to pattern and extension-based classification.

ArtifactGuard State

ArtifactGuard creates its own state directory in the workspace:

.artifact-guard/
├── session.json   # created by `artifact-guard start`
└── report.md      # created/updated only when `--report` is used

By default, finish keeps this state so you can inspect the session and report afterwards.

Use --clean-state to remove the session snapshot after finish completes:

artifact-guard finish --report --clean-state

Behavior:

  • removes .artifact-guard/session.json
  • keeps .artifact-guard/report.md when --report is used
  • removes the empty .artifact-guard/ directory if no report or other state files remain

Markdown Reports

Use --report to write a session report:

artifact-guard finish --report

Output:

.artifact-guard/report.md

The report includes:

  • summary counts
  • safe-to-delete bytes
  • deleted bytes when cleanup runs
  • preserved source/sensitive/deliverable/unknown counts
  • grouped artifact categories
  • classifier reasons
  • cleanup policy
  • deleted/skipped files when --delete-safe is used

Configuration

Add .artifactguardrc.json to customize project rules:

{
  "ignore": ["coverage/**", "tmp/**"],
  "sourceExtensions": [".toml"],
  "temporaryPatterns": ["*.debug.json", "scratch/**"],
  "sensitivePatterns": ["*resume*", "*patient*", "*secret*"],
  "deliverablePatterns": ["reports/**", "deliverables/**"]
}

See .artifactguardrc.example.json for a starter config.

Pattern values support simple glob-like * / ** matching. Regex strings are also supported with /pattern/flags syntax.

AI Agent Integration

Integration examples are included for common agent workflows:

integrations/pi-skill/SKILL.md
integrations/claude-code/CLAUDE.md
integrations/codex/AGENTS.md
integrations/generic-agent/ARTIFACTGUARD.md

They show how AI coding agents can run ArtifactGuard at the start and end of artifact-producing tasks.

CI

GitHub Actions runs on pushes and pull requests to main:

pnpm install --frozen-lockfile
pnpm build
pnpm test

Workflow file:

.github/workflows/ci.yml

Current Behavior

  • start stores a baseline snapshot in .artifact-guard/session.json
  • status shows created, modified, and deleted files since the baseline
  • finish classifies changes and prints cleanup recommendations
  • Git-tracked files are classified as source-impacting changes
  • finish --delete-safe deletes only created temporary artifacts
  • finish --interactive prompts before deleting safe temporary artifacts
  • finish --report writes .artifact-guard/report.md
  • finish --clean-state removes .artifact-guard/session.json after finishing

Planned Features

  • Multi-session history

Development

pnpm install
pnpm build
pnpm test
pnpm dev -- start
pnpm dev -- status
pnpm dev -- finish