opik icon indicating copy to clipboard operation
opik copied to clipboard

[FR] Log Claude Code message when using the Cursor extension

Open jverre opened this issue 3 months ago • 2 comments

Context

The Cursor extension logs in the background all Cursor chats to Opik so you can keep track of your LLM chats. Given the popularity of Claude Code, it would be create to log these chats to Opik as well

Implementation consideration

All Claude chats are stored locally in ~/.claude/projects, we can use a similar approach to how we implemented the Cursor chat logging.

jverre avatar Sep 25 '25 21:09 jverre

@jverre @vincentkoc , I would like to work on the issue. Can you please assign this to me.

DhanashreePetare avatar Oct 01 '25 06:10 DhanashreePetare

Hi @jverre @vincentkoc! I'm very interested in working on this Claude Code logging feature for Hacktoberfest.

Why I'm Perfect for This:

Extension Development Experience:

  • Built browser extensions and IDE plugins with background process monitoring
  • Experience with file system watchers and local data parsing
  • Familiar with extension architecture patterns for chat logging

Relevant Technical Skills:

  • Strong understanding of file system operations (Node.js fs module, file watchers)
  • Experience parsing JSON/structured data from local storage
  • Built similar chat monitoring/logging systems before
  • Proficiency with TypeScript/JavaScript for extension development

Implementation Approach:

1. Research & Analysis:

  • Study the existing Cursor extension implementation to match patterns
  • Analyze Claude Code's storage format in ~/.claude/projects
  • Identify message structure and metadata fields

2. Core Implementation:

  • Create file watcher for ~/.claude/projects directory
  • Parse Claude chat messages from local storage
  • Transform data to Opik's expected format
  • Implement background logging service
  • Handle incremental updates (only log new messages)

3. Edge Cases & Error Handling:

  • Handle missing ~/.claude directory gracefully
  • Deal with concurrent file access
  • Implement retry logic for failed logs
  • Validate message format before sending
  • Handle malformed JSON gracefully

4. User Experience:

  • Configuration options for enabling/disabling logging
  • Clear error messages and logging feedback
  • Respect user privacy settings
  • Minimal performance impact

5. Testing:

  • Unit tests for parsing logic
  • Integration tests with mock Claude data
  • Manual testing with real Claude Code usage
  • Performance testing for large chat histories

Timeline: I can deliver this in 5-6 days including comprehensive testing, documentation updates, and a demo video showing the feature in action.

Looking forward to contributing to Opik! @jverre @vincentkoc

smirk-dev avatar Oct 01 '25 20:10 smirk-dev