Skip to content

JetBrains IDE: PyCharm, WebStorm, and IntelliJ Setup

Core Concept LearningAugust 18, 202611 min read

JetBrains IDEs (PyCharm, WebStorm, IntelliJ IDEA, Rider, PhpStorm) have sophisticated code analysis built in—and Claude Code extends that analysis with conversational refactoring. Right-click any code, ask Claude to refactor, review the inline diff, and accept.

This guide covers plugin setup across JetBrains products, context menu workflows, Python-specific refactoring patterns, and debugging integration. If you work across both JetBrains and VS Code, see VS Code integration for the parallel setup; for the agentic workflows that run inside any IDE, see Claude Code workflows guide.

Plugin Installation and IDE Setup

The Claude Code plugin is available in the JetBrains plugin marketplace for all major IDEs. In PyCharm, WebStorm, or IntelliJ, open Settings/Preferences (⌘+, on macOS, Ctrl+Alt+S on Linux/Windows), navigate to Plugins, search 'Claude Code', and click Install.

After installation, restart the IDE and authenticate with your Anthropic account when prompted. The plugin integrates into the right-click context menu and adds a 'Claude Code' tool window for chat and session management.

Quick reference

  • Works on PyCharm (Community and Professional), WebStorm, IntelliJ IDEA, Rider, and PhpStorm
  • Install from Settings → Plugins → Marketplace, search 'Claude Code'
  • Restart IDE after installation to activate the plugin
  • Authenticate once—credentials persist across all JetBrains products on the same machine
  • Right-click any file or selection → 'Claude Code' to open the chat with context pre-loaded

Remember this

Installation is 3 steps (marketplace, install, authenticate); setup is immediate.

Right-Click Context Menu and Refactoring

The core JetBrains workflow is: select code, right-click, choose 'Ask Claude Code' or 'Refactor with Claude'. The selection is automatically included in the chat context.

For example, select a Python function with nested loops, right-click, ask 'Optimize this for readability,' and Claude Code suggests improvements. Review the inline diff (same Jetbrains diff preview you use for git), accept, and it's refactored instantly.

Quick reference

  • Right-click selection → 'Ask Claude Code' opens chat with code pre-loaded
  • Right-click selection → 'Refactor' shows refactoring suggestions (extracting methods, etc.)
  • Claude Code respects JetBrains' scope: selection, file, or package (choose in context menu)
  • Diffs use JetBrains' native diff viewer—same shortcuts as git diffs
  • Keyboard shortcut: Cmd+Shift+C (macOS) to open Claude Code for selection

Remember this

Right-click context menu makes AI refactoring as natural as built-in refactorings.

Python Workflows in PyCharm

PyCharm users often ask Claude Code to: refactor nested list comprehensions, suggest type hints for untyped functions, migrate from Django to FastAPI patterns, or optimize database queries. The PyCharm environment provides Claude Code with your project's Python version, installed packages (from requirements.txt or pyproject.toml), and local configurations.

Common pattern: select a function, ask 'Add type hints and docstrings', review the diff, and accept. Claude Code respects your project's Python version and uses the correct syntax.

Quick reference

  • PyCharm shares your Python version and environment with Claude Code—no manual config needed
  • Ask Claude Code to 'Add type hints' and it uses your project's Python version syntax
  • Refactor Django views to FastAPI endpoints by @-mentioning your current framework files
  • Ask 'Optimize this database query' and Claude Code considers your model definitions
  • Use Claude Code's suggestions + PyCharm's run/debug to test changes immediately

Remember this

PyCharm's environment context means Claude Code writes Python that matches your setup.

JavaScript and TypeScript in WebStorm

WebStorm users can use Claude Code to modernize JavaScript: convert var to const, refactor callbacks to async/await, extract custom hooks from React components, or migrate CommonJS to ES modules.

WebStorm's built-in linting rules integrate with Claude Code—if your project uses ESLint or Prettier, Claude Code's suggestions conform to those rules automatically.

Quick reference

  • WebStorm shares your .eslintrc and prettier config with Claude Code
  • Ask 'Convert this callback to async/await' and Claude respects your TypeScript strict mode
  • Refactor React class components to hooks: select the class, ask 'Convert to a hook-based component'
  • Extract custom hooks: select logic in a component, ask 'Extract this into a custom hook', approve the diff
  • Modern import syntax: Claude Code uses ES6 imports, not CommonJS, by default

Remember this

WebStorm's linter integration means Claude Code's suggestions always match your style rules.

Debugging Integration and Error Diagnosis

When tests fail or a breakpoint halts execution, copy the error message or stack trace into Claude Code and ask 'Why is this happening?' Claude Code reads the trace, asks clarifying questions about your setup, and proposes fixes.

Alternative: open the Debug Console in PyCharm/WebStorm, let Claude Code see the error output, and ask it to fix the code. Claude Code then applies suggested fixes as inline diffs.

Quick reference

  • Copy stack trace → Claude Code → 'Help me debug this' for immediate analysis
  • Debugging flow: run tests, see failure, ask Claude Code why, accept fix suggestions
  • Claude Code can read your test output and propose specific assertions or test setup fixes
  • Use breakpoints to inspect state, then ask Claude to interpret the values in context
  • Error chains: Claude Code traces the root cause even if the error is several calls deep

Remember this

Error diagnosis in Claude Code is faster than googling stack traces.

Multi-Language Projects (Python + JavaScript)

If your project mixes Python (backend) and JavaScript (frontend), use the same Claude Code session for both. Select a Python file, ask Claude Code to refactor it, accept. Then select a React component, ask it to update the API call to match the new Python endpoint.

Claude Code understands your full stack context—it won't suggest Python endpoint names that don't match your refactored backend.

Quick reference

  • Single Claude Code session understands both Python and JavaScript in your project
  • Ask Claude Code to refactor backend and frontend together: 'Update both the endpoint and the React call'
  • Use @-mentions to reference both backend and frontend files in the same request
  • Claude Code respects both Python and JavaScript conventions in the same project
  • Test the full stack: run your backend server and frontend dev server, let Claude Code see errors from both

Remember this

Full-stack changes in one session: refactor backend and frontend, verify together.

Real Scenario: Django Refactor in PyCharm

You have a monolithic Django view handling GET and POST. Goal: split it into separate viewsets using Django Rest Framework (DRF).

Step 1: Context. Open the view file, @-mention your DRF serializers and URL configuration to give Claude Code the full picture of your API structure.

Step 2: Refactor. Select the view, ask 'Convert this to a DRF ViewSet and update the URL patterns.' Claude Code creates the ViewSet, updates serializers, and modifies urls.py—applying each diff for your approval.

Step 3: Migrate. Ask 'Create a management command to migrate old API clients to the new endpoint,' and Claude Code writes a backward-compatible redirect or shim.

Step 4: Test. Run your Django test suite (python manage.py test) and show Claude the results. If a test fails, Claude Code reads the output and proposes fixes (missing migrations, updated URLs, etc.).

Quick reference

  • Monolithic view → DRF ViewSet refactor takes 15 minutes with Claude Code planning
  • Use PyCharm's Django support (manage.py commands, models inspection) alongside Claude Code
  • Claude Code respects your Django version (check via @-mention of settings.py or requirements.txt)
  • After refactor, use PyCharm's 'Find Usages' to catch old import paths, then ask Claude to update them
  • Test incrementally: refactor one view, run tests, then move to the next

Remember this

Django refactors that took a day now take an hour with Claude Code planning and guided execution.

Running Tests and Debugging with Claude Code

After Claude Code applies changes, you don't need to leave the IDE to verify. Click the green run icon (or Shift+F10 in PyCharm) to run your test suite. If tests fail, Claude Code reads the test output from the IDE's Run console and proposes fixes without you copying/pasting anything.

For Python, run pytest and let Claude Code interpret assertion errors. For JavaScript, run jest and let Claude Code fix test setup issues. The IDE's output is immediately available to Claude Code.

Quick reference

  • Run tests in PyCharm (Shift+F10) or WebStorm—Claude Code watches the output
  • Test failure → ask Claude Code 'Fix the failing test' and it reads the assertion error
  • Debugger: set a breakpoint, run with debugger, inspect variables, ask Claude to fix based on values
  • Coverage reports: run with coverage, ask 'Increase coverage for this untested function'
  • IDE integration means no manual copying of test output—Claude Code sees it live

Remember this

Edit → Test → Fix loop stays inside your IDE; Claude Code sees every test result.

Troubleshooting and Plugin Issues

Most JetBrains plugin issues are IDE-specific. If Claude Code doesn't appear in the right-click menu, try invalidating the IDE cache (File → Invalidate Caches). If auth fails, re-authenticate in the Claude Code tool window.

For context issues (Claude Code saying 'file not found'), ensure you're in the correct IDE project root—plugins work within the open project scope.

Quick reference

  • Plugin not appearing: File → Invalidate Caches → Restart IDE
  • Auth fails: Tool window → 'Sign In' → follow the browser prompt
  • Context missing: Use @-mentions to explicitly include files (plugin auto-includes active file)
  • Slow responses: Check IDE memory usage (Help → Show Memory Indicator); close unused tabs
  • Diff not showing: Close and reopen the diff panel in the tool window

Remember this

Most issues resolve with a cache invalidate and restart; persistent issues: re-authenticate.

Key takeaway

Claude Code in JetBrains IDEs closes the gap between your built-in refactoring tools and conversational AI. The right-click workflow is natural, the environment context is automatic, and test feedback is immediate.

Quick practice: Open PyCharm or WebStorm with a real project. Select a messy function (5–10 lines), right-click → 'Ask Claude Code', type 'Clean this up', and review the diff. Accept it. In 30 seconds, you've experienced the core value. Then try Plan mode for a multi-file refactor and feel how much faster you move.

After 2–3 refactors with Claude Code in your JetBrains IDE, you'll wonder how you ever coded without it.

Share:
PK

Polo Khan

Lead Author & Systems Architect

Software engineer and distributed systems architect specializing in backend scalability, cloud-native infrastructure, databases, and AI engineering workflows. Author and maintainer of Core Concept Learning.

Human-Engineered & Fact-CheckedOriginal Visual DiagramsEditorial Standards →Send Feedback

Related Articles

VS Code is where most developers spend their day—and Claude Code transforms it into an AI-powered IDE. The extension bri

Read

One of the most persistent frustrations in AI-assisted development is API Drift. You ask an AI coding assistant to write

Read

Most multi-agent software engineering frameworks suffer from the same fatal flaw: they treat coding as a simulated conve

Read

Explore this topic

Keep learning

Follow a structured path or browse all courses to go deeper.