SublimeClaude is a Sublime Text extension that allows users to interact with the Claude/Anthropic API for AI-powered code suggestions and conversations directly within the editor, similar to VS Code Copilot.
- Chat with Claude: Engage in a conversation with Claude using a dedicated chat interface.
- Select Folder: Send the contents of all text files within a selected folder to Claude.
- Select Files: Choose multiple files to send their contents to Claude.
- Select Ext: Use the right-click context menu to add text or code to the chat with Claude.
- Install Package Control if you haven't already (https://packagecontrol.io/installation)
- Open the Command Palette (Ctrl+Shift+P on Windows/Linux, Cmd+Shift+P on macOS)
- Type "Package Control: Install Package" and press Enter
- Search for "SublimeClaude" and press Enter to install
This package uses Package Control's dependency system. To ensure all dependencies are installed:
- Open Sublime Text
- Open the Command Palette (Ctrl+Shift+P on Windows/Linux, Cmd+Shift+P on macOS)
- Type "Package Control: Satisfy Dependencies" and press Enter
- Wait for the installation to complete
This will install all necessary dependencies for the Claude Sublime extension to function properly.
- Set up your Anthropic API key in the settings (see Configuration section)
- To start chatting with Claude:
- Open the Command Palette and type "SublimeClaude: Open Chat"
- Use the dedicated chat view to interact with Claude
- To send files or folder contents:
- Right-click in the editor or sidebar
- Choose "SublimeClaude: Select Folder" or "SublimeClaude: Select Files"
- To add selected text to the chat:
- Select text in the editor
- Right-click and choose "SublimeClaude: Add to Chat"
- Go to Preferences > Package Settings > SublimeClaude > Settings
- In the right pane (User settings), add your Anthropic API key and customize the system prompt:
{
"anthropic_api_key": "YOUR_API_KEY_HERE",
"system_prompt": "Your custom system prompt here."
}
To make this package available via Package Control:
- Fork the package_control_channel repository
- Add your package details to the
repository/s.json
file:{ "name": "SublimeClaude", "details": "https://github.com/yourusername/SublimeClaude", "releases": [ { "sublime_text": ">=3000", "tags": true } ] }
- Create a pull request to the package_control_channel repository
- Once merged, your package will be available through Package Control
For more details, visit: https://packagecontrol.io/docs/submitting_a_package
Project structure:
api_interaction.py
: Handles communication with the Claude/Anthropic APIchat_interface.py
: Manages the chat interface within Sublime Textcommands/
: Contains command classes for selecting files, folders, and textSublimeClaude.sublime-settings
: Default settings file
To contribute:
- Fork the repository
- Make your changes
- Submit a pull request with a clear description of your modifications
For the Anthropic API documentation, visit: https://docs.anthropic.com/claude/reference/getting-started-with-the-api
This project is licensed under the MIT License - see the LICENSE file for details.