a73x

README

claudealong

Write a comment in your code, save the file. A Claude Code session watching the project sees the comment, does the work, and removes the marker. No switching windows, no copy-paste.

What it does

Write // @claude write a test for foo anywhere in a source file and save. The filewatch-mcp server detects the marker, emits a <channel> block to Claude Code containing the file path, line number, and your ask. Claude reads the file, does the work, and removes the marked line. To prevent the same marker from firing again on subsequent saves, the watcher stamps it inline with a short tag — [fw-XXXXXXXX] (8 hex chars) — the first time it is seen. Claude strips the entire tagged line as part of handling the request.

Before:

// @claude write a table-driven test for the Reverse function
func Reverse(s string) string {

After Claude has acted (the marker line is removed and the test is written):

func Reverse(s string) string {

If Claude only needed to answer a question (no file change), it removes the marker line and replies in the session.

Install

go install github.com/xanderle/claudealong/cmd/filewatch-mcp@latest

For local development:

git clone https://github.com/xanderle/claudealong
cd claudealong
make install

Configure

  1. Copy .mcp.json from this repo to the root of any project where you want @claude markers.

  2. Start Claude Code with channels enabled:

    claude --dangerously-load-development-channels server:filewatch
    

    Once Anthropic approves the channel for general distribution, --channels will work instead.

Supported languages

Comment styleExtensions / filenames
//Go, JavaScript, TypeScript, JSX, TSX, C, C++, Rust, Java, Kotlin, Swift, Scala, C#
#Python, Ruby, Shell (sh/bash/zsh), YAML, TOML, Makefile, Dockerfile
--SQL, Lua, Haskell, Elm
/* ... */ (single-line)CSS
<!-- ... --> (single-line)HTML, XML, Markdown

Files with other extensions are skipped silently. Block-comment markers (/* */, <!-- -->) must fit on one line in v1.

How dedupe works

When the watcher first sees @claude ... in a file, it rewrites that line in place, splicing in a [fw-XXXXXXXX] tag:

// @claude[fw-3a9f12bc] write a test for foo

Tagged markers are never re-emitted. Claude removes the entire tagged line as part of handling the ask, so your file ends up clean.

If the watcher and your editor write to the file at the same instant (mtime conflict), the rewrite is aborted cleanly. The marker stays untagged and will be picked up on the next save.

Editor behavior on watcher rewrites

The watcher edits your file to insert the tag. Most editors handle this gracefully:

  • VS Code, Vim (set autoread): auto-reload, no friction.
  • JetBrains IDEs: prompt on external change — accept the reload.
  • Other editors: check whether they auto-reload or prompt on external modifications.

Limitations (v1)

  • Single-line markers only. Multi-line block comments are not supported.
  • One project per Claude Code session. Running two sessions against the same directory will produce duplicate channel notifications.
  • Linux and macOS. Windows is untested.
  • Hard-excluded paths: .git/, node_modules/, dist/, build/, target/, .venv/. Excluded suffixes: .swp, .tmp, .lock. Everything in .gitignore is also excluded.

Flags

  • --root <path> — directory to watch (default: .).
  • --debounce <duration> — trailing-edge debounce per file (default: 500ms). JetBrains autosave bursts may need a longer value, e.g. --debounce 1s.

Open Patches

No open patches.

Open Issues

Recent Commits

Commit Summary Author Date
b4909168 feat(mcp): advertise channel handling protocol via init instructions a73x 2026-04-29
8a138279 docs: README and .mcp.json template a73x 2026-04-29
566ae22e test: end-to-end save-to-stamp integration a73x 2026-04-29
23114045 feat: wire watcher → scanner → mcp → rewriter in main a73x 2026-04-29
7e1e81c1 feat(mcp): emit notifications/claude/channel via direct JSON-RPC a73x 2026-04-29
81bc3bab refactor(watcher): use t.Context() and range over int in tests a73x 2026-04-29
e4641798 feat(watcher): fsnotify with WRITE+CREATE+RENAME, debounce, ignore a73x 2026-04-29
72b365b6 refactor(ignore): use slices.Contains and strings.SplitSeq a73x 2026-04-29
325329b2 feat(ignore): gitignore + hard-excludes with live reload a73x 2026-04-29
b563e86e test(rewriter): deterministic concurrent-modification path a73x 2026-04-29