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

@itscojac/dgent

v0.1.4

Published

De-agent your code — clean AI tells from commits and code automatically via git hooks

Readme

dgent

dgent (de-agent) — de-agent your code

De-agent your code.

npm license node

Your code just needs to be de-agented. dgent runs automatically via git hooks — cleaning commit messages and code before they land in your repo. No workflow changes required.

Alpha (v0.1.0) — Actively developed. Core rules and hooks are stable. AI features, TUI, and some opt-in rules are still being refined. Report issues.

Platforms: macOS, Linux, Windows (requires Git for Windows).

The problem

AI agents speed up your workflow, but their output has tells (mechanical patterns that agents add to code and commit messages):

  • Co-Authored-By trailers on every commit
  • Emoji prefixes on commit messages
  • Comments that restate the next line of code
  • DataProcessor, UserServiceHandler naming
  • Catch blocks that only log and re-throw
  • Section header comments in small files
  • Words like "enhance", "streamline", "comprehensive"

Before dgent

✨ Implement caching to enhance performance

This commit adds Redis caching for API responses
to streamline the data fetching process.

Co-Authored-By: Claude <[email protected]>

After dgent

- ✨ Implement caching to enhance performance
+ Implement caching to enhance performance

  This commit adds Redis caching for API responses
  to streamline the data fetching process.

- Co-Authored-By: Claude <[email protected]>
dgent  2 fixes applied, 3 flags
  ✓ strip-emojis
  ✓ strip-trailers
  ! line 1: AI vocabulary: "enhance"
  ! line 3: AI phrase: "this commit"
  ! line 4: AI vocabulary: "streamline"

Fixes (emoji, trailers, formatting) are automatic. Flags (vocabulary, naming) print as warnings — you decide what to change.

Install

npm install -g @itscojac/dgent
dgent init

That's it. Every git commit now runs through dgent automatically.

What it does

dgent installs two git hooks (commit-msg and pre-commit) that clean agent output before it lands in your repo.

Commit message rules (always run)

| Rule | Default | What it does | |---|---|---| | strip-trailers | on | Removes Co-Authored-By, Generated-By, and AI attribution trailers | | strip-emojis | on | Strips emoji characters from commit messages | | flag-message-tone | on | Warns about AI vocabulary: "enhance", "streamline", "this commit" | | normalize-format | on | Fixes conventional commit formatting (case, period, spacing) | | rewrite-message | off | AI-powered rewrite to match your repo's commit voice (requires API key) |

Code rules (run on staged files)

| Rule | Default | What it does | |---|---|---| | strip-section-headers | on | Removes // --- Init --- style divider comments in small files | | strip-emoji-comments | on | Strips emojis from code comments | | flag-naming | on | Flags Manager, Handler, Processor suffixes and overlong identifiers | | flag-catch-rethrow | on | Flags catch blocks that only log and re-throw | | strip-noise-comments | off | Removes comments that restate the next line | | strip-obvious-docstrings | off | Removes docstrings on trivial self-documenting functions | | flag-log-bracketing | off | Flags console.log pairs that narrate execution flow |

Fix rules modify code silently (after first-run consent). Flag rules warn without modifying.

Commands

dgent init                  # Install global hooks (prompts for confirmation)
dgent init -y               # Install without confirmation
dgent uninstall             # Remove hooks, restore hooksPath
dgent scan [dir]            # Scan directory for tells
dgent scan --fix [dir]      # Scan and auto-fix
dgent scan --json [dir]     # Structured output for CI
dgent run <file>            # Check a single file
dgent run --fix <file>      # Fix a file in place
dgent run --check <file>    # Silent — exit 0 clean/fixed, 1 flags
dgent run --json <file>     # Structured output for agents
dgent fix <file>            # AI-powered fix (requires API key)
dgent rules                 # List all rules with patterns
dgent rules --json          # Machine-readable rule catalog
dgent config                # Interactive config editor (TUI)
dgent config list           # Print all config values
dgent config set <k> <v>    # Set a config value
dgent review                # Review flags from last commit (TUI)
dgent stats                 # Flag trends and breakdown
dgent log                   # Flag history
dgent doctor                # Check setup and diagnose issues
dgent integrate             # Install agent skills (Claude Code, OpenClaw)
dgent rage                  # Debug info for bug reports
dgent update                # Self-update via npm

Try it without installing: npx @itscojac/dgent run --json <file>

Configuration

Global config lives at ~/.config/dgent/config.json. Toggle any rule:

dgent config set rules.strip-noise-comments true    # Enable opt-in rule
dgent config set rules.flag-naming false             # Disable default rule

Per-repo overrides

Drop a .dgent.json in your repo root to override rules for that project:

{
  "rules": {
    "strip-noise-comments": true,
    "flag-naming": false
  }
}

Nested .dgent.json files (e.g., in monorepo packages) are not yet supported.

AI skill layer (optional)

dgent includes an optional AI layer that calls Claude for tasks that need judgment.

dgent config set api-key <your-anthropic-api-key>
dgent config set ai.enabled true

Manual AI fix

dgent fix src/file.ts              # Fix flagged code issues
dgent fix --commit-msg message.txt # Fix flagged commit message
dgent fix --dry-run src/file.ts    # Preview without applying

Automatic AI fix on every commit

dgent config set ai.autofix true

With autofix enabled, the hooks automatically call Claude to resolve flags during commit — renaming DataProcessor to something specific, removing empty catch-rethrow blocks, cleaning AI vocabulary from messages. If the AI can't fix it or the call fails, flags print as warnings instead.

Commit message rewriting

dgent config set rules.rewrite-message true

Rewrites commit messages to match your repo's historical voice (pulls last 10 messages from git log for style matching).

The API key is stored in your macOS Keychain (or ~/.local/share/dgent/.key on Linux). You can also set ANTHROPIC_API_KEY as an environment variable.

Override the bundled AI skill prompt by placing a custom file at ~/.config/dgent/skill.md.

The AI layer is entirely optional. Without it, dgent runs purely deterministic rules with zero latency.

Inline ignores

Suppress specific flags with comments:

// dgent-ignore flag-naming
class DataProcessor { ... }           // ← not flagged

class UserServiceHandler { ... }      // ← still flagged

const x = getValue(); // dgent-ignore // ← ignore all rules on this line

Supports // dgent-ignore, // dgent-ignore-next-line, // dgent-ignore <rule> <rule>, and # for Python/shell.

CI integration

Copy the workflow template to your repo:

cp node_modules/dgent/integrations/ci/dgent.yml .github/workflows/

Scans PR diffs for tells and posts results as a comment. Optionally make it a required check to block merge.

Safety

  • dgent never blocks a commit. If it crashes, the commit proceeds unmodified.
  • Files with mixed staged/unstaged changes are skipped entirely — dgent won't risk merging your working tree.
  • First time dgent modifies staged files, it asks for consent. After that, it's silent.
  • Use DGENT_DRY_RUN=1 git commit -m "..." to preview changes without applying.
  • Use dgent run --dry-run <file> to test rules on any file.
  • Note: Git GUIs (VS Code, GitKraken, Tower) may not display dgent's terminal output. Use dgent log or dgent review to see what dgent cleaned on your last commit.

Agent integrations

dgent works with AI coding agents — not just on their output, but as a tool they can use.

Claude Code / Codex

dgent integrate

This installs skills to ~/.claude/skills/dgent/ and prints instructions for adding dgent context to your CLAUDE.md. After setup, the agent can:

  • Run dgent run --json <file> to check files for tells before committing
  • Understand which patterns to avoid (naming, catch-rethrow, etc.)
  • Configure rules per-repo via .dgent.json

JSON output for CI/agents

dgent run --json src/file.ts

Returns structured JSON with fixes, flags, and cleaned output. Exit codes: 0 = clean or fixes applied (success), 1 = flags found (needs attention).

LLM-readable docs

The package ships with llms.txt — a single-file reference any agent can consume for full rule documentation, config options, and troubleshooting.

How it works

dgent installs into git config --global core.hooksPath. Two thin shell scripts call dgent hook commit-msg and dgent hook pre-commit, both with || true so they never block.

The rules engine uses heuristic line-level pattern matching — no AST parser, no grammar dependencies. It works across any language and completes in under 100ms.

License

MIT