agentleFS
hanzilihanzili/comet-mcp/CLAUDE.md

comet-mcp

CLAUDE.md180 starsChanged 11 months agoMITView on GitHub

Response extraction (comet-ai.ts:getAgentStatus): - Takes LAST prose element (not longest) - conversation threads show newest last - Filters out UI text (Library, Discover, etc.) and questions (ends with ?) Follow-up detection (index.ts): - Captures old prose count/text before sending - Waits for NEW response (different text or more elements) Prompt normalization: - Strips bullet points, collapses newlines to spaces Manual testing only (integration code, external DOM dependency).

The file

We split this CLAUDE.md into the rules it gives an agent

2 rules. About 0 are common, 2 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Prompt not submitted: If response shows 0 steps + COMPLETED, prompt may not have been submitted.

    line 49
  2. Distinctive:

    Stale poll response: If poll returns unrelated response, the previous prompt failed.

    line 50

≈ “Common” is an estimate: at least 1 in 5 of the 12,729 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
CLAUDE.md

CLAUDE.md

What This Is

MCP server connecting Claude Code to Perplexity's Comet browser via Chrome DevTools Protocol (CDP).

Architecture

Claude Code → MCP Server (index.ts) → CometAI (comet-ai.ts) → CDP Client (cdp-client.ts) → Comet Browser

6 Tools

  • comet_connect - Start/connect to Comet browser
  • comet_ask - Send prompt, wait for response (15s default, use poll for longer)
  • comet_poll - Check status of long-running tasks
  • comet_stop - Stop current task
  • comet_screenshot - Capture current page
  • comet_mode - Switch Perplexity modes (search/research/labs/learn)

Key Implementation Details

Response extraction (comet-ai.ts:getAgentStatus):

  • Takes LAST prose element (not longest) - conversation threads show newest last
  • Filters out UI text (Library, Discover, etc.) and questions (ends with ?)

Follow-up detection (index.ts):

  • Captures old prose count/text before sending
  • Waits for NEW response (different text or more elements)

Prompt normalization:

  • Strips bullet points, collapses newlines to spaces

Build & Test

npm run build
pgrep -f "node.*comet-mcp" | xargs kill  # Restart MCP

Manual testing only (integration code, external DOM dependency).

Test Cases

  1. Quick queries - Simple questions (math, facts) should return within 15s
  2. Non-blocking - Short timeout returns "in progress", use poll to get result
  3. Follow-up - Second question in same chat detects NEW response correctly
  4. Agentic task - "Take control of browser and go to X" triggers browsing
  5. newChat after agentic - newChat: true resets CDP state after browser control
  6. Mode switching - comet_mode changes search/research/labs/learn

Known Edge Cases

  • Prompt not submitted: If response shows 0 steps + COMPLETED, prompt may not have been submitted. Retry or use newChat.
  • Stale poll response: If poll returns unrelated response, the previous prompt failed. Send again.
  • Research mode: Takes longer than search mode, may need multiple polls.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.