# Restart the Rust server when its code changes

> We wanted the Rust dev server to rebuild and restart on a remote machine whenever a source file changes. Talira ranked watchexec first and we kept it, but the four results under it don't do the job.

Source: https://talira.ai/dev-log/auto-restart
All of Talira's documentation: https://talira.ai/llms.txt

16 November 2026

**Problem:** Rebuild and restart a Rust web server automatically when source files change during development, with the build running on a remote Linux machine.

**Outcome:** Kept it: [watchexec](https://talira.ai/catalog/watchexec-dq0r57ke)

## What we searched for

"During development I want my Rust (and Go) web server to rebuild and restart automatically whenever I change a source file, instead of stopping and re-running it by hand. The build runs over ssh on a remote Linux box." (also "restart the server automatically when files change", "file watcher that reruns a command on change (live reload for a Rust or Go web app)", "cargo watch replacement; hot reload for a Go web server")

1. ✓ [watchexec](https://talira.ai/catalog/watchexec-dq0r57ke): Fits the search
2. ✗ [Loco](https://talira.ai/catalog/loco-sdpwth2g): Shouldn't have been shown: Rust web framework; no file-watching restart in its record.
3. ✗ [tmux](https://talira.ai/catalog/tmux-ascmm3ym): Shouldn't have been shown: a terminal multiplexer; matched the ssh and remote box context, not the need
4. ✗ [Puma](https://talira.ai/catalog/puma-qdbe2rmt): Shouldn't have been shown: Ruby web server.
5. ✗ [cargo-chef](https://talira.ai/catalog/cargo-chef-77antavs): Shouldn't have been shown: Docker layer caching for Rust builds.

In the latest eval run (24 Nov 2026), this search shows 5 results: 4 fit and 1 isn't graded yet.

1. ✓ [watchexec](https://talira.ai/catalog/watchexec-dq0r57ke): Fits the search
2. ✓ [entr](https://talira.ai/catalog/entr-tnjj7sns): Fits the search
3. ✓ [bacon](https://talira.ai/catalog/bacon-sqn1nm4z): Fits the search
4. [Docker Compose](https://talira.ai/catalog/docker-compose-xmpvhqkn)
5. ✓ [Air](https://talira.ai/catalog/air-x5em024g): Fits the search

## Why

Talira's builds run on a home server, not the laptop, so the watcher has two jobs: sync changed files from the laptop,
and rebuild and restart the server on the build machine. watchexec restarts a long-running process on change, folds a
burst of saves into one rebuild and works for any language, so it does both. We also looked at cargo-watch, which
Loco's own watch command wraps: it's unmaintained, and when a build fails it leaves no server running.

We'd used [Air](https://github.com/air-verse/air), a live reloader for Go, on an earlier project. Talira didn't list it
yet, so we suggested it.

Talira ranked watchexec first, but the four results under it don't do this. They matched words in the question, not
the need: Loco is a Rust web framework, tmux a terminal multiplexer (from "ssh … remote box"), Puma a Ruby app server
with its own restart, and cargo-chef a Docker build cache. All four are now eval cases with rules that they must never
be shown for this search, and we'll re-run the search here as search improves.

## How we grade the results

Each search shows what Talira returned at the time, wrong results included, and we grade every result: ✓ Fits the search, ~ Related, not an answer, ✗ Shouldn't have been shown.

Every search here is also a case in our search evals. The clearly wrong results get a rule that they must never be shown for that search, and we tune search against those cases. Under each search is how it does in the latest eval run, so you can watch the same searches improve.
