Skip to content

feat: add CodeBuddy support#1581

Open
studyzy wants to merge 3 commits into
oraios:mainfrom
studyzy:feat/codebuddy-support
Open

feat: add CodeBuddy support#1581
studyzy wants to merge 3 commits into
oraios:mainfrom
studyzy:feat/codebuddy-support

Conversation

@studyzy

@studyzy studyzy commented Jun 16, 2026

Copy link
Copy Markdown

Summary

This PR adds native support for CodeBuddy as a supported CLI client, alongside existing support for Claude Code and Codex.

CodeBuddy is a CLI coding agent that shares a similar architecture with Claude Code — it supports MCP server configuration, hooks (PostToolUse, Notification, SessionStart, Stop), and the same tool naming conventions (read, grep, edit, etc.).

Changes

New features

  • Client setup handler (ClientSetupHandlerCodeBuddy): Enables serena setup codebuddy to auto-configure the MCP server. Includes version detection and stderr suppression.
  • CodeBuddy context (contexts/codebuddy.yml): A single-project context that disables overlapping tools (read_file, search_for_pattern, execute_shell_command, etc.) and encourages the agent to prefer Serena's symbolic tools.
  • Hook support: Extends the existing hook system (serena-hooks) to recognize --client=codebuddy, applying the same remind, activate, cleanup, and auto-approve hooks as Claude Code.

Documentation

  • README.md — added CodeBuddy alongside Claude Code and Codex in client lists.
  • docs/02-usage/030_clients.md — new "CodeBuddy" section with setup instructions (both auto and manual), MCP configuration examples, hook configuration JSON, and hook descriptions.
  • docs/02-usage/020_running.md, docs/02-usage/040_workflow.md, docs/02-usage/050_configuration.md — updated references to include CodeBuddy in lists of single-project contexts and supported clients.
  • CHANGELOG.md — updated a reference to include CodeBuddy in a prior fix note.

Bug fixes

  • Suppress stderr noise in is_applicable() checks: execute_shell_command() calls in ClaudeCode and Codex handlers now use capture_stderr=True, preventing shell "command not found" errors from leaking to the terminal when a client binary is not installed.
  • Relaxed version check for CodeBuddy: CodeBuddy's --version outputs only a version number (e.g. "2.106.4") without a recognizable binary name, so the version check only validates the return code rather than parsing stdout content.

Files changed

CHANGELOG.md                                       |   2 +-
README.md                                          |   6 +-
docs/02-usage/020_running.md                       |   6 +-
docs/02-usage/030_clients.md                       |  93 +++++++++++++-
docs/02-usage/040_workflow.md                      |   4 +-
docs/02-usage/050_configuration.md                 |   3 +-
src/serena/config/client_setup.py                  |  27 ++++-
src/serena/hooks.py                                |   5 +-
src/serena/resources/config/contexts/codebuddy.yml |  52 ++++++++
10 files changed, 183 insertions(+), 21 deletions(-)

Testing

  • Verified serena setup codebuddy correctly detects and configures CodeBuddy.
  • Verified hooks (remind, activate, cleanup, auto-approve) function correctly with --client=codebuddy.
  • Verified the CodeBuddy context properly disables overlapping tools and enforces single-project mode.

studyzy added 3 commits June 15, 2026 16:14
…applicable()

`codebuddy --version` outputs only the version number (e.g. "2.106.4")
without the string "CodeBuddy", causing the `is_applicable()` check to
return False and setup to fail with "not found or not functional".
Checking only the exit code is sufficient to detect the binary.
`is_applicable()` calls `execute_shell_command()` without
`capture_stderr=True`, so when a client binary is not installed
(e.g. codex), the shell's 'command not found' error leaks directly
to the terminal. Pass capture_stderr=True in all three handlers.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant