TECHNOLOGY

Qwen Code v0.27.0 FileChanged hooks and safe local file reconciliation

In this article
THE QUICK TAKE

Use FileChanged events as reconciliation signals and check local-session scope, repeated writes and path identity before triggering an action.

Qwen Code v0.27.0 adds FileChanged hooks for local non-managed sessions. The notes name additions, changes and deletions for watched files and directories. A good hook treats a change event as a reason to inspect the workspace and chooses an action based on the state it finds.

Use a harmless fixture directory

Configure a hook to observe only a temporary directory in an ordinary local session. Add, edit and remove a sample file, then record the events received. Repeat the scenario in the managed mode to establish the scope described by the release. Keep user projects outside the initial test.

Include an atomic replacement

Many editors save through a temporary file followed by a rename. Use one editor save and one script that directly modifies a file. Compare the event stream and final path contents. Node.js file watcher documentation notes that observations vary across platforms. Test the operating systems and filesystems actually used by your team.

Avoid loops caused by the hook

If the hook produces an artifact, place it outside its watched paths or record why its own write will be ignored. Run a burst of edits and observe whether the hook triggers itself. Track the latest version of the input and make the resulting action safe to run again after a duplicate event.

Verify scope before consuming a path

For a deletion or move, the original path may no longer resolve. Reconcile the current directory state before reading contents. Validate any resolved path against the approved workspace. A hook that feeds file contents to an agent should deliberately choose which content is within its authorization boundary.

Keep events inspectable

Record the observed event, path and follow-up result without copying unnecessary content into logs. Keep a case for a deletion where the follow-up reads only the remaining directory state.

Primary sources

Earn rental income from GPUs

Have idle GPUs or looking to fund AI infrastructure? Retrivium finds a rental platform, sets up the server and helps you assess income and costs with a pilot.

Explore GPU hosting
← All articles