Skip to content

Loom can be tried in GitHub Codespaces: a dev container installs the latest release and connects Claude Code - #578

Merged
zlareb1 merged 11 commits into
mainfrom
feat/codespaces-try-out
Nov 12, 2026
Merged

zlareb1 merged 11 commits into
mainfrom
feat/codespaces-try-out

Conversation

@zlareb1

@zlareb1 zlareb1 commented Nov 12, 2026 •

Copy link
Copy Markdown
Member

Changelog category (leave one):

  • Improvement

Changelog entry (one or two sentences a user of Loom can read without the diff; the release pull request collects these into the release notes):

Loom can be tried with nothing installed: the README's "Open in GitHub Codespaces" button starts a codespace that installs the latest release, offers its dashboard and connects Claude Code to it.

Why

Every way to try Loom needs Docker on the user's machine. A codespace gives a newcomer without Docker, or one evaluating before installing anything, the same stack in a browser tab.

Design. .devcontainer/devcontainer.json runs an Ubuntu dev container with the docker-in-docker and Node features, asks for 4 CPUs and 16 GB (ClickHouse, the server and the document extractor), and forwards port 7777, which Codespaces keeps private to the signed-in user unless it is made public (the dev container spec has no visibility key), with onAutoForward: notify, since the port listens before Loom answers and a tab opened at once would show an error, and requireLocalPort, so desktop VS Code forwards to the laptop's port 7777, where the plugin looks, or reports the clash. LOOM_INSTALL_DIR=/workspaces/.loom (in containerEnv) keeps the install outside the home directory, which a rebuild replaces: a rebuilt container finds the same .env and Compose project, rather than starting a second stack with a new project that cannot get the port. .devcontainer/start-loom.sh runs on create; it stops when LOOM_INSTALL_DIR is unset, waits up to 60 s for the docker-in-docker daemon (the installer stops at once when it cannot reach Docker), claims the install directory with sudo when the container's user cannot write it, and then:

  1. downloads the latest release's install.sh, the file a user downloads, so the codespace runs a released installer with its own release's bundle;
  2. runs it with LOOM_SKIP_START=1, which writes the stack files and .env;
  3. adds LOOM_PUBLIC_BASE_URL=https://$CODESPACE_NAME-7777.$GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN to .env. A server without sign-in answers only a loopback Host or its public URL's (web_refusal in server/main.py), and its dashboard's writes only from its own origin, which is then that URL. No other origin is trusted: an earlier push listed the laptop's loopback origins in LOOM_CORS_ORIGINS for desktop VS Code's forward, which would also trust any page the laptop serves on port 7777 in a browser-only codespace;
  4. runs the installer again, which keeps .env, starts the stack and waits for health;
  5. installs Claude Code and the Loom plugin, as the README's two commands do, adding the marketplace only when claude plugin marketplace list does not show it. Its closing message prints the dashboard's forwarded address (in desktop VS Code the Ports tab's local address is the laptop's localhost, which shows no data) and says to run cd ~ && claude, outside the checkout, whose agent instructions are for working on Loom itself. The script can be run again after a failed create; the docs say so.

A resumed codespace needs no start command: every service restarts unless stopped, so dockerd brings the stack back. Rerunning the installer on a rebuild finds .env in LOOM_INSTALL_DIR and keeps it with its Compose project, and moves the install to the latest release, as the docs say; the docs also say a rebuild may start with empty memories, since they live in Docker volumes; whether the docker-in-docker volume, and so the data, survives a rebuild is up to Codespaces and was not tested.

Security. The try-out runs single-user, with no sign-in, on loopback inside the codespace, as a local install does. In the browser, Codespaces forwards port 7777 privately: the forwarded address answers only the signed-in GitHub account. The docs say to keep it private, since public or private-to-organization visibility opens a server with no sign-in to everyone it is shared with, and the server cannot see that setting. Opened in desktop VS Code, the codespace also forwards the port to the laptop's localhost:7777, where it is as open as a local install to every program on the laptop, and only when that local port is free (requireLocalPort); the docs say both. A Host other than the codespace's address and loopback is refused (421), and the only trusted Origin is the forwarded address. The dashboard opened from the laptop's localhost:7777 therefore loads, but every request it makes is a POST with that Origin, reads included, so each is refused (403) and the page shows no data; the docs say to use the browser address. Admitting it safely needs the server to treat an Origin that matches its own loopback Host as same-origin while LOOM_PUBLIC_BASE_URL is set, which is a change to the server's origin check and is left for its own PR. The dashboard's connection lines name the forwarded address, which a CLI in the codespace cannot pass; the docs say agents inside the codespace use http://localhost:7777, which the installed plugin already uses.

Alternatives. Running the repository's own install.sh would pair main's installer with the latest release's bundle, two versions that were never released together. Building the image from source in the codespace would take far longer and run unreleased code. One-click deploys to hosted platforms serve a public URL, where single-user mode is unsafe and the server refuses to start without sign-in; they are left for a first boot that sets up sign-in in one step.

Scope and risk

New: .devcontainer/devcontainer.json, .devcontainer/start-loom.sh. Docs: a quickstart section, a button in README.md and README.zh-CN.md, and a repository-guide row. It becomes the repository's only dev container; it is a try-out, not a development environment, and both the file and the repository guide say so (a checkout's setup is docs/development). The install directory /workspaces/.loom sits next to the checkout, not in it, so its .env with the JWT secret is never in the working tree. Nothing in the server, the images or the installer changes.

