ChatLogger
A VS Code extension that automatically records Cursor chat conversations with timestamps, while intelligently filtering out assistant code output for cleaner logs. Currently tested and optimized for Cursor IDE.
Features
- 🔄 Automatic Recording: Automatically saves chat conversations as they happen
- ⏰ Timestamp Tracking: Records precise timestamps for each message
- 🧹 Smart Filtering: Optionally ignores assistant code output for cleaner logs
- 📊 Conversation History: View and manage your chat history within VS Code
- 🔍 Real-time Monitoring: Continuously monitors for new conversations
- 🤫 Silent Operation: Runs completely in the background without user commands
- 📝 Git-based Tracking: Automatically generates
.chatlogger/latest_conversation_since_git.json
with all new messages since the last git commit
Installation
From VS Code Marketplace
- Open Cursor (recommended) or VS Code
- Go to Extensions (Ctrl+Shift+X)
- Search for "ChatLogger" or "xiangbin-li.chatlogger"
- Click "Install"
Note: This extension has been tested and optimized for Cursor IDE. While it may work in VS Code, it's specifically designed to capture Cursor's chat conversations.
From VSIX
- Download the latest
.vsix
file from the releases
- In VS Code/Cursor, go to Extensions (Ctrl+Shift+X)
- Click the "..." menu and select "Install from VSIX..."
- Choose the downloaded file
From Source
git clone https://github.com/dassio/chatlogger.git
cd chatlogger
npm install
npm run build
npm run package
Usage
Automatic Operation
Once installed, ChatLogger automatically:
- Monitors for new Cursor chat conversations
- Saves them to the
.chatlogger
directory in your workspace
- Updates the Chat History view in the Explorer panel
- Generates
.chatlogger/latest_conversation_since_git.json
with all new messages since the last git commit
Viewing Conversations
- Open the Explorer panel (Ctrl+Shift+E)
- Look for the "Chat History" section (when auto-save is enabled)
- Click on any conversation to view its details
Note: The extension operates completely automatically. All conversations are saved to the .chatlogger
directory in your workspace without any manual intervention required.
Configuration
Configure ChatLogger through VS Code settings (Ctrl+,):
Auto Save
chatlogger.autoSave.enabled
(default: true
)
- Automatically save chat conversations to the
.chatlogger
directory
Code Output Filtering
chatlogger.ignoreCodeOutput
(default: true
)
- Ignore assistant code output in recorded conversations for cleaner logs
chatlogger.outputFormat
(default: markdown
)
- Choose from:
markdown
, json
, txt
chatlogger.timestampFormat
(default: ISO
)
- Choose from:
ISO
, local
, relative
Check Interval
chatlogger.checkInterval
(default: 30000
)
- Interval in milliseconds to check for new conversations (5-300 seconds)
File Structure
Conversations are saved in the following structure:
./
├── .chatlogger/
│ ├── conversations/
│ │ ├── 2024-01-15T10-30-00-000Z_composer123.json
│ │ ├── 2024-01-15T14-45-00-000Z_composer456.json
│ │ └── ...
│ └── latest_conversation_since_git.json
Each conversation file contains:
- Message history with timestamps
- User and assistant roles
- Metadata (workspace path, file context, etc.)
- Filtered content (if code output filtering is enabled)
Git-based Tracking
ChatLogger automatically generates a latest_conversation_since_git.json
file that contains all new messages since your last git commit. This is useful for:
- Commit Messages: Generate commit messages based on recent chat activity
- Progress Tracking: See what was discussed since your last commit
- Documentation: Keep track of development discussions
[
{
"content": "How do I implement this feature?",
"role": "user",
"timestamp": "7/3/2025, 5:14:49 PM",
"conversationId": "conv_1751544117462_0hfj3h2y1"
},
{
"content": "Here's how you can implement it...",
"role": "assistant",
"timestamp": "7/3/2025, 5:15:12 PM",
"conversationId": "conv_1751544117462_0hfj3h2y1"
}
]
Manual Trigger
You can manually trigger the git-based calculation using the command palette:
- Press
Ctrl+Shift+P
- Type "Calculate Latest Conversation Since Git Commit"
- Select the ChatLogger command
JSON Structure
{
"id": "conversation-id",
"title": "Conversation Title",
"createdAt": "2024-01-15 10:30:00",
"updatedAt": "2024-01-15 14:45:00",
"messages": [
{
"id": "message-id",
"timestamp": "2024-01-15 10:30:00",
"role": "user",
"content": "How do I implement a binary search?",
"filteredContent": "How do I implement a binary search?",
"metadata": {
"hasCodeBlocks": false,
"messageLength": 35,
"isFiltered": false
}
}
],
"metadata": {
"workspacePath": "/path/to/workspace",
"totalMessages": 10,
"userMessages": 5,
"assistantMessages": 5
}
}
Troubleshooting
No Conversations Appearing
- Check if auto-save is enabled in settings
- Verify Cursor is running and has active conversations
- Check the ChatLogger output channel for error messages
- Ensure the extension is activated (should happen automatically on startup)
Missing Messages
- Ensure the check interval is appropriate for your usage
- Check if code output filtering is removing desired content
- Verify the conversation is still active in Cursor
- Increase the check interval to reduce CPU usage
- Clear old conversation history if storage becomes large
- Disable auto-save in settings if needed
Development
Building from Source
npm install
npm run build
npm run watch # For development with auto-rebuild
Testing
- Press F5 in VS Code to launch extension development host
- Test commands and functionality
- Check the output channel for debug information
Packaging
npm run package
Contributing
- Fork the repository on GitHub
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
Support
- Issues: Report bugs and request features on GitHub
- Discussions: Ask questions and share ideas
- Documentation: Check the code comments for implementation details
Changelog
v0.1.0
- Initial release
- Automatic conversation recording
- Multiple output formats
- Configurable settings
- Conversation history viewer
- Code output filtering
- Silent background operation (no manual commands)
Note: This extension is designed specifically for Cursor chat conversations and has been tested on Cursor IDE. While it may work in VS Code, it's optimized for Cursor's chat interface and database structure.