claude-ollama-live authoring skill
claude-ollama-live provides a shared CLI probe and reusable GitHub Actions workflow that qualifies Claude Code (@anthropic-ai/claude-code@2.1.316) against Ollama Cloud (glm-5.3-flash) and a loopback lmmock server.
Purpose
Use claude-ollama-live to verify that Claude Code's headless Anthropic Messages transport (--bare -p --output-format json) works end-to-end against both Ollama Cloud's direct https://ollama.com endpoint and a checksum-verified lmmock loopback server, complete with semantic negative controls.
When to use it
Choose claude-ollama-live when qualifying a Claude Code upgrade or an Ollama Cloud hosted model route (such as glm-5.3-flash), when testing reusable workflow secret boundaries between public and organization-scoped runners, or when running the offline oracle suite via npm test.
Install
Clone the repository and run npm test for the offline oracle, or let the workflow install @anthropic-ai/claude-code@2.1.316 into an isolated private prefix.
git clone https://github.com/lmctl-ai/claude-ollama-live.git
cd claude-ollama-live
npm test
Commands
Run the local oracle tests, execute the headless Claude Code probe in an isolated HOME, or trigger the reusable GitHub Actions workflow.
npm test
claude --bare -p --output-format json --tools "" --setting-sources "" --strict-mcp-config --mcp-config '{"mcpServers":{}}' --no-session-persistence "Reply with exactly OLLAMA_CLAUDE_OK_107. Do not call any tools."
ollama launch claude --model glm-5.3-flash:cloud --yes -- -p "Reply with exactly OLLAMA_CLAUDE_OK_107. Do not call any tools."
Inputs and outputs
The probe sends the exact prompt Reply with exactly OLLAMA_CLAUDE_OK_107. Do not call any tools. with stdin closed and all tools, MCP servers, session persistence, and setting sources disabled. The oracle parses the JSON stdout and requires process exit code 0, type == "result", subtype == "success", is_error == false, and exact result text OLLAMA_CLAUDE_OK_107. In the mock job, the audit additionally asserts that lmmock recorded a real POST /v1/messages request with HTTP status 200.
Safety rules
Never store OLLAMA_API_KEY or ANTHROPIC_AUTH_TOKEN in settings files or commit logs; supply it exclusively through the secret manager or GitHub Actions secret environment. Leave /v1 off ANTHROPIC_BASE_URL=https://ollama.com because Claude Code appends /v1/messages itself. Pin ANTHROPIC_MODEL and all four ANTHROPIC_DEFAULT_{OPUS,SONNET,HAIKU,FABLE}_MODEL variables to the same hosted model ID (glm-5.3-flash) so helper aliases cannot route to an unintended model, and set DISABLE_PROMPT_CACHING=1. Always isolate HOME and CLAUDE_CONFIG_DIR in temporary directories and never upload raw Claude logs or transcripts as CI artifacts. Never claim a skipped live job on a public repository push as live proof; live qualification requires the organization-scoped runner (lmctlhq/claude-ollama-live-runner) where both live and mock jobs execute.
Worked examples
Example 1: Isolated shell probe against Ollama Cloud with all model slots pinned and prompt caching disabled.
scratch="$(mktemp -d)"
export HOME="$scratch/home"
export CLAUDE_CONFIG_DIR="$scratch/claude"
mkdir -p "$HOME" "$CLAUDE_CONFIG_DIR"
export ANTHROPIC_BASE_URL="https://ollama.com"
export ANTHROPIC_API_KEY=""
export ANTHROPIC_AUTH_TOKEN="$OLLAMA_API_KEY"
export ANTHROPIC_MODEL="glm-5.3-flash"
export ANTHROPIC_DEFAULT_OPUS_MODEL="glm-5.3-flash"
export ANTHROPIC_DEFAULT_SONNET_MODEL="glm-5.3-flash"
export ANTHROPIC_DEFAULT_HAIKU_MODEL="glm-5.3-flash"
export ANTHROPIC_DEFAULT_FABLE_MODEL="glm-5.3-flash"
export DISABLE_PROMPT_CACHING=1
claude --bare -p --output-format json --tools "" --setting-sources "" --no-session-persistence \
"Reply with exactly OLLAMA_CLAUDE_OK_107. Do not call any tools." < /dev/null
Errors and exit codes
The oracle succeeds (exit code 0) only when both the positive probe and the negative control behave as specified: for live mode, the positive probe must return OLLAMA_CLAUDE_OK_107 with exit 0 while a synthetic invalid bearer token must be rejected with client exit code 1; for mock mode, the positive probe must return OLLAMA_CLAUDE_OK_107 with exit 0 and a verified POST /v1/messages 200 audit record, while a wrong-reply fixture must reach the oracle with client exit 0 and be rejected semantically by the exact-reply check.
How to verify
Run the offline oracle unit test suite with npm test to confirm the positive, wrong-reply, error-flag, and authentication-rejection classifications pass.
npm test