Compatibility, rollout and rollback

  • Wire: none.
  • Operator steps: none.
  • Rollback: revert; existing codespaces keep running what they installed.

Tests

The "about 3 GB of images" in the docs is the measured cold pull of the 1.2.0 stack: the Loom image 2.0 GB, ClickHouse 921 MB and the extractor 369 MB on arm64.

All runs use the devcontainers CLI 0.80.2 on an arm64 host, with CODESPACE_NAME and GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN set as a codespace sets them (devcontainer up --workspace-folder . --remote-env CODESPACE_NAME=day0-test --remote-env GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN=app.github.dev), installing release 1.2.0. Each container, its volumes and its image were removed after the run.

  • First design (install in ~/.loom): created cold in 260 s. Inside: .env held LOOM_PUBLIC_BASE_URL=https://day0-test-7777.app.github.dev; the dashboard as a navigation with the codespace's Host: 200; memory.set with that Host and its https:// Origin: 200; with Origin http://localhost:7777: 200; a foreign Host: 421; a foreign Origin: 403; claude mcp list: plugin:loom:loom ... Connected.
  • Rebuild, with a named volume mounted at /workspaces/.loom standing in for the codespace's persistent /workspaces (--mount type=volume,source=...,target=/workspaces/.loom, then the same with --remove-existing-container): the first try failed with Permission denied on the root-owned directory, which the sudo step fixes. Then: created in 98 s; a memory written; rebuilt in 30 s with the same COMPOSE_PROJECT_NAME, the three containers healthy, the memory read back (the volumes lived on in the reused docker-in-docker volume) and claude mcp list Connected.
  • With both loopback origins and no start command (an earlier push): created in 112 s; .env holds LOOM_CORS_ORIGINS=http://localhost:7777,http://127.0.0.1:7777; memory.set with Origin http://127.0.0.1:7777: 200, http://localhost:7777: 200, https://evil.example: 403; docker stop and docker start of the dev container: health answered 10 s after the start.
  • At 4693171, two commits before the CORS removal (daemon wait, notify, no visibility key, :? guard; the CORS and Host handling are the same as the run above): created in 119 s, health 200, claude mcp list Connected. The commits after it change only text and the closing message, and remove the CORS lines (run below).
  • At the head (no LOOM_CORS_ORIGINS): created in 181 s; .env holds only LOOM_PUBLIC_BASE_URL; memory.set with the codespace's Host and Origin: 200; with Origin http://localhost:7777: 403; with Origin http://127.0.0.1:7777: 403; with no Origin, as an agent or curl sends it: 200; claude mcp list Connected.
  • At the head: created in 225 s; the creation log ends with the installer's Dashboard: http://127.0.0.1:7777/ and then Loom is running in the codespace. Dashboard: https://day0-test-7777.app.github.dev; sh .devcontainer/start-loom.sh run a second time in the same container exits 0, .env still holds one LOOM_PUBLIC_BASE_URL line, and claude mcp list stays Connected.
  • Not run: a real codespace (this environment's GitHub token has no codespace scope), so the github.dev proxy itself (which Host it forwards), its sign-in redirect, whether /workspaces and the docker-in-docker volume survive a rebuild there, the owner of /workspaces, and the 4-core machine's timing are untested here.
  • make format-check lint, test_doc_links.py, test_public_copy.py, test_agent_instructions.py, test_docs_reference.py pass.

AI assistance in the code (leave one; writing this description with AI is fine):

  • AI-generated (an agent wrote most of the diff): Claude Code. Checked: the dev container end to end with the devcontainers CLI and the Host/Origin checks above.

  • I can explain every line of this diff and how it interacts with the rest of Loom.

Checklist

  • make format-check and make lint pass, and the unit tests listed above; no server code changed.
  • Generated files are regenerated in this PR, not by hand.
  • A new migration is additive and numbered after the latest on main; no merged migration is edited.
  • A behaviour change to any file a plugin ships bumps both plugin manifests' version.
  • The frontend builds, if frontend/ changed.
  • Docs under docs/ describe the system as it now is, and this description names any operator steps and wire changes.
  • Repository text has no dates, people, host names, internal namespaces, ticket or decision numbers.
  • Commits are signed off (git commit -s), as CONTRIBUTING.md asks.

🤖 Generated with Claude Code

zlareb1 and others added 10 commits November 12, 2026 20:59
…latest release and connects Claude Code

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
…ocal port 7777, and its docs say who can reach it

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
…start policy on resume, and its docs claim only what a rebuild keeps

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
…ard once Loom answers, and drops a key the dev container spec does not define

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
…answers, and to run claude outside the checkout

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
… loopback pages the try-out trusts

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
…address is its own page

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
…uild moves to the latest release

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
…the docs say how to rerun a failed setup

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
… log line to open, and the Chinese README offers it too

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
@zlareb1
zlareb1 force-pushed the feat/codespaces-try-out branch from d0e0aff to 1c20b14 Compare November 12, 2026 21:18
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
@zlareb1
zlareb1 merged commit 34c48cd into main Nov 12, 2026
72 of 73 checks passed
@zlareb1
zlareb1 deleted the feat/codespaces-try-out branch November 12, 2026 22:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant