How do I use Claude Code inside ST, like the way it is integrated in VS Code ?
Claude Code in ST
Claude code may not be directly done, unless Claude AI have added API keys for their subscription plans. However a member of the Sublime Text community have developed Claudette for Sublime Text as an addon. This integrates into the Anthropic Claude AI Developer console, where you can get API keys.
Though it’s likely got some of the features of Claude Code. The features in Claude Code related to Git and GitHub, aren’t available in Claudette.
Indeed, Claudette works well, but it does not interface with Claude Code, so you do not have access to all its functionalities, and finally you need an API key from Anthropic, whereas with Claude Code, you can use either an API key, or your web-based plan to get an access token.
I find the integration of Claude Code in VS Code perfect, but I do not like VS Code itself.
A lot of Claude Code’s functionality is covered under Claudette. The Claudette addon is open source, so if there’s something missing which is covered under Claude Code. Bearing in mind that the Git Client part is covered by Sublime Merge and code editing covered by Sublime Text.
Just open an issue on the addon’s code repository, or better yet contribute code which adds it. The addon is written in Python like all Sublime Text addons.
You can get an API for free. Plus the method used with the API key and developer console gives you control over the amount of money (credit) on account. So you can make sure you don’t over spend.
If you really want to use claude code features in ST, the only real option is Claudette with some custom changes. Because it’s based on Python, you can add missing features or even write scripts that work with Sublime Merge for Git things. It’s not as smooth as VS Code, but it lets you control things without having to switch editors.
Good point about the Python backend. Since Claudette is open source, it shouldn’t be impossible to implement the session/token auth that Claude Code uses, but it’s definitely a bit of a project. If anyone has the Python skills to bridge the Claude CLI output directly into the ST ghost-text API, that would be the dream. Until then, Terminus is a solid stop-gap.
I am returning to forum after proposing some inter-tool collaboration … dismissed in Dec 2024 … I will not bore but ideas were suspected by some moderators/flaggers (wrongly) as an AI created fantasy. But in part time and solo oldie I have evolved a close interaction between Subl Text at the core of several satellite tools and Claude and indeed Manus. Now I don’t have time for Package administration or other since I am busy but willing to offer tips in collaboration. It is a new paradigm. Building a new Rule based layer of AI protocol based on solid foundations. I should clarify that I am Ubuntu based but founding principles apply to other OS. I have dual boot Dell setup but focus on Ubuntu. I just have not tested outside Ubuntu so not a Package (yet). Early days. VSCode is not used but can be optionally. I can post an invitation card on my zerotrust vault, for discourse. One to one due to time limitations.
In short … I use Albert (Ubuntu only) to generate a snip in Sublime Text then transform into publishable assets … any scope. So Claude is tightly integrated with Subl text. i have both browser and API versions of Claude tightly connected to Subl Text.
…
Returned later to view. No interested Claude Users it seems. I’ll haul this down later. It genuinely works nicely.
I got this working today, with help from Claude of course. The hardest part was tracking down the OAuth URL that it uses when you auth from the terminal and what needed to be included in the header (beyond the access / refresh token). Claude was able to find this by digging through the CC Linux binary (using Fedora).
The standard API URL doesn’t support OAuth and my guess is they don’t want people having too much flexibility without paying for the higher tier or straight API options. I would’ve been fine going API by itself but couldn’t believe how quickly it gets way more expensive than if you really maximize the hourly and weekly Pro limits.
My change allows ST to share the same cred file that CC CLI and the VSCode extension use. So a user just needs to login with their Pro or Max account via the CLI, then configure their Claudette settings to use OAuth and they’re good to go. I tried to maintain the original API code and added a GUI menu option to switch between them.
I just got it working earlier today so I’m not sure if everything else remained functional. I’ll be digging around for any bugs and create an API key to test that I didn’t break the original functionality. Once I ensure everything remained functional, I plan on submitting a merge request to the original authors repo to see if they’re interested in the functionality.