jevsnes.git / tools / README.md
1# Chapter 24: tools, programs about the build, not the game
2
3Everything in `apps/` plays or tests the game. Everything here is for the
4person (or agent) *working on* it: getting an MCP client connected to the
5window in milliseconds, checking from a cron job that Jev is still being
6asked, and swapping new code into a running window without losing the
7game.
8
9They have one thing in common: they talk to the window from outside, over
10its MCP endpoint (`http://127.0.0.1:7637/mcp`, chapter 8) or, for the MCP
11launcher, by starting the stdio proxy that talks to it.
12
13```mermaid
14flowchart LR
15  client["MCP client (Claude Code)"] -->|"stdio"| launch["tools/mcp/launch.sh"]
16  launch -->|"execs"| proxy["run/bin/native mcp"]
17  proxy -->|"HTTP"| window["the window, :7637"]
18  watch["tools/watch/budget.sh"] -->|"HTTP"| window
19  patch["tools/hotpatch/patch.sh"] -->|"HTTP: dev_mode, hot_patch"| window
20```
21
22> **Aside: shell where it is small, Rust where it is not.** `tools/mcp` and
23> `tools/watch` are bash, kept shellcheck-clean, and `budget.sh` keeps every
24> piece of parsing in a small function its self-test can call. When
25> something outgrows that (building an ELF shared object from object files,
26> say), it is Rust, as `tools/hotpatch` is.
27
28> **Try it.** `nix develop -c shellcheck tools/mcp/*.sh tools/watch/*.sh`
29> prints nothing: both are kept clean. (`tools/hotpatch/patch.sh` has one
30> `info`-level note about `ls`, as of 2026-10-02.)
31
32## For the people who maintain it
33
34### In this folder
35
36| Path | Chapter | What |
37| --- | --- | --- |
38| [mcp/](mcp/) | 25 | What `.mcp.json` starts: a launcher that execs a kept copy of `native` as the stdio MCP proxy, never building, and the script that refreshes the copy. |
39| [watch/](watch/) | 26 | A one-line status from the running window (task, mode, position, questions in the last minute, what is stopping questions), with exit codes for a watchdog. |
40| [hotpatch/](hotpatch/) | 27 | Builds a Dioxus-subsecond patch from objects buck2 just rebuilt, and the script that drives the whole rebuild-and-patch cycle. |
41| [README.md](README.md) | | This chapter. |
42| [CLAUDE.md](CLAUDE.md) | | How to build and run tools here, for agents. |
43
44← Previous: [Chapter 23, fixtures/](../research/fixtures/) · Up: [jevsnes](../) · Next: [Chapter 25, mcp/](mcp/) →