a73x

8a138279

docs: README and .mcp.json template

a73x   2026-04-29 09:01

Commit message
docs: README and .mcp.json template

.mcp.json
Old New
@@ -0,0 +1,8 @@
1 {
2 "mcpServers": {
3 "filewatch": {
4 "command": "filewatch-mcp",
5 "args": ["--root", "."]
6 }
7 }
8 }
README.md
Old New
@@ -0,0 +1,92 @@
1 # claudealong
2
3 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.
4
5 ## What it does
6
7 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.
8
9 Before:
10
11 ```go
12 // @claude write a table-driven test for the Reverse function
13 func Reverse(s string) string {
14 ```
15
16 After Claude has acted (the marker line is removed and the test is written):
17
18 ```go
19 func Reverse(s string) string {
20 ```
21
22 If Claude only needed to answer a question (no file change), it removes the marker line and replies in the session.
23
24 ## Install
25
26 ```bash
27 go install github.com/xanderle/claudealong/cmd/filewatch-mcp@latest
28 ```
29
30 For local development:
31
32 ```bash
33 git clone https://github.com/xanderle/claudealong
34 cd claudealong
35 make install
36 ```
37
38 ## Configure
39
40 1. Copy `.mcp.json` from this repo to the root of any project where you want `@claude` markers.
41
42 2. Start Claude Code with channels enabled:
43
44 ```bash
45 claude --dangerously-load-development-channels server:filewatch
46 ```
47
48 Once Anthropic approves the channel for general distribution, `--channels` will work instead.
49
50 ## Supported languages
51
52 | Comment style | Extensions / filenames |
53 |---|---|
54 | `//` | Go, JavaScript, TypeScript, JSX, TSX, C, C++, Rust, Java, Kotlin, Swift, Scala, C# |
55 | `#` | Python, Ruby, Shell (sh/bash/zsh), YAML, TOML, Makefile, Dockerfile |
56 | `--` | SQL, Lua, Haskell, Elm |
57 | `/* ... */` (single-line) | CSS |
58 | `<!-- ... -->` (single-line) | HTML, XML, Markdown |
59
60 Files with other extensions are skipped silently. Block-comment markers (`/* */`, `<!-- -->`) must fit on one line in v1.
61
62 ## How dedupe works
63
64 When the watcher first sees `@claude ...` in a file, it rewrites that line in place, splicing in a `[fw-XXXXXXXX]` tag:
65
66 ```
67 // @claude[fw-3a9f12bc] write a test for foo
68 ```
69
70 Tagged markers are never re-emitted. Claude removes the entire tagged line as part of handling the ask, so your file ends up clean.
71
72 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.
73
74 ### Editor behavior on watcher rewrites
75
76 The watcher edits your file to insert the tag. Most editors handle this gracefully:
77
78 - **VS Code, Vim (`set autoread`):** auto-reload, no friction.
79 - **JetBrains IDEs:** prompt on external change — accept the reload.
80 - **Other editors:** check whether they auto-reload or prompt on external modifications.
81
82 ## Limitations (v1)
83
84 - Single-line markers only. Multi-line block comments are not supported.
85 - One project per Claude Code session. Running two sessions against the same directory will produce duplicate channel notifications.
86 - Linux and macOS. Windows is untested.
87 - Hard-excluded paths: `.git/`, `node_modules/`, `dist/`, `build/`, `target/`, `.venv/`. Excluded suffixes: `.swp`, `.tmp`, `.lock`. Everything in `.gitignore` is also excluded.
88
89 ## Flags
90
91 - `--root <path>` — directory to watch (default: `.`).
92 - `--debounce <duration>` — trailing-edge debounce per file (default: `500ms`). JetBrains autosave bursts may need a longer value, e.g. `--debounce 1s`.