jackwener/OpenCLI · error · EmptyResultError

No visible Claude messages were found in the current convers

Error message

No visible Claude messages were found in the current conversation.

What it means

This EmptyResultError is thrown by the `claude read` command when, after ensuring the browser is on the Claude app page with a visible composer and a logged-in session, getVisibleMessages extracts zero messages from the current conversation. The library refuses to return an empty transcript, treating it as a failed read.

Source

Thrown at clis/claude/read.js:25

    name: 'read',
    access: 'read',
    description: 'Read the current Claude conversation',
    domain: CLAUDE_DOMAIN,
    strategy: Strategy.COOKIE,
    browser: true,
    siteSession: 'persistent',
    navigateBefore: false,
    args: [],
    columns: ['Index', 'Role', 'Text'],

    func: async (page) => {
        // ensureOnClaude now waits for the composer selector; the previous post-nav
        // 3 s settle is covered by that event-based wait.
        await ensureOnClaude(page);
        await ensureClaudeLogin(page, 'Claude read requires a logged-in Claude session.');
        const messages = await getVisibleMessages(page);
        if (messages.length > 0) return messages;
        throw new EmptyResultError('claude read', 'No visible Claude messages were found in the current conversation.');
    },
});

View on GitHub (pinned to 49907e53dc)

Solutions

  1. Ensure the current conversation actually has messages — send one in the browser or navigate to an existing conversation, then retry
  2. Re-run the command after waiting for the page to fully render; slow painting is the most common cause
  3. Verify in the browser that the transcript is visible (not an error/login banner)
  4. Re-run `opencli claude auth` to rule out a silent login-redirect state
  5. Update the library if Claude changed its DOM — message selectors may need a newer version

Example fix

// before
// `claude read` on a blank New Chat -> EmptyResultError
// after
opencli claude send "hello"       # create content in the conversation
opencli claude read
Defensive patterns

Strategy: retry

Validate before calling

// only read conversations that have content
const history = await opencli.claude.history({ limit: 1 });
if (!history.length) throw new Error('No conversations exist to read — send a message first');

Type guard

function hasVisibleMessages(messages) {
  return Array.isArray(messages) && messages.length > 0;
}

Try / catch

try {
  const messages = await opencli.claude.read();
} catch (e) {
  if (e.message.includes('No visible Claude messages were found')) {
    await sleep(3000);                       // wait for transcript to render
    return opencli.claude.read();
  }
  throw e;
}

Prevention

When it happens

Trigger: getVisibleMessages(page) returns [] on the current claude.ai conversation page — the conversation is empty (new chat, nothing sent yet), a login/error redirect replaced the transcript, lazy rendering hasn't painted messages yet, or a Claude DOM change broke the message selectors.

Common situations: Running `claude read` on a freshly opened New Chat with no messages; temporary Claude error banner replacing the transcript; slow rendering on a long conversation; Claude frontend update changing message markup; scraper landing on the wrong tab of the app.

Related errors


AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29). Data as JSON: /api/errors/80b1b21d7308c8e3. Report an issue: GitHub.