{"_id":"@claude-tools-i-use/ai-conflict-sync","_rev":"2-c64f4dc3ad3107e171137604dd74106a","name":"@claude-tools-i-use/ai-conflict-sync","dist-tags":{"latest":"0.1.1"},"versions":{"0.1.0":{"name":"@claude-tools-i-use/ai-conflict-sync","version":"0.1.0","keywords":["ai","ide","vscode","conflict","sync","claude","cursor"],"author":{"name":"Josh Duffy"},"license":"MIT","_id":"@claude-tools-i-use/ai-conflict-sync@0.1.0","maintainers":[{"name":"nahsuhn","email":"josh@joshduffy.dev"}],"homepage":"https://joshduffy.dev/tools","bugs":{"url":"https://github.com/joshduffy/claude-tools/issues"},"bin":{"acs":"dist/cli.js","ai-conflict-sync":"dist/cli.js"},"dist":{"shasum":"bdee745c72ff940933c61c9d177d8dc2f1152396","tarball":"https://registry.npmjs.org/@claude-tools-i-use/ai-conflict-sync/-/ai-conflict-sync-0.1.0.tgz","fileCount":26,"integrity":"sha512-lpjEXeLaS4R3R2Qoh/5Jo1/ilR1wcY+DXTZRrhXD09muzfM90Tr7n9oekpys3VIbmqVqjkJQsq7i4SCWGrAqLg==","signatures":[{"sig":"MEUCIQCPsCmt7i6X96lkNqHkSTxbwInF6hdtZ7XZU0DYdcxCHgIgSxVmU4dMao6+NIr0aTeZNHZ/6FysaFzA/YsxhJLltOc=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":36571},"main":"dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=18.0.0"},"gitHead":"a6ceb59b36aea27174fc92592592c70fac15e2b0","scripts":{"dev":"tsc --watch","test":"node --test","build":"tsc","clean":"rm -rf dist","start":"node dist/cli.js"},"_npmUser":{"name":"nahsuhn","email":"josh@joshduffy.dev"},"repository":{"url":"git+https://github.com/joshduffy/claude-tools.git","type":"git","directory":"packages/ai-conflict-sync"},"_npmVersion":"10.9.4","description":"Prevent AI coding tools from editing files with unsaved changes in your IDE","directories":{},"_nodeVersion":"22.21.0","dependencies":{"chokidar":"^3.5.3"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.7.0","@types/node":"^22.10.0"},"_npmOperationalInternal":{"tmp":"tmp/ai-conflict-sync_0.1.0_1768782438143_0.04466036122237926","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@claude-tools-i-use/ai-conflict-sync","version":"0.1.1","description":"Prevent AI coding tools from editing files with unsaved changes in your IDE","type":"module","main":"dist/index.js","bin":{"ai-conflict-sync":"dist/cli.js","acs":"dist/cli.js"},"scripts":{"build":"tsc","dev":"tsc --watch","start":"node dist/cli.js","test":"node --test","clean":"rm -rf dist"},"keywords":["ai","ide","vscode","conflict","sync","claude","cursor"],"author":{"name":"Josh Duffy"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/joshduffy/claude-tools.git","directory":"packages/ai-conflict-sync"},"homepage":"https://joshduffy.dev/tools","devDependencies":{"@types/node":"^22.10.0","typescript":"^5.7.0"},"dependencies":{"chokidar":"^3.5.3"},"engines":{"node":">=18.0.0"},"_id":"@claude-tools-i-use/ai-conflict-sync@0.1.1","gitHead":"dbfc20101e104f3f21104399db55a1402b2e138f","types":"./dist/index.d.ts","bugs":{"url":"https://github.com/joshduffy/claude-tools/issues"},"_nodeVersion":"22.21.0","_npmVersion":"10.9.4","dist":{"integrity":"sha512-uZwrrOqhoG1Q2pWYVTRFb+cx25bh+C2g3cFR4oCFbcHLOKNK3Ja6xmHLHSFXTQBTwJbvA1xIOrfTweYWm1qVoQ==","shasum":"9347c4afb56178c49e5073f527ac4cd34033064e","tarball":"https://registry.npmjs.org/@claude-tools-i-use/ai-conflict-sync/-/ai-conflict-sync-0.1.1.tgz","fileCount":26,"unpackedSize":36575,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDJT9VWXruTgzirZ60e1Dgzko4Gsrjgam/45QgvZ6atRgIhAKbjsrEm4EpFjGmw2PinS5IdfhhMHDOi1j1QaGU2Qwbh"}]},"_npmUser":{"name":"nahsuhn","email":"josh@joshduffy.dev"},"directories":{},"maintainers":[{"name":"nahsuhn","email":"josh@joshduffy.dev"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/ai-conflict-sync_0.1.1_1768782651142_0.30456895230999215"},"_hasShrinkwrap":false}},"time":{"created":"2026-01-19T00:27:18.068Z","modified":"2026-01-19T00:30:51.456Z","0.1.0":"2026-01-19T00:27:18.291Z","0.1.1":"2026-01-19T00:30:51.325Z"},"bugs":{"url":"https://github.com/joshduffy/claude-tools/issues"},"author":{"name":"Josh Duffy"},"license":"MIT","homepage":"https://joshduffy.dev/tools","keywords":["ai","ide","vscode","conflict","sync","claude","cursor"],"repository":{"type":"git","url":"git+https://github.com/joshduffy/claude-tools.git","directory":"packages/ai-conflict-sync"},"description":"Prevent AI coding tools from editing files with unsaved changes in your IDE","maintainers":[{"name":"nahsuhn","email":"josh@joshduffy.dev"}],"readme":"# ai-conflict-sync\n\nPrevent AI coding tools from editing files with unsaved changes in your IDE.\n\n## The Problem\n\nAI coding tools like Claude Code operate in the terminal, unaware of your IDE state. They frequently edit files you have open with unsaved changes, causing conflicts and lost work.\n\n## The Solution\n\n`ai-conflict-sync` creates a bridge between your IDE and AI tools:\n\n1. **Watch Mode**: Monitors files you're editing and creates lock markers\n2. **Check Mode**: AI tools can check if a file is safe to edit\n3. **Hook Mode**: Integrates with git pre-commit and AI tool hooks\n\n## Installation\n\n```bash\nnpm install -g ai-conflict-sync\n```\n\n## Usage\n\n### Start the Watcher Daemon\n\n```bash\n# Watch current directory for file changes\nacs watch\n\n# Watch specific directories\nacs watch src/ lib/\n\n# Run in background\nacs watch --daemon\n```\n\n### Check if Files are Safe to Edit\n\n```bash\n# Check a single file\nacs check src/index.ts\n\n# Check multiple files\nacs check src/*.ts\n\n# Exit codes: 0 = safe, 1 = conflicts found\n```\n\n### Manual Lock/Unlock\n\n```bash\n# Mark a file as being edited\nacs lock src/important.ts\n\n# Release the lock\nacs unlock src/important.ts\n\n# List all locked files\nacs list\n```\n\n### Integration with Claude Code\n\nAdd to your `CLAUDE.md`:\n\n```markdown\nBefore editing any file, run: acs check <filepath>\nIf the check fails, ask the user to save their changes first.\n```\n\nOr use the Claude Code hook (in `~/.claude/hooks.json`):\n\n```json\n{\n  \"pre_edit\": {\n    \"command\": \"acs check $FILE\",\n    \"on_fail\": \"abort\"\n  }\n}\n```\n\n## How It Works\n\n1. **File Watching**: Uses chokidar to detect file modifications\n2. **Lock Files**: Creates `.acs-lock` markers in a temp directory\n3. **Staleness Detection**: Compares file mtime with last known state\n4. **IDE Integration**: Can read VS Code's workspace state (optional)\n\n## Lock File Format\n\nLocks are stored in `~/.ai-conflict-sync/locks/`:\n\n```json\n{\n  \"file\": \"/path/to/file.ts\",\n  \"lockedAt\": \"2026-01-04T12:00:00Z\",\n  \"lastMtime\": 1704369600000,\n  \"reason\": \"file_modified\"\n}\n```\n\n## Configuration\n\nCreate `~/.ai-conflict-sync/config.json`:\n\n```json\n{\n  \"watchPaths\": [\"~/projects\"],\n  \"ignorePaths\": [\"node_modules\", \".git\", \"dist\"],\n  \"lockTimeout\": 300,\n  \"daemon\": false\n}\n```\n\n## Commands\n\n| Command                | Description                     |\n| ---------------------- | ------------------------------- |\n| `acs watch [paths...]` | Start watching for file changes |\n| `acs check <file>`     | Check if file is safe to edit   |\n| `acs lock <file>`      | Manually lock a file            |\n| `acs unlock <file>`    | Release a lock                  |\n| `acs list`             | List all active locks           |\n| `acs clear`            | Clear all locks                 |\n| `acs status`           | Show daemon status              |\n\n## License\n\nMIT\n","readmeFilename":"README.md"}