Answer: To run the test loop, use the test script with the hook in place and a runner started on the host: it creates a session with `claude -p "" --environment --output-format json`, waits for the reply in `$E2E_REPLY_DIR/.txt`, sends a follow-up with `claude -p "" --cloud --output-format json`, then waits for that reply the same way. Status: Confirmed Entry: tool/claude-code/troubleshooting/run-test-loop Revision: 1 Digest: sha256:f93162dc35059ce0 (changes whenever the content changes) Timeline: Created: 2026-11-13T03:05:44Z Last changed: 2026-11-13T03:05:44Z Last verified: 2026-11-20T12:25:10Z Next check: 2026-11-21T12:25:10Z Check interval: Daily Expected change: No fixed schedule Data: Field | Value | Source | As of create session command | claude -p "" --environment --output-format json | [1] | 2026-11-20 reply file path | $E2E_REPLY_DIR/.txt | [1] | 2026-11-20 follow-up command | claude -p "" --cloud --output-format json | [1] | 2026-11-20 minimum version | v2.1.224 | [1] | 2026-11-20 Sources: [1] Anthropic. "Test self-hosted environments end to end". https://code.claude.com/docs/en/self-hosted-environments-testing.md Role: primary. Accessed: 2026-11-20T12:25:10Z Quote: "Creates a session on the test environment with `claude -p "" --environment --output-format json`." (Supports: create session command) Quote: "Waits for the reply to appear in `$E2E_REPLY_DIR/.txt`" (Supports: reply file path) Quote: "Sends a follow-up with `claude -p "" --cloud --output-format json`" (Supports: follow-up command) Quote: "The `--environment` and `--ref` dispatch flags require Claude Code v2.1.224 or later" (Supports: minimum version) Published: 2026-11-20T03:48:50Z Snapshot SHA-256: b3c6e8a5d7872e279c8228218555bd8ec42232c995093c21a513796cc9a0d8d7 (captured 2026-11-20T12:25:07Z) Verification: Method: Automated extraction from [1] with deepseek-flash (JSON output, thinking disabled). Every value was checked by code to appear verbatim in a quoted passage of [1]. Cross-check: not-available at 2026-11-20T12:25:10Z. No independent second source is configured for this entry Last successful check: 2026-11-20T12:25:10Z Last attempt: 2026-11-20T12:25:10Z Notes and limitations: Extracted automatically from a single official source (section "Run the test loop"). Related: https://latestn.com/tool/claude-code/troubleshooting/sandbox-troubleshooting How do I fix Claude Code sandbox errors like host-not-allowed or commands failing to reach localhost? https://latestn.com/tool/claude-code/troubleshooting/scheduled-tasks-limitations What are the limitations of session-scoped scheduled tasks in Claude Code? https://latestn.com/tool/claude-code/troubleshooting/screen-reader-limitations What are the known limitations of using Claude Code with a screen reader? https://latestn.com/tool/claude-code/troubleshooting/respond-to-classifier-notice What should I do when Claude Code shows the auto mode classifier request charges notice? https://latestn.com/tool/claude-code/troubleshooting/retrigger-failed-review How do I retrigger a failed or timed-out Claude Code review? https://latestn.com/tool/claude-code/troubleshooting/run-diagnostic-checks How do I run diagnostic checks to troubleshoot Claude Code installation? https://latestn.com/tool/ All entries in AI tools Change log: Time | Event | Change | Source 2026-11-13T03:05:44Z | added | Entry created | — Changes for this entry as a feed: https://latestn.com/tool/claude-code/troubleshooting/run-test-loop/latest Challenge this entry: Open challenges: None How: If a value here is wrong or out of date, send what is wrong and a link to evidence. Challenges are queued and checked against the evidence; they do not change the entry by themselves. If the entry changes as a result, the change log says so. Form: https://latestn.com/dispute/tool/claude-code/troubleshooting/run-test-loop POST: https://latestn.com/dispute/tool/claude-code/troubleshooting/run-test-loop with claim, evidence_url, and optionally field and contact (form-encoded or JSON) GET: https://latestn.com/dispute/tool/claude-code/troubleshooting/run-test-loop?claim={what is wrong}&evidence_url={link} How to cite: LatestN. (2026). How do I run the test loop to verify a self-hosted runner image in Claude Code? Revision 1, last verified 2026-11-20T12:25:10Z. https://latestn.com/tool/claude-code/troubleshooting/run-test-loop (accessed 2026-11-21T09:53:29Z). @misc{LatestN_tool_claude_code_troubleshooting_run_test_loop_r1, title = {How do I run the test loop to verify a self-hosted runner image in Claude Code?}, author = {{LatestN}}, year = {2026}, howpublished = {\url{https://latestn.com/tool/claude-code/troubleshooting/run-test-loop}}, note = {Revision 1; digest sha256:f93162dc35059ce0; last verified 2026-11-20T12:25:10Z; accessed 2026-11-21T09:53:29Z} } Reuse: License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/) Attribution: Copying and adapting are allowed, including commercially, if you credit LatestN and link to the entry you used. Each entry ends with a ready-made citation. URL: https://latestn.com/tool/claude-code/troubleshooting/run-test-loop