Welcome to the definitive guide for setting up your Visual Studio Code (VS Code) environment for AI-assisted development. This documentation will walk you through transforming a standard VS Code installation into a powerhouse workflow using Claude, Git, and GitHub.
- Phase 1: Installing Essential Extensions
- Phase 2: Connecting to an Existing Repository
- Phase 3: Empowering Claude with GitHub Skills
- Phase 4: The Pull Request Workflow
To get started, we need to equip VS Code with the right tools. We will install the Claude Code extension for AI assistance and the official GitHub/Git extensions for version control.
The Claude Code extension brings Anthropic's Claude directly into your IDE, allowing you to generate code, explain complex logic, and refactor seamlessly.
- Open VS Code.
- Navigate to the Extensions view by clicking the Extensions icon in the Activity Bar on the left side of the window (or press
Ctrl+Shift+X/Cmd+Shift+X). - In the search bar, type
Claude Code. or open on the web - Locate the official extension provided by Anthropic and click Install.
- Once installed, you will see a new Claude icon in your Activity Bar. Click it and follow the prompt to Sign In and authenticate your account.
While VS Code has built-in Git support, installing dedicated extensions provides a much richer integration for Pull Requests and repository management.
- Remain in the Extensions view (
Ctrl+Shift+X/Cmd+Shift+X). - Search for GitHub Pull Requests and Issues (Official extension by GitHub). Web link
- Click Install.
- (Optional but Recommended) Search for GitLens β Git supercharged and install it for advanced line-blame annotations and repository history visualization.
- Once installed, click the Accounts icon (bottom left gear/profile icon) to sign in to your GitHub account and authorize VS Code.
With our tools installed, the next step is to bring your codebase into VS Code.
- Open the Command Palette (
Ctrl+Shift+P/Cmd+Shift+P). - Type
Git: Cloneand select it from the dropdown. - You will be prompted to Clone from GitHub. Click it.
- If authenticated, a list of your repositories will appear. Select the repository you wish to work on, or paste the repository URL directly.
- Select a local folder on your machine where the repository will be downloaded.
- Once cloned, a toast notification will appear in the bottom right. Click Open to load the repository into your workspace.
- Open the terminal in VS Code (
Ctrl+\`` /Cmd+``). - Navigate to your desired workspace directory using
cd. - Run the clone command:
git clone https://github.com/YOUR-USERNAME/YOUR-REPOSITORY.git
- Open the folder in VS Code:
code YOUR-REPOSITORY
To make Claude truly effective, we need to give it context about your version control system. Adding the "GitHub skill" allows Claude to read repository structures, reference existing PRs, and help draft commit messages.
- Open the Claude Code panel from the Activity Bar.
- Navigate to the Settings or Skills/Integrations tab within the extension UI.
- Locate the GitHub Integration or GitHub Skill option.
- Click Connect or Enable.
- You will be redirected to your browser to authorize Claude to access your GitHub repositories.
Note: Ensure you grant access to the specific repositories you intend to work on, or select "All Repositories" if preferred.
- Once authorized, return to VS Code. You can now use prompts like:
- "Summarize the recent commits on the main branch."
- "Draft a pull request description for my current branch."
Now that your environment is fully integrated, here is the standard workflow for using Claude to help you write code and submit a Pull Request.
Always work on a separate branch, never directly on main.
- Click on the branch indicator in the bottom-left corner of the Status Bar (it usually says
mainormaster). - Select + Create new branch...
- Name your branch descriptively (e.g.,
feature/add-login-buttonorfix/header-alignment). - Press Enter. You are now checked out to your new branch.
- Open the files you need to modify.
- Highlight a section of code, right-click, and select Ask Claude (or use the chat panel).
- Request changes: "Claude, can you optimize this function to run in O(n) time?" or "Help me write unit tests for this component."
- Apply the generated code to your files and save (
Ctrl+S/Cmd+S).
- Open the Source Control view (
Ctrl+Shift+G/Cmd+Shift+G). - Hover over the changed files and click the + (Plus) icon to stage them.
- Pro Tip: Ask Claude to help write your commit message! In the Claude chat, ask: "Based on my staged changes, write a concise, conventional commit message."
- Paste the message into the Source Control input box and click Commit.
- In the Source Control view, click Publish Branch (if this is the first push) or Sync Changes.
- Once pushed, navigate to the GitHub icon in the Activity Bar (added by the GitHub extension).
- Expand the Pull Requests section.
- Hover over the section and click the + (Create Pull Request) icon.
- Select your target branch (usually
main). - Title and Description: Use Claude to generate a comprehensive PR description detailing the 'Why' and 'What' of your changes.
- Click Create to submit the PR directly from VS Code!
End of Documentation. Happy Coding! π