🚨 Active Supply Chain Attack:node-ipc Package Compromised.Learn More
Socket
Book a DemoSign in
Socket

code-warden

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

code-warden

Production-grade AI development governance skill for Codex, Claude Code, and Cowork.

Source
npmnpm
Version
3.1.1
Version published
Weekly downloads
355
Maintainers
1
Weekly downloads
 
Created
Source

code-warden

Portable AI Coding Governance Layer

Code-Warden is a portable governance layer for AI coding agents. It enforces scoped planning, patch discipline, file-size limits, the zero-trust secrets policy, verification evidence, install health, and optional Claude Code pre-tool-use blocking.

Four Layers

Code-Warden Four Layers

LayerWhat it does
Skill governanceScope Gate, Plan Gate, blast-radius checks, patch-first editing, research gates, drift signals, verification evidence
Local verificationwarden-lint, verify-secrets, get-context — directory-aware, no external deps
Installer and healthCross-app auto-installer, manifest-backed installs, --doctor, --verify-target, Windsurf adapter
Hard enforcementClaude Code PreToolUse hooks — block oversized writes and hardcoded secrets before the file system is touched

Install

git clone https://github.com/Kodaxadev/Code-Warden.git
cd Code-Warden/code-warden
node install.js

Installer commands

CommandPurpose
node install.jsScan, prompt, install to detected apps
node install.js --allInstall without prompt
node install.js --dry-runPreview installs, write nothing
node install.js --listShow detected apps and detection method
node install.js --doctorVerify source integrity + per-target install health
node install.js --target=claude,cursorForce specific targets (warns if not detected)
node install.js --verify-target=claudeStrict health check — exits nonzero if not installed
node install.js --hooks=claudeInstall PreToolUse hooks into ~/.claude/settings.json
node install.js --uninstall-hooks=claudeRemove code-warden hook entries from settings

Supported targets: Claude Code, Cursor, Warp, OpenAI Codex, Windsurf, Generic Agents.

Each install writes a .code-warden-install.json manifest (version, target, format, timestamp).

npm scripts

npm run lint            # warden-lint on full project tree
npm run check-secrets   # verify-secrets on full project tree
npm run install-auto    # node install.js
npm run install-dry-run # node install.js --dry-run
npm run install-list    # node install.js --list
npm run install-doctor  # node install.js --doctor
npm run test            # behavioral tests (8 scanner/hook pass/fail cases)
npm run ci              # lint + secrets + test + doctor

Usage

Load at the start of any coding session. Trigger phrases:

  • "load code-warden" / "load protocol"
  • "begin coding" / "new session" / "governance check"
  • "start a new module" / "review this before we write"

The session sequence is enforced before any implementation:

Code-Warden Session Start Sequence

  • Architecture State (Re-injection Rule)
  • Session Scope (Session Scoping Rule)
  • Reference Files (Blueprint Rule)
  • Scope Gate — goal, non-goals, files in/out, verify commands, rollback
  • Plan Gate — patch order, blast radius class, post-patch checks

See examples/governed-session.md for an annotated example.

Optional Claude Code Hooks

Code-Warden Hook Enforcement Flow

Install hard enforcement that runs at the PreToolUse level — before writes happen:

# Requires Claude Code target to be installed first
node install.js --hooks=claude
HookTriggerPolicy
warden-lint-hook.jsWrite or EditBlocks if resulting file exceeds line limit
warden-secrets-hook.jsWrite or EditHardcoded credential scanner — blocks if content matches any secret pattern

Both hooks use exec form (node /path/to/hook.js) — no shell differences across platforms.

Thresholds are read from codewarden.json in the installed skill directory.

node install.js --uninstall-hooks=claude  # remove hook entries from settings.json

Doctor and --verify-target=claude validate hook script paths when hooks are registered.

Configuration

All thresholds in codewarden.json:

SettingDefaultWhat it controls
thresholds.max_file_length400Lines before warden-lint.js flags a file
thresholds.pre_flight_trigger_lines150Lines before a pre-flight manifest is required
thresholds.human_checkpoint_files2Files touched before [AWAITING CONFIRMATION] is required
safety.exempt_from_blast_radiustests/, docs/, scripts/Paths excluded from rollback-plan rule

See CONFIGURE.md for team-size profiles and tuning rationale.

Reference Files

FileDomain
references/planning-gates.mdScope Gate and Plan Gate contracts
references/architecture.mdBlueprint Rule, Re-injection, State Update
references/safety.mdBlast Radius, Patch-First, Zero-Trust, Dependency Freeze
references/cognition.mdThink Before Coding, Don't Guess Syntax, Human Checkpoint
references/cleanup.mdTech Debt format, Test Contract, Decision Log
references/anti-drift.mdAnchor Check, Session Scoping, Drift Trigger Protocol
references/operations.mdVerification, source-control hygiene, dependency control
references/research-and-fit.mdLive research gate, stack fit, product-shape guardrails

Author

Justin Davis — MIT License

FAQs

Package last updated on 16 May 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts