{"_id":"@aki77/claude-on-edit","_rev":"8-e025b883a178cae2eea12c625ab9a908","name":"@aki77/claude-on-edit","dist-tags":{"latest":"0.8.0"},"versions":{"0.1.0":{"name":"@aki77/claude-on-edit","version":"0.1.0","keywords":["claude","claude-code","format","lint","hook","posttooluse"],"author":{"name":"aki77"},"license":"MIT","_id":"@aki77/claude-on-edit@0.1.0","maintainers":[{"name":"aki77","email":"lala.akira+npm@gmail.com"}],"homepage":"https://github.com/aki77/claude-on-edit#readme","bugs":{"url":"https://github.com/aki77/claude-on-edit/issues"},"bin":{"claude-on-edit":"dist/cli.js"},"dist":{"shasum":"027b9950839a8f40ce9e6a30ff24942275169dae","tarball":"https://registry.npmjs.org/@aki77/claude-on-edit/-/claude-on-edit-0.1.0.tgz","fileCount":35,"integrity":"sha512-d/Hw5eqft7eV4FDaxT/KJBO9A9TZT1qhnKv1u5qB2/isyODqZeesWayvjUB4I73a1wLPSyrMSKFdeluWq41xUw==","signatures":[{"sig":"MEUCIQCDceCdvus96VuVKrb7MTVHQtjVfBOvm6+6yvhDJ1SdCAIgFxlmURSlbhd4Q2LD0Qh7mYwp2FUZpt5FE4i+lkJ/OVo=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":49876},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","engines":{"node":">=16.0.0"},"gitHead":"9a7b736cb3f46d57f27b5250057ee65a42c78844","scripts":{"dev":"tsc --watch","lint":"biome check src/","build":"tsc","format":"biome format --write src/","prepare":"npm run build"},"_npmUser":{"name":"aki77","email":"lala.akira+npm@gmail.com"},"repository":{"url":"git+https://github.com/aki77/claude-on-edit.git","type":"git"},"_npmVersion":"9.6.6","description":"Run commands on files when Claude Code edits them","directories":{},"_nodeVersion":"22.14.0","dependencies":{"minimatch":"^9.0.0"},"_hasShrinkwrap":false,"packageManager":"pnpm@9.15.9+sha512.68046141893c66fad01c079231128e9afb89ef87e2691d69e4d40eee228988295fd4682181bae55b58418c3a253bde65a505ec7c5f9403ece5cc3cd37dcf2531","devDependencies":{"typescript":"^5.0.0","@types/node":"^20.0.0","@biomejs/biome":"^2.1.2"},"_npmOperationalInternal":{"tmp":"tmp/claude-on-edit_0.1.0_1753131447340_0.5142426679714314","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@aki77/claude-on-edit","version":"0.2.0","keywords":["claude","claude-code","format","lint","hook","posttooluse"],"author":{"name":"aki77"},"license":"MIT","_id":"@aki77/claude-on-edit@0.2.0","maintainers":[{"name":"aki77","email":"lala.akira+npm@gmail.com"}],"homepage":"https://github.com/aki77/claude-on-edit#readme","bugs":{"url":"https://github.com/aki77/claude-on-edit/issues"},"bin":{"claude-on-edit":"dist/cli.js"},"dist":{"shasum":"f3acbcc14f57435122a96c37d89c14e828a6ce14","tarball":"https://registry.npmjs.org/@aki77/claude-on-edit/-/claude-on-edit-0.2.0.tgz","fileCount":35,"integrity":"sha512-bc4bHZBOlOJuJ9fJxm4CKXxFC7IFYsnO2A6sTFQ/JKcQs0vn+6YlUoaLt4+Rmo3nCmfTIfVKh41InOBLjLANLQ==","signatures":[{"sig":"MEUCIQCQQa31ngzILKdC1UFa3JO8LREszVKb+SzryqY0/Ube8wIgZd5CdmMDN5adM5ByNb6TnL2CxJnA1j1HB/TjGgn/ZCM=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":50217},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","engines":{"node":">=16.0.0"},"gitHead":"fb6c25b490eaeb2fd97de0e8941dbbf86cfccbaa","scripts":{"dev":"tsc --watch","lint":"biome check src/","build":"tsc","format":"biome format --write src/","prepare":"npm run build"},"_npmUser":{"name":"aki77","email":"lala.akira+npm@gmail.com"},"repository":{"url":"git+https://github.com/aki77/claude-on-edit.git","type":"git"},"_npmVersion":"9.6.6","description":"Run commands on files when Claude Code edits them","directories":{},"_nodeVersion":"22.14.0","dependencies":{"minimatch":"^9.0.0"},"_hasShrinkwrap":false,"packageManager":"pnpm@9.15.9+sha512.68046141893c66fad01c079231128e9afb89ef87e2691d69e4d40eee228988295fd4682181bae55b58418c3a253bde65a505ec7c5f9403ece5cc3cd37dcf2531","devDependencies":{"typescript":"^5.0.0","@types/node":"^20.0.0","@biomejs/biome":"^2.1.2"},"_npmOperationalInternal":{"tmp":"tmp/claude-on-edit_0.2.0_1753134060379_0.8237169854652286","host":"s3://npm-registry-packages-npm-production"}},"0.3.0":{"name":"@aki77/claude-on-edit","version":"0.3.0","keywords":["claude","claude-code","format","lint","hook","posttooluse"],"author":{"name":"aki77"},"license":"MIT","_id":"@aki77/claude-on-edit@0.3.0","maintainers":[{"name":"aki77","email":"lala.akira+npm@gmail.com"}],"homepage":"https://github.com/aki77/claude-on-edit#readme","bugs":{"url":"https://github.com/aki77/claude-on-edit/issues"},"bin":{"claude-on-edit":"dist/cli.js"},"dist":{"shasum":"5e0dc8d94fc36924c4bb64793c3776dbc44c6a1a","tarball":"https://registry.npmjs.org/@aki77/claude-on-edit/-/claude-on-edit-0.3.0.tgz","fileCount":35,"integrity":"sha512-5PKThQHz6/EYuchKjb2sOOHu3WUnfwUCM4+y26iAAcrLDOwKVeXIoriWDkZ0zAMEgLS6w9Zx2Fsl/jUVka1dtQ==","signatures":[{"sig":"MEQCIFUdbFnVHGSS8CYsOfzBs7wMXzDxfQC+tehQRnwaEEmFAiBBmrzDxPilTNLJPo8iB5QRAg+0DxAvzlvENDXEUFvh1A==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":57505},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","engines":{"node":">=16.0.0"},"gitHead":"3cd766a0d897bb119787185b5ea20a1782cb6054","scripts":{"dev":"tsc --watch","build":"tsc","check":"biome check src/ --write","prepare":"pnpm run build","prepublishOnly":"pnpm run check && pnpm run build"},"_npmUser":{"name":"aki77","email":"lala.akira+npm@gmail.com"},"repository":{"url":"git+https://github.com/aki77/claude-on-edit.git","type":"git"},"_npmVersion":"9.6.6","description":"Run commands on files when Claude Code edits them","directories":{},"_nodeVersion":"22.14.0","dependencies":{"minimatch":"^9.0.0"},"_hasShrinkwrap":false,"packageManager":"pnpm@9.15.9+sha512.68046141893c66fad01c079231128e9afb89ef87e2691d69e4d40eee228988295fd4682181bae55b58418c3a253bde65a505ec7c5f9403ece5cc3cd37dcf2531","devDependencies":{"typescript":"^5.0.0","@types/node":"^20.0.0","@biomejs/biome":"^2.1.2"},"_npmOperationalInternal":{"tmp":"tmp/claude-on-edit_0.3.0_1753157719966_0.42067589908686864","host":"s3://npm-registry-packages-npm-production"}},"0.4.0":{"name":"@aki77/claude-on-edit","version":"0.4.0","keywords":["claude","claude-code","format","lint","hook","posttooluse"],"author":{"name":"aki77"},"license":"MIT","_id":"@aki77/claude-on-edit@0.4.0","maintainers":[{"name":"aki77","email":"lala.akira+npm@gmail.com"}],"homepage":"https://github.com/aki77/claude-on-edit#readme","bugs":{"url":"https://github.com/aki77/claude-on-edit/issues"},"bin":{"claude-on-edit":"dist/cli.js"},"dist":{"shasum":"ee7ccb8979a484e6a4f379d072052b7e3aefe46e","tarball":"https://registry.npmjs.org/@aki77/claude-on-edit/-/claude-on-edit-0.4.0.tgz","fileCount":35,"integrity":"sha512-bRn3se2GIdiQm33H6KcaMPH7lmIz3P2gOSZ+CEGRBm245Juys3Kivcfr7sIiH9gpJgENYZ6+sf+aswUN9a77mA==","signatures":[{"sig":"MEUCIBxmBlsv8uRVHKqx58yAoTWiQM76WaCPA7lsCqC3tr/xAiEAycBRvc0NDxDXnfGXcB5HJ+tBSNvJfxQtrcNwZ8YAUxY=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":58831},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","engines":{"node":">=16.0.0"},"gitHead":"ab2ec85b5d007be3bb7ee169a6f3a9f82ab2dae2","scripts":{"dev":"tsc --watch","build":"tsc","check":"biome check src/ --write","prepare":"pnpm run build","prepublishOnly":"pnpm run check && pnpm run build"},"_npmUser":{"name":"aki77","email":"lala.akira+npm@gmail.com"},"repository":{"url":"git+https://github.com/aki77/claude-on-edit.git","type":"git"},"_npmVersion":"9.6.6","description":"Run commands on files when Claude Code edits them","directories":{},"_nodeVersion":"22.14.0","dependencies":{"minimatch":"^9.0.0"},"_hasShrinkwrap":false,"packageManager":"pnpm@9.15.9+sha512.68046141893c66fad01c079231128e9afb89ef87e2691d69e4d40eee228988295fd4682181bae55b58418c3a253bde65a505ec7c5f9403ece5cc3cd37dcf2531","devDependencies":{"typescript":"^5.0.0","@types/node":"^20.0.0","@biomejs/biome":"^2.1.2"},"_npmOperationalInternal":{"tmp":"tmp/claude-on-edit_0.4.0_1753173348383_0.3531538787386672","host":"s3://npm-registry-packages-npm-production"}},"0.5.0":{"name":"@aki77/claude-on-edit","version":"0.5.0","keywords":["claude","claude-code","format","lint","hook","posttooluse"],"author":{"name":"aki77"},"license":"MIT","_id":"@aki77/claude-on-edit@0.5.0","maintainers":[{"name":"aki77","email":"lala.akira+npm@gmail.com"}],"homepage":"https://github.com/aki77/claude-on-edit#readme","bugs":{"url":"https://github.com/aki77/claude-on-edit/issues"},"bin":{"claude-on-edit":"dist/cli.js"},"dist":{"shasum":"204a9c0bccb46fd2d00bf25beca7deb074e60ffb","tarball":"https://registry.npmjs.org/@aki77/claude-on-edit/-/claude-on-edit-0.5.0.tgz","fileCount":71,"integrity":"sha512-eQwNRJQRvHdIhu2eYN9NABXBNk4Yl0oVgvdZcv9MLn2rIhXuoOJf4dq6v4vzNszmQqhatn3SZIfl+qyUh5olyQ==","signatures":[{"sig":"MEQCICCkzdvmTErUUXak2Uhf9UQA2cbhQzWHyAMVkho4xwDqAiAus0M/2dyAoncEf5ndN7D5seS8iLXId8hDUOH4tGDSWA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":121381},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","engines":{"node":">=16.0.0"},"gitHead":"30bd3c3d708d459a442d472d0be8e421fd23bfdd","scripts":{"dev":"tsc --watch","test":"pnpm run build && node --test dist/test/**/*.test.js","build":"tsc","check":"biome check src/ --write","prepare":"pnpm run build","prepublishOnly":"pnpm run check && pnpm run build"},"_npmUser":{"name":"aki77","email":"lala.akira+npm@gmail.com"},"repository":{"url":"git+https://github.com/aki77/claude-on-edit.git","type":"git"},"_npmVersion":"9.6.6","description":"Run commands on files when Claude Code edits them","directories":{},"_nodeVersion":"22.14.0","dependencies":{"minimatch":"^9.0.0"},"_hasShrinkwrap":false,"packageManager":"pnpm@9.15.9+sha512.68046141893c66fad01c079231128e9afb89ef87e2691d69e4d40eee228988295fd4682181bae55b58418c3a253bde65a505ec7c5f9403ece5cc3cd37dcf2531","devDependencies":{"typescript":"^5.0.0","@types/node":"^20.0.0","@biomejs/biome":"^2.1.2"},"_npmOperationalInternal":{"tmp":"tmp/claude-on-edit_0.5.0_1753182461639_0.3747857027065826","host":"s3://npm-registry-packages-npm-production"}},"0.6.0":{"name":"@aki77/claude-on-edit","version":"0.6.0","keywords":["claude","claude-code","format","lint","hook","posttooluse"],"author":{"name":"aki77"},"license":"MIT","_id":"@aki77/claude-on-edit@0.6.0","maintainers":[{"name":"aki77","email":"lala.akira+npm@gmail.com"}],"homepage":"https://github.com/aki77/claude-on-edit#readme","bugs":{"url":"https://github.com/aki77/claude-on-edit/issues"},"bin":{"claude-on-edit":"dist/cli.js"},"dist":{"shasum":"e26116a7072b6af48fa59a51f2099ca0bc9df62f","tarball":"https://registry.npmjs.org/@aki77/claude-on-edit/-/claude-on-edit-0.6.0.tgz","fileCount":79,"integrity":"sha512-BfYw7mUlS41P/qT1zYAutKTW1BNoKeDcKUg27rP3gkcwJUhi0EYaS4IONNigYpdu59cJ/9MPXuKqWPVltf9W3A==","signatures":[{"sig":"MEUCIQC6PzsXn4PsSx+lbEf1P52iPgU2a4NlJrXwg1Ji9r7T0AIgHFFDZVlxzde0uAnyEQC4XA+pbwLwRAM7+XgQMILVcrU=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":130104},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","engines":{"node":">=16.0.0"},"gitHead":"92401045063bb39ffc293353cff8c45b54a95b1e","scripts":{"dev":"tsc --watch","test":"pnpm run build && node --test dist/test/**/*.test.js","build":"tsc","check":"biome check src/ --write","prepare":"pnpm run build","prepublishOnly":"pnpm run check && pnpm run build"},"_npmUser":{"name":"aki77","email":"lala.akira+npm@gmail.com"},"repository":{"url":"git+https://github.com/aki77/claude-on-edit.git","type":"git"},"_npmVersion":"9.6.6","description":"Run commands on files when Claude Code edits them","directories":{},"_nodeVersion":"22.14.0","dependencies":{"micromatch":"^4.0.8"},"_hasShrinkwrap":false,"packageManager":"pnpm@9.15.9+sha512.68046141893c66fad01c079231128e9afb89ef87e2691d69e4d40eee228988295fd4682181bae55b58418c3a253bde65a505ec7c5f9403ece5cc3cd37dcf2531","devDependencies":{"typescript":"^5.0.0","@types/node":"^20.0.0","@biomejs/biome":"^2.1.2","@types/micromatch":"^4.0.9"},"_npmOperationalInternal":{"tmp":"tmp/claude-on-edit_0.6.0_1753229008452_0.4671098473237769","host":"s3://npm-registry-packages-npm-production"}},"0.7.0":{"name":"@aki77/claude-on-edit","version":"0.7.0","keywords":["claude","claude-code","format","lint","hook","posttooluse"],"author":{"name":"aki77"},"license":"MIT","_id":"@aki77/claude-on-edit@0.7.0","maintainers":[{"name":"aki77","email":"lala.akira+npm@gmail.com"}],"homepage":"https://github.com/aki77/claude-on-edit#readme","bugs":{"url":"https://github.com/aki77/claude-on-edit/issues"},"bin":{"claude-on-edit":"dist/cli.js"},"dist":{"shasum":"56568d5fc84e2772a97b7883a28f7777476aa02e","tarball":"https://registry.npmjs.org/@aki77/claude-on-edit/-/claude-on-edit-0.7.0.tgz","fileCount":39,"integrity":"sha512-aY16PwSvLSDI4UGZtwnd93BvDNy7UhClpUk4w7XD/nQeneBFkIB+ICGRE8AYPj9cDx5yS1KKOAUKgxT7XPcj9g==","signatures":[{"sig":"MEYCIQC9If8fEzBg37n8L7gSnWjB29vU5+nEAii1teMYTxmUagIhAMjqx+gaWLgT6uKD/XehVEX0tTu4yI5RutikdpQojCy2","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":63022},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","engines":{"node":">=16.0.0"},"gitHead":"08602664458db1edcd257825d14a08569621a909","scripts":{"dev":"tsc --watch","test":"pnpm run build && node --test dist/test/**/*.test.js","build":"rm -rf dist && tsc","check":"biome check src/ --write","prepare":"pnpm run build","prepublishOnly":"pnpm run check && pnpm run build"},"_npmUser":{"name":"aki77","email":"lala.akira+npm@gmail.com"},"repository":{"url":"git+https://github.com/aki77/claude-on-edit.git","type":"git"},"_npmVersion":"9.6.6","description":"Run commands on files when Claude Code edits them","directories":{},"_nodeVersion":"22.14.0","dependencies":{"micromatch":"^4.0.8"},"_hasShrinkwrap":false,"packageManager":"pnpm@9.15.9+sha512.68046141893c66fad01c079231128e9afb89ef87e2691d69e4d40eee228988295fd4682181bae55b58418c3a253bde65a505ec7c5f9403ece5cc3cd37dcf2531","devDependencies":{"typescript":"^5.0.0","@types/node":"^20.0.0","@biomejs/biome":"^2.1.2","@types/micromatch":"^4.0.9"},"_npmOperationalInternal":{"tmp":"tmp/claude-on-edit_0.7.0_1753248321797_0.3901772460510027","host":"s3://npm-registry-packages-npm-production"}},"0.8.0":{"name":"@aki77/claude-on-edit","version":"0.8.0","description":"Run commands on files when Claude Code edits them","keywords":["claude","claude-code","format","lint","hook","posttooluse"],"type":"module","main":"dist/index.js","types":"dist/index.d.ts","bin":{"claude-on-edit":"dist/cli.js"},"engines":{"node":">=16.0.0"},"scripts":{"build":"rm -rf dist && tsc","dev":"tsc --watch","test":"pnpm run build && node --test dist/test/**/*.test.js","prepare":"pnpm run build","check":"biome check src/ --write","prepublishOnly":"pnpm run check && pnpm run build"},"devDependencies":{"@biomejs/biome":"^2.1.2","@types/micromatch":"^4.0.9","@types/node":"^20.0.0","typescript":"^5.0.0"},"repository":{"type":"git","url":"git+https://github.com/aki77/claude-on-edit.git"},"author":{"name":"aki77"},"license":"MIT","packageManager":"pnpm@9.15.9+sha512.68046141893c66fad01c079231128e9afb89ef87e2691d69e4d40eee228988295fd4682181bae55b58418c3a253bde65a505ec7c5f9403ece5cc3cd37dcf2531","dependencies":{"micromatch":"^4.0.8"},"gitHead":"6bdddd3a8946cfe9a79d09faed97f3e2cdbca111","bugs":{"url":"https://github.com/aki77/claude-on-edit/issues"},"homepage":"https://github.com/aki77/claude-on-edit#readme","_id":"@aki77/claude-on-edit@0.8.0","_nodeVersion":"22.14.0","_npmVersion":"9.6.6","dist":{"integrity":"sha512-BE8sesACxC6e4AJKF3RGNUTHYbCZWNfPC1+Yi/50R6o1bjplt7OBjqdKA/z3doi7rVz/xwhZEAMID+DCGoh69Q==","shasum":"684bb2aeedc873a398177e04ab3e49ed15430d9a","tarball":"https://registry.npmjs.org/@aki77/claude-on-edit/-/claude-on-edit-0.8.0.tgz","fileCount":39,"unpackedSize":61382,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDWFOYUwNvEKJqaAU800m2w7hpAX4Tgv4fndvzXaKDoCAIgAiqI31hkzJerhNEDU8UOPEccUx5632dLhkDL8A6tk7w="}]},"_npmUser":{"name":"aki77","email":"lala.akira+npm@gmail.com"},"directories":{},"maintainers":[{"name":"aki77","email":"lala.akira+npm@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/claude-on-edit_0.8.0_1758458460757_0.013386282337547684"},"_hasShrinkwrap":false}},"time":{"created":"2025-07-21T20:57:27.247Z","modified":"2025-09-21T12:41:01.146Z","0.1.0":"2025-07-21T20:57:27.526Z","0.2.0":"2025-07-21T21:41:00.540Z","0.3.0":"2025-07-22T04:15:20.148Z","0.4.0":"2025-07-22T08:35:48.596Z","0.5.0":"2025-07-22T11:07:41.840Z","0.6.0":"2025-07-23T00:03:28.656Z","0.7.0":"2025-07-23T05:25:21.965Z","0.8.0":"2025-09-21T12:41:00.952Z"},"bugs":{"url":"https://github.com/aki77/claude-on-edit/issues"},"author":{"name":"aki77"},"license":"MIT","homepage":"https://github.com/aki77/claude-on-edit#readme","keywords":["claude","claude-code","format","lint","hook","posttooluse"],"repository":{"type":"git","url":"git+https://github.com/aki77/claude-on-edit.git"},"description":"Run commands on files when Claude Code edits them","maintainers":[{"name":"aki77","email":"lala.akira+npm@gmail.com"}],"readme":"# Claude on Edit\n\nA post-tool-use hook for Claude Code that automatically runs commands on files when they are edited by Claude.\n\n## Overview\n\n`claude-on-edit` is a tool that integrates with Claude Code's hook system to automatically execute commands on files after they are modified by Write, Edit, or MultiEdit tools. This enables automatic formatting, linting, testing, and other file processing tasks whenever Claude makes changes to your codebase.\n\n## Features\n\n- 🚀 **One-command setup**: `init` command automatically configures everything\n- 📦 **lint-staged migration**: Automatically detects and converts existing lint-staged configuration\n- 🔧 **Claude Code integration**: Automatically sets up PostToolUse hooks in settings.json\n- 🎯 **Pattern-based configuration**: Define commands for specific file patterns using glob syntax\n- 🚀 **Multiple execution modes**: Run commands concurrently or sequentially\n- 📝 **Comprehensive logging**: Verbose output for debugging and monitoring\n- 🛡️ **Error handling**: Blocks unsafe operations when commands fail\n- 🔧 **Flexible command configuration**: Support for simple commands, arrays, and functions\n- 🏃‍♂️ **Dry run mode**: Test your configuration without executing commands\n\n## Installation\n\n```bash\nnpm install -g @aki77/claude-on-edit\n```\n\n## Quick Start\n\n### 1. Initialize Configuration\n\nRun the init command to set up everything automatically:\n\n```bash\nnpx @aki77/claude-on-edit init\n```\n\nThis will:\n- Create a `.claude/claude-on-edit.config.js` configuration file\n- Automatically detect and migrate existing `lint-staged` configuration from `package.json`\n- Set up Claude Code hooks in `.claude/settings.json`\n- Configure the PostToolUse hook to run automatically on file edits\n\n### 2. Get Help\n\nView usage instructions and examples:\n\n```bash\nnpx @aki77/claude-on-edit --help\n```\n\n## Configuration\n\nCreate a `.claude/claude-on-edit.config.js` file in your project:\n\n```javascript\nexport default {\n  // Format TypeScript/JavaScript files\n  \"**/*.{ts,js,tsx,jsx}\": \"npm run format\",\n\n  // Run linter on specific patterns\n  \"src/**/*.ts\": [\"npm run lint\", \"npm run typecheck\"],\n\n  // Dynamic commands using functions\n  \"**/*.json\": (file) => `jsonlint ${file}`,\n\n  // Multiple commands for Python files\n  \"**/*.py\": [\n    \"black .\",\n    \"ruff check --fix\",\n    \"mypy\"\n  ]\n};\n```\n\n## CLI Commands\n\n### Help Command\n\nDisplay usage information and examples:\n\n```bash\nnpx @aki77/claude-on-edit --help\n# or\nnpx @aki77/claude-on-edit -h\n```\n\n### Init Command\n\nCreate a configuration file template and set up Claude Code hooks:\n\n```bash\nnpx @aki77/claude-on-edit init\n```\n\nThe init command will:\n- Create `.claude/claude-on-edit.config.js` with a comprehensive configuration template\n- Detect existing `lint-staged` configuration in `package.json` and migrate it automatically\n- Set up `.claude/settings.json` with the appropriate PostToolUse hook configuration\n- Handle existing settings by merging rather than overwriting\n\nIf a configuration file already exists, you'll be prompted to confirm overwriting it.\n\n## Usage\n\n### Automatic Setup (Recommended)\n\nAfter running `npx @aki77/claude-on-edit init`, the tool is automatically configured and ready to use. No manual setup required!\n\n### Manual Setup (Advanced)\n\nIf you need to manually configure the PostToolUse hook, add the following to your Claude Code settings (`.claude/settings.json`):\n\n```json\n{\n  \"hooks\": {\n    \"PostToolUse\": [\n      {\n        \"matcher\": \"(Write|Edit|MultiEdit)\",\n        \"hooks\": [\n          {\n            \"type\": \"command\",\n            \"command\": \"npx -y @aki77/claude-on-edit\"\n          }\n        ]\n      }\n    ]\n  }\n}\n```\n\n## Configuration Options\n\nThe configuration file supports three types of command definitions.\n\n### File Placeholder\n\nYou can use `{file}` placeholder in your commands, which will be replaced with the actual file path:\n\n```javascript\nexport default {\n  \"**/*.ts\": \"eslint {file} --fix\"\n};\n```\n\nIf the placeholder is not used, the file path will be appended to the command automatically.\n\n### 1. Simple String Commands\n\n```javascript\nexport default {\n  \"**/*.ts\": \"npm run format\"\n};\n```\n\n### 2. Array of Commands\n\n```javascript\nexport default {\n  \"**/*.ts\": [\n    \"npm run lint\",\n    \"npm run typecheck\",\n    \"npm run test\"\n  ]\n};\n```\n\n### 3. Function-based Commands\n\n```javascript\nexport default {\n  \"**/*.css\": (file) => `stylelint --fix ${file}`,\n  \"**/*.md\": (file) => `markdownlint ${file}`\n};\n```\n\n## Environment Variables\n\nConfigure behavior using environment variables:\n\n- `CLAUDE_ON_EDIT_VERBOSE=true`: Enable verbose logging\n- `CLAUDE_ON_EDIT_CONCURRENT=false`: Disable concurrent command execution\n- `CLAUDE_ON_EDIT_DRY_RUN=true`: Enable dry run mode (show commands without executing)\n\n## Supported Tools\n\nThe hook responds to the following Claude Code tools:\n\n- `Write`: When a new file is created or an existing file is overwritten\n- `Edit`: When a file is modified using find-and-replace\n- `MultiEdit`: When multiple edits are made to a single file\n\n## Error Handling\n\nWhen commands fail, the hook will:\n\n1. Log detailed error information\n2. Block the operation to prevent unsafe changes\n3. Return a structured error response to Claude Code\n\nExample error output:\n\n```json\n{\n  \"decision\": \"block\",\n  \"reason\": \"Command failed: npm run lint\",\n  \"details\": {\n    \"command\": \"npm run lint\",\n    \"stderr\": \"Error: Linting failed with 3 errors\",\n    \"exitCode\": 1\n  }\n}\n```\n\n## Examples\n\n### Basic Formatting Setup\n\n```javascript\nexport default {\n  \"**/*.{js,ts,jsx,tsx}\": \"prettier --write\",\n  \"**/*.css\": \"stylelint --fix\",\n  \"**/*.md\": \"markdownlint --fix\"\n};\n```\n\n### Advanced Multi-step Processing\n\n```javascript\nexport default {\n  \"src/**/*.ts\": [\n    \"eslint --fix\",\n    \"tsc --noEmit\",\n    \"jest --findRelatedTests --passWithNoTests\"\n  ],\n  \"**/*.json\": (file) => [\n    `jsonlint ${file}`,\n    \"npm run validate-schema\"\n  ]\n};\n```\n\n## License\n\nMIT License - see the [LICENSE](LICENSE) file for details.\n\n## Related Projects\n\n- [Claude Code](https://docs.anthropic.com/en/docs/claude-code) - The official Claude CLI tool\n- [Anthropic Claude](https://anthropic.com/claude) - The AI assistant that powers Claude Code\n","readmeFilename":"README.md"}