A plugin for the Kate text editor that integrates Claude Code (an AI coding assistant) directly into the editor's interface. It provides an interactive chat panel where you can converse with Claude to get help with coding tasksβall without leaving your KDE development environment.
- Real-time Streaming: Messages stream in as Claude generates them with markdown formatting via marked.js
- Syntax Highlighting: Language-aware code highlighting via highlight.js supporting 50+ languages
- Theme Integration: Automatically adapts to your Kate/KDE color scheme (dark/light)
- Copy Buttons: One-click clipboard copy on all code blocks
See what Claude is doing with inline tool call displays:
- Bash: Command preview in header, full command and output in expandable details
- Edit: Unified diffs with syntax-highlighted code showing exactly what changed
- Write: Syntax-highlighted file content with copy button
- Task/TaskOutput: Sub-agent status with badges for agent type, background execution, and resume state
- Read/Glob/Grep: File operation summaries
- Collapsible task list showing multi-step operation progress
- Real-time status: pending (β), in-progress (β³), completed (β)
- Progress counter: "Tasks (3/5)" format
- State persists across sessions via localStorage
- Inline permission dialogs for tool approvals
- Options: Always Allow, Allow Once, Reject
- Clear display of tool inputs and available actions
- Automatic color scheme extraction from
~/.config/kdeglobals - Kate theme colors applied to highlight.js syntax highlighting
- Seamless side panel integration
- Context-aware: passes current file, selection, and project root to Claude
- Image paste support: paste images from clipboard directly into chat messages
- ACP Protocol: JSON-RPC 2.0 over stdin/stdout with
claude-code-acpsubprocess - Qt WebChannel: Bidirectional C++/JavaScript bridge for real-time UI updates
- Web UI: HTML/CSS/JS rendered in Qt WebEngineView for rich formatting
- KDE Plasma / Kate text editor
- Qt 6 (Core, Widgets, WebEngineWidgets, WebChannel)
- KDE Frameworks 6 (KF6):
- KTextEditor
- KI18n
- KCoreAddons
- KXmlGui
- CMake 3.16 or higher
- C++17 compatible compiler
claude-code-acpbinary installed and available in PATH- Install from: https://github.com/zed-industries/claude-code-acp
Follow the instructions at https://github.com/zed-industries/claude-code-acp to install the ACP binary.
Verify installation:
which claude-code-acp# Build and install from PKGBUILD
makepkg -si# Build RPM using Docker
./build-packages.sh rpm
# Install the resulting package
sudo dnf install dist/kate-code-1.0.0-1.*.rpm# Build deb using Docker
./build-packages.sh deb
# Install the resulting package
sudo dpkg -i dist/kate-code_1.0.0-1_amd64.deb
sudo apt-get install -f # Install any missing dependenciesArch Linux / Manjaro:
sudo pacman -S cmake extra-cmake-modules qt6-webengine \
kf6-ktexteditor kf6-ki18n kf6-kcoreaddons kf6-kxmlgui kf6-syntax-highlightingDebian / Ubuntu:
sudo apt install cmake extra-cmake-modules qt6-webengine-dev \
libkf6texteditor-dev libkf6i18n-dev libkf6coreaddons-dev \
libkf6xmlgui-dev libkf6syntaxhighlighting-devFedora:
sudo dnf install cmake extra-cmake-modules gcc-c++ qt6-qtwebengine-devel \
kf6-ktexteditor-devel kf6-ki18n-devel kf6-kcoreaddons-devel \
kf6-kxmlgui-devel kf6-syntax-highlighting-devel# Configure
cmake -B build -DCMAKE_BUILD_TYPE=Release
# Build
cmake --build build
# Install to system (requires sudo)
sudo cmake --install build
# Or install to user directory
cmake --install build --prefix ~/.localThe plugin will be installed to:
- Library:
/usr/lib/qt6/plugins/kf6/ktexteditor/katecode.so - Metadata:
/usr/lib/qt6/plugins/kf6/ktexteditor/katecode.json - UI Resource:
/usr/share/kate/plugins/katecode/katecodeui.rc
- Restart Kate completely (close all windows)
- Open Kate
- Go to Settings β Configure Kate β Plugins
- Find and enable Kate Code
- Click OK
- The Kate Code panel appears in Kate's side panel area (left or right sidebar)
- Click the Connect button to start a claude-code-acp session
- The plugin will initialize using your current project's directory as the working directory
- Type your message in the input field at the bottom
- Press Enter to send (Shift+Enter for newline)
- Claude's response will stream in real-time with markdown formatting
Use the dropdown next to the input field to select Claude's operating mode:
- Default: Standard interactive mode with tool permission prompts
- Plan Mode: Claude will create a plan before executing tasks
- Additional modes may be available depending on your claude-code configuration
When Claude shows code in responses:
- Syntax highlighting is applied automatically based on the language
- Click the π copy button in the top-right corner of any code block to copy to clipboard
- Highlighting theme automatically matches your KDE color scheme (light/dark)
The plugin automatically provides context to Claude:
- Current File: If you have a file open, Claude knows which file you're working on
- Selection: If you have text selected, it's passed to Claude as context
- Project Root: Automatically detected from:
- Kate's project plugin (if available)
- VCS markers (
.git,.hg,.svn) - Build files (
CMakeLists.txt,package.json,Cargo.toml, etc.) - IDE markers (
.idea,.vscode,.kate-project)
When Claude uses tools, they appear inline in the conversation:
- Collapsed view: Shows tool name and key info (command for Bash, filename for file ops)
- Expanded view: Click to see full command/input and complete output
- Status indicators: Visual feedback for pending, running, completed, or failed operations
- Appears at the bottom of the chat when Claude is working on multi-step tasks
- Click the header to collapse/expand (state persists across sessions)
- Shows progress counter: "Tasks (3/5)" means 3 completed out of 5 total
- Icons:
- β Pending task
- β³ Currently working (animated)
- β Completed task
When Claude needs approval to run certain tools:
- A permission dialog appears inline in the chat
- Shows the tool name, input details, and available options
- Options typically include: "Always Allow", "Allow", "Reject"
- Click an option to respond
Kate Code includes experimental support for session summarization and context re-seeding:
- Automatic Summarization: When a session ends, the conversation is summarized and stored locally
- Context Resume: Starting a new session can optionally re-seed context from the previous summary
- Continuity: Helps maintain context across editor restarts or when switching between tasks
Setup: This feature requires an Anthropic API key, which can be configured in the plugin settings (Settings β Configure Kate β Kate Code). The API key is securely stored in KWallet.
This feature is experimental and behavior may change in future releases.
The plugin automatically adapts to your KDE color scheme by reading ~/.config/kdeglobals. If you change your KDE theme, restart Kate to pick up the new colors.
- Verify the plugin is installed:
ls /usr/lib/qt6/plugins/kf6/ktexteditor/katecode.so - Check Kate's plugin list: Settings β Configure Kate β Plugins
- Restart Kate completely (close all windows)
- Verify
claude-code-acpis in PATH:which claude-code-acp - Look for error messages in terminal when launching Kate from command line:
kate
- Open browser dev tools: The WebView uses Chromium, accessible on
localhost:9222 - Check terminal output for JavaScript errors
- Ensure all KF6 dependencies are installed
- Check CMake output for missing packages
- Verify Qt 6 and KDE Frameworks 6 versions are compatible
kate-code/
βββ CMakeLists.txt # Root build configuration
βββ src/
β βββ CMakeLists.txt # Source build configuration
β βββ katecode.json # Plugin metadata
β βββ katecode.qrc # Qt resources (web assets)
β βββ plugin/ # Kate plugin integration
β β βββ KateCodePlugin.* # Plugin factory
β β βββ KateCodeView.* # Per-window view, context providers
β βββ acp/ # ACP protocol implementation
β β βββ ACPModels.h # Data structures
β β βββ ACPService.* # QProcess subprocess management
β β βββ ACPSession.* # Protocol flow, message parsing
β βββ ui/ # User interface components
β β βββ ChatWidget.* # Main container
β β βββ ChatWebView.* # WebEngine view + JS bridge
β β βββ ChatInputWidget.* # Multiline text input
β β βββ PermissionDialog.* # Permission approval UI
β βββ util/ # Utilities
β β βββ KDEColorScheme.* # KDE color extraction
β βββ web/ # Web UI assets
β βββ chat.html # Chat page
β βββ chat.css # Styles
β βββ chat.js # Message rendering, interactivity
# Build without installing
cmake -B build
cmake --build build
# Install to user location (if supported)
cmake --install build --prefix ~/.local
# Rebuild after changes
cmake --build build
sudo cmake --install buildThe plugin outputs debug information to stdout/stderr. Run Kate from terminal to see logs:
kate 2>&1 | grep -E "\[ACP|ChatWebView|ChatWidget\]"MIT License
Contributions welcome! Please:
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request
- Built with Qt 6 and KDE Frameworks 6
- Integrates with claude-code-acp by Zed Industries
- Markdown rendering by marked.js
