Skip to main content
Second Foreman LLC · Oklahoma City, OK SAM.gov UEI: U4BYU2ELNVW1 OK SOS: #3513997463 OK Tax Permit: #796020736 Veteran-Owned Small Business
hello@secondforeman.com
WORKSPACE HYGIENE · IGNORE-FILE GENERATOR

Preventing package-lock.json, pnpm-lock.yaml & Build Artifacts from Leaking into Agent Context

One accidental grep or file read across dist/, coverage/, or package-lock.json can burn 80,000 tokens in a single turn. Lock it down.

Key Rules & Field Checklist

  • Lockfiles (package-lock.json, yarn.lock, pnpm-lock.yaml, Cargo.lock) routinely span 150 KB to 2 MB (40k–500k tokens).
  • Generated bundles (dist/, .next/, coverage/, *.min.js, *.map) trigger instant context compaction when read.
  • ContextGuard flags unignored heavy artifacts and outputs a drop-in ignore block for your coding agent.
  • Zero code leaves your machine: 100% local Node.js CLI and browser WebCrypto workbench.

Run in terminal: npx --allow-git=all --yes github:oneandroid-max/contextguard-mcp audit .

Related Study & Engineering Guides

How to Stop AI Coding Context-Compaction Loops & 5x Prompt-Cache Burn · The <5 KB START.md Boot-Card Pattern for AGENTS.md & .cursorrules Repositories · Auditing MCP Server Tool-Schema Token Overhead Before Tool Call #1 · Connect Second Foreman Remote Streamable HTTP MCP Server