Introducing CocoUnlock: A Lightweight CLI Tool to Release Windows File Locks for Seamless Dev & AI Workflows
Anyone who develops on Windows has encountered the dreaded EBUSY, Resource in use, or Access is denied errors during builds and cleanups.
This is particularly painful in Android development, where lingering background Gradle daemons, Java workers, or Kotlin compiler caches lock output .jar or .aar files in build/ directories. It is equally annoying when npm clean or git checkout halts on locked binaries inside node_modules.
While GUI tools like Microsoft PowerToys’ File Locksmith exist, they demand manual mouse interactions: right-clicking a locked directory in File Explorer, opening a separate window, and confirming. That completely breaks automated build pipelines, terminal-first workflows, and autonomous AI agents.
To solve this once and for all, I built CocoUnlock—a zero-dependency, standalone Windows CLI utility that takes a file or folder path, identifies all locking processes, and terminates them directly from the console.
🎯 Key Features
- Terminal-First & Scriptable: Accepts any target file or folder path as a positional argument.
- AI-Agent Ready: Because it can run non-interactively via
--yes, you can configure global rules in AI CLI assistants (like OpenCode or Claude Code) to automatically release build locks when cleanup commands fail, preventing disrupted workflows. - Lightweight & Portable: A single native 64-bit Windows binary with zero runtime prerequisites.
- Inspection Mode: List locked processes without killing them (
--list).
💻 CLI Usage
1 | # Interactive mode: inspects locks, then prompts for confirmation before killing |
Visual Preview
CocoUnlock identifying and terminating processes locking an Android build directory
📦 Open Source & Download
- GitHub Repository: github.com/cocozq/CocoUnlock
- Direct Binary Download: CocoUnlock-win-x64-1.0.zip (or via mirror download)
Simply drop CocoUnlock.exe into your system PATH (e.g., C:\Windows or ~/bin), and pass -y whenever your build scripts hit a file lock!