From a restaurant you can watch to one you can measure: a view of the work itself, with a target and a chart for everything on screen. Built by Pasha and Claude in about two hours.
The source for this episode is on GitHub: Semantic-Works-LLC/semantic-works-public
The finished restaurant runs live on the next slide, inside this presentation. Nothing to install, nothing to configure.
Play with it live View the source code on GitHub
You can also see the source code of everything presented here, and how the application runs.
Press ▶ below to play with it. After that, ▶ continues with the story.
We built a restaurant simulator, and it is running right now. Close this window, then interact with it:
When you are done, press ▶ below to see how it was built.
Close View the source code on GitHubLook around the project, start the local server, and let's see the Cyber Kitchen in operation before we go on.Pasha
Episode 1 left an animated floor plan: twelve tables, two waiters, two cooks, tickets on a rail and plates on a pass, with every object clickable.
It shows the restaurant as a room. You can watch it get crowded, but nothing on the page says where the time goes.
We copied it into a new folder, so Episode 1 stays as its own record.
… add another view: a graph of the flow of work. I need your help, because I don't know exactly how to model it. Some things are stationary, like tables and stoves, and some move, like guests, waiters and food. How should I model this as a flow of work so that I can optimize the flow later?Pasha, lightly trimmed
Claude's recommendation, given in chat before any building: model the work, not the movement.
| Role | What it is | In the restaurant |
|---|---|---|
| Flow item | The thing that travels and gets finished | A party, which becomes an order ticket, which becomes plates |
| Step | Something that happens to the item, or a place it waits | At the door, reading the menu, ticket on the rail, cooking, eating |
| Resource | Limited capacity a step needs before it can start | Tables, waiters, cooks, stoves, the pizza oven, the coffee machine |
Waiters and cooks are resources, although they move. Food stays a stage of the order and not a separate item, because here one cook makes a whole order and it goes out together.
A new button flips the page between the restaurant and a second view. Both draw the same running simulation, and a selection made in one is kept in the other.
While this was being built, Pasha asked for no new tests and no test runs, to move faster.
I'm not sure I like the model you built, visually.Pasha
Pasha described three sections, and we built them as a board of cards:
The same button now cycled through three views.
I like the third view, but I'd like to see more motion.Pasha
Claude could not look at this one: the browser pane was hidden, so it was checked only from inside the page. Pasha looked, and the board did not hold up.
I have difficulty understanding this view.Pasha
Pasha asked for something generic: things start on the left and complete on the right, with nothing tied to the room.
This view is much better. I'm surprised the cook does not put the food into the "food on pass" state … "food on pass" may not be a state of the table. Maybe it's a queue, which we should represent differently.Pasha, lightly trimmed
This is where the model settled: a step is where something happens, and a queue is where things wait for someone.
The idea was Pasha's: the party's states as the foundation, with the two queues modelled as things of their own.
Pasha's description got stuck on how a cook moves food between states. In this layout the cook never touches a party state: the cook moves only between the two queues, and the waiter connects the party to them.
This view is perfect.Pasha
You made some changes I didn't ask for. Please be careful and follow my instructions. I accept these changes as they are, but keep this in mind for the future.Pasha
He was right. In fixing the selection, Claude had also done four things nobody asked for:
They stayed, as Pasha said. From then on Claude made only the requested change and listed anything else as a suggestion for Pasha to decide.
The about card became static text. Under it, each object got a metrics card:
The 80% limit for kitchen equipment is Pasha's. Every other target is Claude's judgement, set near what the simulation produces.
Pasha also asked for 8× and 16× speeds, just to see.
With the clock at 16×, the front door's card after 35 simulated minutes:
Each bar in the chart is one party, green within the target and red over it.
These figures come from invented timings. What is real is that the page can now say where the waiting is.
The first charts were ordered by party, not by time. Pasha asked for a second chart under each, on real clock time:
In the same stretch, "Wait for food" got a card of its own, the page went down to one legend shared by both views, and the prep counter, sink and fridge left the service view.
How did you set the targets? Are they just random numbers, or something better?Pasha
Not random, but not much better. Apart from the 80%, each was picked by judgement to sit near what this simulation produces.
| Target | Value | Where it came from |
|---|---|---|
| Equipment in use | At most 80% | Pasha's number |
| Waiter or cook busy | At most 85% | A guess at "almost always busy" |
| Ticket on the rail | At most 0:15 | One short wait for a free person |
| Food on the pass | At most 0:10 | Short on purpose, because food goes cold there |
| Order taken to served | At most 1:00 | A round number near the average in test runs |
The simulation's seconds are not restaurant minutes, so none of these says anything about a real dining room. Better targets would come from the owner's service standard, or from times measured on a real evening.
Until now all the JavaScript sat inside the HTML file. Pasha asked for small modules, built back into one standalone page.
| Path | What it is |
|---|---|
js/ | 23 small files, one per area: staff, guests, orders, metrics, charts and so on |
index.template.html | The HTML and CSS, with one marker line where the JavaScript goes |
build.py | Copies the files into the template and writes the page |
site/index.html | The built page: still one standalone file |
Every file goes in byte for byte, and the build checks that.
js/ folder in Pasha's editor.| Suite | Tests | Coverage |
|---|---|---|
| Python server | 20 | 100% of server.py |
| Browser tests of the page | 191 | 100% of every module (1368 lines) |
| Total | 211, all passing |
The same restaurant, drawn as work.
It's all done!!! See where every order waits, check anything against its target, and change the staff to watch the queues move.
You can run it yourself in a minute, with nothing to install but Python.
Counted from the session's own log: 49.4 million tokens across 151 requests to the model, all Claude Opus 5.5.
| Kind | Tokens | What it is |
|---|---|---|
| Re-read from cache | 48,627,115 | The conversation so far, read again on every request. This is 98.4% of the total and is billed at a small fraction of the normal rate. |
| New input | 454,672 | Text entering the conversation for the first time: Pasha's messages, tool results, files and screenshots. |
| Output | 322,243 | Everything Claude wrote: answers, code, commands and its working notes. |
| Total | 49,404,030 |
The total is large because of how a long conversation works, not because much was written. Each of the 151 requests re-reads everything before it, so the same text is counted again and again: on average about 322,000 tokens of history per request. Not included: the next morning's wording changes to the README and the commit.
Other statistics
About $19.80 on Claude Opus 5.5, the model that ran the session.
| Model | Rough cost | Notes |
|---|---|---|
| Claude Opus 5.5 | about $19.80 | What we used: $9.73 for cache re-reads, $3.64 for new input, $6.44 for output. |
| Claude Sonnet 5.5 | about $14.80 | The same token counts at Sonnet's prices. Its cache-read price is the same as Opus. |
Caching is what keeps this small. With no caching, every re-read would be billed as fresh input: about $203 on Opus 5.5.
The conversation that built the page, with Pasha's words as spoken, is in TRANSCRIPT.md.
The story of the floor plan it started from is in Episode 1.
There is more from Semantic Works to explore.
Happy vibe coding with LLM AI!