Codabra
Codabra is a simple, clean AI coding assistant for Visual Studio Code that integrates with Anthropic's Claude model to provide intelligent coding assistance directly in your editor.
Features
- AI-Powered Coding Assistant: Leverage Claude's advanced capabilities to help with coding tasks, debugging, and best practices
- Clean Chat Interface: Interact with Claude through a simple, intuitive chat panel in the VSCode sidebar
- Multiline Input: Type complex, well-formatted queries with the multiline input that auto-resizes as you type
- Preserved Message Formatting: All spaces, line breaks, and indentation in your messages are preserved exactly as typed
- Consistent Response Formatting: AI responses maintain proper paragraph structure and markdown formatting for better readability
- Markdown Support: View responses with proper formatting, syntax highlighting, and code blocks
- Code Block Copy Button: Easily copy code from any code block with a single click
- VSCode-Styled Code Blocks: Code blocks match VSCode's native appearance for better readability
- Context-Aware: Automatically includes relevant editor context with your queries
- Extended Thinking Mode: Enable Claude's extended thinking capabilities for more complex problems
- Customizable System Prompt: Configure the AI's behavior to suit your specific needs
- Context Usage Tracking: Monitor your token usage with a visual progress bar
Installation
- Install the extension from the Visual Studio Code Marketplace
- Get an API key from Anthropic
- Configure the extension with your API key
Requirements
- Visual Studio Code version 1.63.0 or higher
- An Anthropic API key with access to Claude models
Usage
Starting a New Chat
- Click the "+" icon to start a new chat, or use the keyboard shortcut
Ctrl+Shift+Z
(Cmd+Shift+Z
on Mac)
- Type your question or request in the input field and press Enter
The message input area supports multiline text, making it easier to:
- Format complex queries with proper line breaks
- Include code snippets directly in your messages
- Structure your questions with better organization
To use this feature:
- Type normally in the input area
- Press Enter to send your message
- Press Shift+Enter to add a new line without sending
- The input area will automatically resize as you type more content
Your message formatting is preserved exactly as you type it:
- All spaces and indentation are maintained
- Line breaks appear exactly where you place them
- Code snippets retain their structure and alignment
- Pre-formatted text keeps its exact spacing
Using the Copy Code Feature
When viewing code blocks in Claude's responses:
- Hover over any code block to reveal the copy button in the top-right corner
- Click the button to copy the entire code block to your clipboard
- Visual feedback will indicate whether the copy was successful
- The copied code can then be pasted directly into your editor or any other application
This feature works with all types of code blocks:
- Code blocks in Claude's markdown responses
- Code blocks in streaming responses while Claude is generating content
Configuring Settings
- Click the gear icon in the sidebar to open settings
- Enter your Anthropic API key
- Toggle Extended Thinking mode on/off
- Customize the system prompt to change Claude's behavior
- Click "Save" to apply your changes
Configuration Options
API Key
Your Anthropic API key is required to use the extension. This key is stored securely in your VSCode settings.
Extended Thinking
When enabled, this option allows Claude to use its extended thinking capabilities, which can be helpful for more complex problems. This uses Claude 3.7 Sonnet's thinking feature.
System Prompt
The system prompt defines how Claude behaves when responding to your queries. You can customize this to make Claude more focused on specific programming languages, frameworks, or coding styles.
Context Usage Tracking
The context usage bar displays how much of Claude's context window is being used by your conversation. This helps you monitor your token usage and avoid hitting the context limit (200K tokens). The progress bar changes color based on usage:
- Green: Normal usage (below 70%)
- Yellow: Moderate usage (70-90%)
- Red: High usage (above 90%)
When you approach the context limit, consider starting a new chat to reset the context window.
Privacy & Security
- Your API key is stored locally in your VSCode settings
- Code context is only shared with Anthropic's API when you send a message
License
This project is licensed under the terms specified in the repository.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Architecture
Codabra follows a modular architecture with clear separation of concerns:
- ApiService: Manages communication with the Anthropic API
- ChatManager: Manages chat operations (creating, loading, sending messages)
- ChatPanel: Coordinates between specialized components and handles UI rendering
- ContextUsageTracker: Tracks and updates token usage
- SettingsManager: Handles settings operations and configuration
- WebviewManager: Handles webview initialization and communication
- Extension: Main entry point that registers commands and activates components
- Utils:
- ErrorHandler: Centralizes error handling and reporting
- EventManager: Manages custom events and subscriptions
- LockManager: Handles concurrency and prevents race conditions
- ResourceManager: Manages loading and disposal of resources
This architecture makes the codebase more maintainable and easier to extend with new features.
Support
If you encounter any issues or have questions, please open an issue on the GitHub repository.