Skip to content

Shared task board where people and AI coding agents work as teammates. Source-available, self-hostable.

Go

MUL-4383 fix(daemon): stop routing CodeBuddy skills/memory through Claude's .claude paths (#5224)

YikaJ54fd29ebddfd
diff --git a/apps/docs/content/docs/install-agent-runtime.ja.mdx b/apps/docs/content/docs/install-agent-runtime.ja.mdx
index 12241b632f..09ce6fb904 100644
--- a/apps/docs/content/docs/install-agent-runtime.ja.mdx
+++ b/apps/docs/content/docs/install-agent-runtime.ja.mdx
@@ -150,7 +150,7 @@ ACP プロトコルのエージェントです(Kimi とトランスポート
### CodeBuddy (Tencent)
-Claude Code 互換の CLI エージェントです。Multica は Claude Code と同じ stream-json プロトコルで駆動します: セッション再開は `--resume` で動作し、MCP 構成は `--mcp-config` で渡され、スキルは `.claude/skills/` に配置されます。モデルは動的に探索されます。
+Claude Code 互換の CLI エージェントです。Multica は Claude Code と同じ stream-json プロトコルで駆動します: セッション再開は `--resume` で動作し、MCP 構成は `--mcp-config` で渡されます。CodeBuddy は Claude のディレクトリを再利用せず独自の設定ディレクトリを使うため、スキルは `.codebuddy/skills/` に配置され、ランタイムのブリーフは `CODEBUDDY.md` に書き込まれます。モデルは動的に探索されます。
| | |
|---|---|
diff --git a/apps/docs/content/docs/install-agent-runtime.ko.mdx b/apps/docs/content/docs/install-agent-runtime.ko.mdx
index 9b07d3df35..28ac1d1c9e 100644
--- a/apps/docs/content/docs/install-agent-runtime.ko.mdx
+++ b/apps/docs/content/docs/install-agent-runtime.ko.mdx
@@ -150,7 +150,7 @@ ACP 프로토콜 에이전트입니다(Kimi와 전송 방식을 공유). 세션
### CodeBuddy (Tencent)
-Claude Code 호환 CLI 에이전트입니다. Multica는 Claude Code와 동일한 stream-json 프로토콜로 구동합니다: 세션 재개는 `--resume`로 동작하고, MCP 구성은 `--mcp-config`로 전달되며, 스킬은 `.claude/skills/`에 배치됩니다. 모델은 동적으로 탐색됩니다.
+Claude Code 호환 CLI 에이전트입니다. Multica는 Claude Code와 동일한 stream-json 프로토콜로 구동합니다: 세션 재개는 `--resume`로 동작하고, MCP 구성은 `--mcp-config`로 전달됩니다. CodeBuddy는 Claude의 디렉터리를 재사용하지 않고 자체 설정 디렉터리를 사용하므로, 스킬은 `.codebuddy/skills/`에 배치되고 런타임 브리핑은 `CODEBUDDY.md`에 기록됩니다. 모델은 동적으로 탐색됩니다.
| | |
|---|---|
diff --git a/apps/docs/content/docs/install-agent-runtime.mdx b/apps/docs/content/docs/install-agent-runtime.mdx
index 67bd885cf0..14c5bc2bc7 100644
--- a/apps/docs/content/docs/install-agent-runtime.mdx
+++ b/apps/docs/content/docs/install-agent-runtime.mdx
@@ -152,7 +152,7 @@ Minimalist. **Session resumption is unusual** — the resume id is the path to a
### CodeBuddy (Tencent)
-A Claude Code–compatible CLI agent. Multica drives it with the same stream-json protocol as Claude Code: session resumption works via `--resume`, MCP config is passed through `--mcp-config`, and skills land in `.claude/skills/`. Models are discovered dynamically.
+A Claude Code–compatible CLI agent. Multica drives it with the same stream-json protocol as Claude Code: session resumption works via `--resume`, MCP config is passed through `--mcp-config`. CodeBuddy ships its own native config directory rather than reusing Claude's, so skills land in `.codebuddy/skills/` and the runtime brief is written to `CODEBUDDY.md`. Models are discovered dynamically.
| | |
|---|---|
diff --git a/apps/docs/content/docs/install-agent-runtime.zh.mdx b/apps/docs/content/docs/install-agent-runtime.zh.mdx
index 9903d01b09..de9e56b6f2 100644
--- a/apps/docs/content/docs/install-agent-runtime.zh.mdx
+++ b/apps/docs/content/docs/install-agent-runtime.zh.mdx
@@ -150,7 +150,7 @@ ACP 协议 agent(和 Kimi 共享传输层)。会话续接可用,MCP 配置
### CodeBuddy(Tencent)
-一款兼容 Claude Code 的 CLI agent。Multica 用和 Claude Code 一样的 stream-json 协议驱动它:会话续接通过 `--resume` 可用,MCP 配置通过 `--mcp-config` 传入,skill 放在 `.claude/skills/`。模型为动态发现。
+一款兼容 Claude Code 的 CLI agent。Multica 用和 Claude Code 一样的 stream-json 协议驱动它:会话续接通过 `--resume` 可用,MCP 配置通过 `--mcp-config` 传入。CodeBuddy 使用自己原生的配置目录,而不是复用 Claude 的,所以 skill 放在 `.codebuddy/skills/`,运行时说明写入 `CODEBUDDY.md`。模型为动态发现。
| | |
|---|---|
diff --git a/apps/docs/content/docs/providers.ja.mdx b/apps/docs/content/docs/providers.ja.mdx
index 8147b27cb1..481b81452e 100644
--- a/apps/docs/content/docs/providers.ja.mdx
+++ b/apps/docs/content/docs/providers.ja.mdx
@@ -15,7 +15,7 @@ Multica は **16 個の AI コーディングツール**を標準でサポート
|---|---|---|---|---|---|
| **Antigravity** | Google | ✅ (`--conversation <id>`) | ❌ | `.agents/skills/` | 動的探索(`agy models`) |
| **Claude Code** | Anthropic | ✅ | ✅ | `.claude/skills/` | 静的 + flag |
-| **CodeBuddy** | Tencent | ✅ | ✅ | `.claude/skills/` | 動的探索 |
+| **CodeBuddy** | Tencent | ✅ | ✅ | `.codebuddy/skills/` | 動的探索 |
| **Codex** | OpenAI | ✅ | ✅ | `$CODEX_HOME/skills/` | 静的 |
| **Copilot** | GitHub | ✅ | ❌ | `.github/skills/` | 静的(アカウントの権限で決定) |
| **Cursor** | Anysphere | ✅ | ✅ | `.cursor/skills/` | 動的探索 |
@@ -42,7 +42,7 @@ Anthropic が提供します。**新規ユーザーにとって第一の選択
### CodeBuddy
-Tencent が提供します。Claude Code 互換の CLI エージェントです — Multica は Claude Code と同じ stream-json プロトコルで駆動するため、セッション再開が動作し(`--resume` 経由)、MCP 構成は `--mcp-config` で渡され、スキルは Claude Code の `.claude/skills/` レイアウトを使用します。モデルは動的に探索されます。
+Tencent が提供します。Claude Code 互換の CLI エージェントです — Multica は Claude Code と同じ stream-json プロトコルで駆動するため、セッション再開が動作し(`--resume` 経由)、MCP 構成は `--mcp-config` で渡されます。CodeBuddy は Claude のディレクトリを再利用せず独自の設定ディレクトリを使うため、スキルは `.codebuddy/skills/` に配置され、ランタイムのブリーフは `CODEBUDDY.md` に書き込まれます。モデルは動的に探索されます。
### Codex
@@ -125,7 +125,7 @@ xAI の Grok Build CLI(`grok`)です。Multica は `grok --no-auto-update ag
| ツール | パス | ネイティブ探索か |
|---|---|---|
| Claude Code | `.claude/skills/` | ✅ ネイティブ |
-| CodeBuddy | `.claude/skills/` | ✅ ネイティブ |
+| CodeBuddy | `.codebuddy/skills/` | ✅ ネイティブ |
| Codex | `$CODEX_HOME/skills/` | ✅ ネイティブ |
| Copilot | `.github/skills/` | ✅ ネイティブ |
| Cursor | `.cursor/skills/` | ✅ ネイティブ |
diff --git a/apps/docs/content/docs/providers.ko.mdx b/apps/docs/content/docs/providers.ko.mdx
index 24053f64ac..6e0be3f1a1 100644
--- a/apps/docs/content/docs/providers.ko.mdx
+++ b/apps/docs/content/docs/providers.ko.mdx
@@ -15,7 +15,7 @@ Multica는 **16개의 AI 코딩 도구**를 기본 지원합니다. 이들은
|---|---|---|---|---|---|
| **Antigravity** | Google | ✅ (`--conversation <id>`) | ❌ | `.agents/skills/` | 동적 탐색(`agy models`) |
| **Claude Code** | Anthropic | ✅ | ✅ | `.claude/skills/` | 정적 + flag |
-| **CodeBuddy** | Tencent | ✅ | ✅ | `.claude/skills/` | 동적 탐색 |
+| **CodeBuddy** | Tencent | ✅ | ✅ | `.codebuddy/skills/` | 동적 탐색 |
| **Codex** | OpenAI | ✅ | ✅ | `$CODEX_HOME/skills/` | 정적 |
| **Copilot** | GitHub | ✅ | ❌ | `.github/skills/` | 정적 (계정 권한으로 결정) |
| **Cursor** | Anysphere | ✅ | ✅ | `.cursor/skills/` | 동적 탐색 |
@@ -42,7 +42,7 @@ Anthropic에서 제공합니다. **신규 사용자에게 첫 번째 선택지**
### CodeBuddy
-Tencent에서 제공합니다. Claude Code 호환 CLI 에이전트입니다 — Multica는 Claude Code와 동일한 stream-json 프로토콜로 구동하므로 세션 재개가 동작하고(`--resume` 경유), MCP 구성은 `--mcp-config`로 전달되며, 스킬은 Claude Code의 `.claude/skills/` 레이아웃을 사용합니다. 모델은 동적으로 탐색됩니다.
+Tencent에서 제공합니다. Claude Code 호환 CLI 에이전트입니다 — Multica는 Claude Code와 동일한 stream-json 프로토콜로 구동하므로 세션 재개가 동작하고(`--resume` 경유), MCP 구성은 `--mcp-config`로 전달됩니다. CodeBuddy는 Claude의 디렉터리를 재사용하지 않고 자체 설정 디렉터리를 사용하므로, 스킬은 `.codebuddy/skills/`에 배치되고 런타임 브리핑은 `CODEBUDDY.md`에 기록됩니다. 모델은 동적으로 탐색됩니다.
### Codex
@@ -125,7 +125,7 @@ xAI의 Grok Build CLI(`grok`)입니다. Multica는 `grok --no-auto-update agent
| 도구 | 경로 | 기본 탐색 여부 |
|---|---|---|
| Claude Code | `.claude/skills/` | ✅ 기본 |
-| CodeBuddy | `.claude/skills/` | ✅ 기본 |
+| CodeBuddy | `.codebuddy/skills/` | ✅ 기본 |
| Codex | `$CODEX_HOME/skills/` | ✅ 기본 |
| Copilot | `.github/skills/` | ✅ 기본 |
| Cursor | `.cursor/skills/` | ✅ 기본 |
diff --git a/apps/docs/content/docs/providers.mdx b/apps/docs/content/docs/providers.mdx
index f0afee127d..1bca4e5dbb 100644
--- a/apps/docs/content/docs/providers.mdx
+++ b/apps/docs/content/docs/providers.mdx
@@ -15,7 +15,7 @@ For guidance on picking a tool when creating an agent, see [Creating and configu
|---|---|---|---|---|---|
| **Antigravity** | Google | ✅ (`--conversation <id>`) | ❌ | `.agents/skills/` | Dynamic discovery (`agy models`) |
| **Claude Code** | Anthropic | ✅ | ✅ | `.claude/skills/` | Static + flag |
-| **CodeBuddy** | Tencent | ✅ | ✅ | `.claude/skills/` | Dynamic discovery |
+| **CodeBuddy** | Tencent | ✅ | ✅ | `.codebuddy/skills/` | Dynamic discovery |
| **Codex** | OpenAI | ✅ | ✅ | `$CODEX_HOME/skills/` | Static |
| **Copilot** | GitHub | ✅ | ❌ | `.github/skills/` | Static (determined by account entitlement) |
| **Cursor** | Anysphere | ✅ | ✅ | `.cursor/skills/` | Dynamic discovery |
@@ -42,7 +42,7 @@ From Anthropic. **First choice for new users** — the most complete feature set
### CodeBuddy
-From Tencent. A Claude Code–compatible CLI agent — Multica drives it with the same stream-json protocol as Claude Code, so session resumption works (via `--resume`), MCP config is passed through `--mcp-config`, and skills use Claude Code's `.claude/skills/` layout. Models are discovered dynamically.
+From Tencent. A Claude Code–compatible CLI agent — Multica drives it with the same stream-json protocol as Claude Code, so session resumption works (via `--resume`) and MCP config is passed through `--mcp-config`. CodeBuddy ships its own native config directory rather than reusing Claude's, so skills land in `.codebuddy/skills/` and the runtime brief is written to `CODEBUDDY.md`. Models are discovered dynamically.
### Codex
@@ -134,7 +134,7 @@ Each tool uses **its own** skill discovery path. Before a task runs, the Multica
| Tool | Path | Native discovery? |
|---|---|---|
| Claude Code | `.claude/skills/` | ✅ Native |
-| CodeBuddy | `.claude/skills/` | ✅ Native |
+| CodeBuddy | `.codebuddy/skills/` | ✅ Native |
| Codex | `$CODEX_HOME/skills/` | ✅ Native |
| Copilot | `.github/skills/` | ✅ Native |
| Cursor | `.cursor/skills/` | ✅ Native |
diff --git a/apps/docs/content/docs/providers.zh.mdx b/apps/docs/content/docs/providers.zh.mdx
index a3d0d48e42..8f00f3c82f 100644
--- a/apps/docs/content/docs/providers.zh.mdx
+++ b/apps/docs/content/docs/providers.zh.mdx
@@ -15,7 +15,7 @@ Multica 内置支持 **16 款 AI 编程工具**。它们都实现了同一套接
|---|---|---|---|---|---|
| **Antigravity** | Google | ✅(`--conversation <id>`)| ❌ | `.agents/skills/` | 动态发现(`agy models`)|
| **Claude Code** | Anthropic | ✅ | ✅ | `.claude/skills/` | 静态 + flag |
-| **CodeBuddy** | Tencent | ✅ | ✅ | `.claude/skills/` | 动态发现 |
+| **CodeBuddy** | Tencent | ✅ | ✅ | `.codebuddy/skills/` | 动态发现 |
| **Codex** | OpenAI | ✅ | ✅ | `$CODEX_HOME/skills/` | 静态 |
| **Copilot** | GitHub | ✅ | ❌ | `.github/skills/` | 静态(账号权益决定)|
| **Cursor** | Anysphere | ✅ | ✅ | `.cursor/skills/` | 动态发现 |
@@ -42,7 +42,7 @@ Anthropic 出品。**新用户首选**——功能最完整:会话恢复真用
### CodeBuddy
-Tencent 出品。一款兼容 Claude Code 的 CLI agent——Multica 用和 Claude Code 一样的 stream-json 协议驱动它,所以会话恢复可用(通过 `--resume`),MCP 配置通过 `--mcp-config` 传入,skill 沿用 Claude Code 的 `.claude/skills/` 布局。模型为动态发现。
+Tencent 出品。一款兼容 Claude Code 的 CLI agent——Multica 用和 Claude Code 一样的 stream-json 协议驱动它,所以会话恢复可用(通过 `--resume`),MCP 配置通过 `--mcp-config` 传入。CodeBuddy 使用自己原生的配置目录,而不是复用 Claude 的,所以 skill 放在 `.codebuddy/skills/`,运行时说明写入 `CODEBUDDY.md`。模型为动态发现。
### Codex
@@ -125,7 +125,7 @@ xAI 的 Grok Build CLI(`grok`)。Multica 通过 `grok --no-auto-update agent
| 工具 | 路径 | 是否原生发现 |
|---|---|---|
| Claude Code | `.claude/skills/` | ✅ 原生 |
-| CodeBuddy | `.claude/skills/` | ✅ 原生 |
+| CodeBuddy | `.codebuddy/skills/` | ✅ 原生 |
| Codex | `$CODEX_HOME/skills/` | ✅ 原生 |
| Copilot | `.github/skills/` | ✅ 原生 |
| Cursor | `.cursor/skills/` | ✅ 原生 |
diff --git a/server/internal/daemon/execenv/context.go b/server/internal/daemon/execenv/context.go
index 57a4854eb3..208d2a203d 100644
--- a/server/internal/daemon/execenv/context.go
+++ b/server/internal/daemon/execenv/context.go
@@ -120,6 +120,7 @@ func writeWorkspacesRootMarkerAtomic(path string, data []byte) error {
// skills into the appropriate provider-native location.
//
// Claude: skills → {workDir}/.claude/skills/{name}/SKILL.md (native discovery)
+// CodeBuddy: skills → {workDir}/.codebuddy/skills/{name}/SKILL.md (native discovery — CodeBuddy is a Claude Code fork but uses its own config directory, not .claude/; see https://www.codebuddy.ai/docs/cli/skills)
// Codex: skills → handled separately in Prepare via codex-home
// Hermes: skills → handled separately in Prepare via hermes-home (HERMES_HOME/skills; Hermes has no workspace-relative discovery, see hermes_home.go)
// Copilot: skills → {workDir}/.github/skills/{name}/SKILL.md (native project-level discovery)
@@ -330,9 +331,14 @@ func resolveSkillsDir(workDir, provider string, manifest *sidecarManifest) (stri
// it can match the managed skill roots the prior manifest recorded.
func skillsDirPath(workDir, provider string) string {
switch provider {
- case "claude", "codebuddy":
+ case "claude":
// Claude Code natively discovers skills from .claude/skills/ in the workdir.
return filepath.Join(workDir, ".claude", "skills")
+ case "codebuddy":
+ // CodeBuddy Code is a Claude Code fork but uses its own native
+ // project-level skill directory .codebuddy/skills/, not
+ // .claude/skills/. See https://www.codebuddy.ai/docs/cli/skills.
+ return filepath.Join(workDir, ".codebuddy", "skills")
case "copilot":
// GitHub Copilot CLI natively discovers project-level skills from
// .github/skills/<name>/SKILL.md (takes precedence over user-level
diff --git a/server/internal/daemon/execenv/execenv_test.go b/server/internal/daemon/execenv/execenv_test.go
index 0176907945..12473acfb1 100644
--- a/server/internal/daemon/execenv/execenv_test.go
+++ b/server/internal/daemon/execenv/execenv_test.go
@@ -538,6 +538,70 @@ func TestWriteContextFilesClaudeNativeSkills(t *testing.T) {
}
}
+// TestWriteContextFilesCodebuddyNativeSkills is the regression guard for a
+// bug where CodeBuddy was treated as a drop-in alias for Claude and skills
+// were written to .claude/skills/. CodeBuddy Code is a Claude Code fork but
+// ships its own native config directory (~/.codebuddy, .codebuddy/) and does
+// NOT read .claude/skills/ by default — see
+// https://www.codebuddy.ai/docs/cli/skills ("Project-level Skills:
+// .codebuddy/skills/"). Skills must land under .codebuddy/skills/ instead.
+func TestWriteContextFilesCodebuddyNativeSkills(t *testing.T) {
+ t.Parallel()
+ dir := t.TempDir()
+
+ ctx := TaskContextForEnv{
+ IssueID: "codebuddy-skill-test",
+ AgentSkills: []SkillContextForEnv{
+ {
+ Name: "Go Conventions",
+ Content: "Follow Go conventions.",
+ Files: []SkillFileContextForEnv{
+ {Path: "templates/example.go", Content: "package main"},
+ },
+ },
+ },
+ }
+
+ if err := writeContextFiles(dir, "codebuddy", ctx, nil); err != nil {
+ t.Fatalf("writeContextFiles failed: %v", err)
+ }
+
+ // Skills should be in .codebuddy/skills/ (native discovery), NOT
+ // .claude/skills/ and NOT .agent_context/skills/.
+ skillMd, err := os.ReadFile(filepath.Join(dir, ".codebuddy", "skills", "go-conventions", "SKILL.md"))
+ if err != nil {
+ t.Fatalf("failed to read .codebuddy/skills/go-conventions/SKILL.md: %v", err)
+ }
+ if !strings.Contains(string(skillMd), "Follow Go conventions.") {
+ t.Error("SKILL.md missing content")
+ }
+
+ // Supporting files should also be under .codebuddy/skills/.
+ supportFile, err := os.ReadFile(filepath.Join(dir, ".codebuddy", "skills", "go-conventions", "templates", "example.go"))
+ if err != nil {
+ t.Fatalf("failed to read supporting file: %v", err)
+ }
+ if string(supportFile) != "package main" {
+ t.Errorf("supporting file content = %q, want %q", string(supportFile), "package main")
+ }
+
+ // .claude/skills/ must NOT exist — this is the exact regression this
+ // test guards against.
+ if _, err := os.Stat(filepath.Join(dir, ".claude", "skills")); !os.IsNotExist(err) {
+ t.Error("expected .claude/skills/ to NOT exist for codebuddy provider")
+ }
+
+ // .agent_context/skills/ should NOT exist for CodeBuddy either.
+ if _, err := os.Stat(filepath.Join(dir, ".agent_context", "skills")); !os.IsNotExist(err) {
+ t.Error("expected .agent_context/skills/ to NOT exist for codebuddy provider")
+ }
+
+ // issue_context.md should still be in .agent_context/.
+ if _, err := os.Stat(filepath.Join(dir, ".agent_context", "issue_context.md")); os.IsNotExist(err) {
+ t.Error("expected .agent_context/issue_context.md to exist")
+ }
+}
+
// TestReuseRefreshesSkillsWithoutDuplicating is the regression guard for
// GitHub #3684: re-dispatching the same agent on the same issue goes through
// the Reuse path, which must refresh skills in place rather than pile up
@@ -681,7 +745,7 @@ func TestReuseReclaimsManagedSkillDirWithStrayAgentFile(t *testing.T) {
func TestReuseSkillRefreshIsCanonicalAcrossProviders(t *testing.T) {
t.Parallel()
- for _, provider := range []string{"claude", "openclaw", "copilot", ""} {
+ for _, provider := range []string{"claude", "codebuddy", "openclaw", "copilot", ""} {
provider := provider
name := provider
if name == "" {
diff --git a/server/internal/daemon/execenv/runtime_config.go b/server/internal/daemon/execenv/runtime_config.go
index d20fc15596..5004cf5ff2 100644
--- a/server/internal/daemon/execenv/runtime_config.go
+++ b/server/internal/daemon/execenv/runtime_config.go
@@ -157,6 +157,7 @@ func formatProjectResource(r ProjectResourceForEnv) string {
// config file so the agent discovers its environment through its native mechanism.
//
// For Claude: writes {workDir}/CLAUDE.md (skills discovered natively from .claude/skills/)
+// For CodeBuddy: writes {workDir}/CODEBUDDY.md (CodeBuddy's native memory filename; skills discovered natively from .codebuddy/skills/)
// For Codex: writes {workDir}/AGENTS.md (skills discovered natively via CODEX_HOME)
// For Copilot: writes {workDir}/AGENTS.md (skills discovered natively from .github/skills/)
// For OpenCode: writes {workDir}/AGENTS.md (skills discovered natively from .opencode/skills/)
@@ -188,8 +189,15 @@ func InjectRuntimeConfig(workDir, provider string, ctx TaskContextForEnv) (strin
// added to one side cannot drift past the other.
func runtimeConfigPath(workDir, provider string) string {
switch provider {
- case "claude", "codebuddy":
+ case "claude":
return filepath.Join(workDir, "CLAUDE.md")
+ case "codebuddy":
+ // CodeBuddy Code's native memory file is CODEBUDDY.md, not
+ // CLAUDE.md — see https://www.codebuddy.ai/docs/cli/codebuddy-dir
+ // ("CODEBUDDY.md / .codebuddy/CODEBUDDY.md — Project-level memory
+ // file"). CodeBuddy only reads CLAUDE.md if the user manually
+ // migrates/symlinks it in.
+ return filepath.Join(workDir, "CODEBUDDY.md")
case "codex", "copilot", "opencode", "deveco", "openclaw", "hermes", "pi", "cursor", "kimi", "kiro", "antigravity", "qoder", "traecli", "grok":
return filepath.Join(workDir, "AGENTS.md")
default:
diff --git a/server/internal/daemon/execenv/runtime_config_sections.go b/server/internal/daemon/execenv/runtime_config_sections.go
index a07b58f576..2c7ee802ee 100644
--- a/server/internal/daemon/execenv/runtime_config_sections.go
+++ b/server/internal/daemon/execenv/runtime_config_sections.go
@@ -440,9 +440,7 @@ func writeSkills(b *strings.Builder, provider string, ctx TaskContextForEnv) {
}
b.WriteString("## Skills\n\n")
switch provider {
- case "claude", "codebuddy":
- b.WriteString("You have the following skills installed (discovered automatically):\n\n")
- case "codex", "copilot", "opencode", "deveco", "openclaw", "pi", "cursor", "kimi", "kiro", "qoder", "antigravity", "hermes":
+ case "claude", "codebuddy", "codex", "copilot", "opencode", "deveco", "openclaw", "hermes", "pi", "cursor", "kimi", "kiro", "qoder", "antigravity":
// Hermes discovers these from its per-task HERMES_HOME/skills (seeded by
// the daemon), so it needs the same "discovered automatically" framing
// as the other native-discovery runtimes rather than a path pointer.
diff --git a/server/internal/daemon/execenv/runtime_config_test.go b/server/internal/daemon/execenv/runtime_config_test.go
index 0c6d59cee2..4d66d47636 100644
--- a/server/internal/daemon/execenv/runtime_config_test.go
+++ b/server/internal/daemon/execenv/runtime_config_test.go
@@ -802,6 +802,7 @@ func TestInjectRuntimeConfigPreservesUserContent(t *testing.T) {
filename string
}{
{"claude", "CLAUDE.md"},
+ {"codebuddy", "CODEBUDDY.md"},
{"codex", "AGENTS.md"},
{"copilot", "AGENTS.md"},
{"opencode", "AGENTS.md"},
@@ -849,12 +850,36 @@ func TestInjectRuntimeConfigPreservesUserContent(t *testing.T) {
}
}
+// CodeBuddy is a Claude Code fork but ships its own native config
+// directory (~/.codebuddy, .codebuddy/) rather than reusing Claude's
+// ~/.claude / CLAUDE.md paths (see
+// https://www.codebuddy.ai/docs/cli/codebuddy-dir). This pins the two
+// providers to different target filenames so a future edit can't
+// silently re-merge them.
+func TestRuntimeConfigPathDistinguishesCodebuddyFromClaude(t *testing.T) {
+ t.Parallel()
+ dir := t.TempDir()
+
+ claudePath := runtimeConfigPath(dir, "claude")
+ codebuddyPath := runtimeConfigPath(dir, "codebuddy")
+
+ if claudePath != filepath.Join(dir, "CLAUDE.md") {
+ t.Errorf("claude runtime config path = %q, want CLAUDE.md", claudePath)
+ }
+ if codebuddyPath != filepath.Join(dir, "CODEBUDDY.md") {
+ t.Errorf("codebuddy runtime config path = %q, want CODEBUDDY.md", codebuddyPath)
+ }
+ if claudePath == codebuddyPath {
+ t.Fatal("claude and codebuddy must not share a runtime config path")
+ }
+}
+
func TestInjectRuntimeConfigUnknownProviderSkipsWrite(t *testing.T) {
t.Parallel()
dir := t.TempDir()
- // Seed all three candidate filenames so we can verify none of them get
+ // Seed all candidate filenames so we can verify none of them get
// written when the provider is unknown.
- for _, name := range []string{"CLAUDE.md", "AGENTS.md"} {
+ for _, name := range []string{"CLAUDE.md", "CODEBUDDY.md", "AGENTS.md"} {
if err := os.WriteFile(filepath.Join(dir, name), []byte("untouched\n"), 0o644); err != nil {
t.Fatalf("seed %s: %v", name, err)
}
@@ -865,7 +890,7 @@ func TestInjectRuntimeConfigUnknownProviderSkipsWrite(t *testing.T) {
}); err != nil {
t.Fatalf("InjectRuntimeConfig: %v", err)
}
- for _, name := range []string{"CLAUDE.md", "AGENTS.md"} {
+ for _, name := range []string{"CLAUDE.md", "CODEBUDDY.md", "AGENTS.md"} {
got, err := os.ReadFile(filepath.Join(dir, name))
if err != nil {
t.Fatalf("read %s: %v", name, err)
@@ -1087,7 +1112,7 @@ func TestCleanupRuntimeConfigNoOpCases(t *testing.T) {
t.Parallel()
dir := t.TempDir()
// Seed every candidate filename to verify none of them get touched.
- for _, name := range []string{"CLAUDE.md", "AGENTS.md"} {
+ for _, name := range []string{"CLAUDE.md", "CODEBUDDY.md", "AGENTS.md"} {
if err := os.WriteFile(filepath.Join(dir, name), []byte("untouched\n"), 0o644); err != nil {
t.Fatalf("seed %s: %v", name, err)
}
@@ -1095,7 +1120,7 @@ func TestCleanupRuntimeConfigNoOpCases(t *testing.T) {
if err := CleanupRuntimeConfig(dir, "totally-unknown-provider"); err != nil {
t.Errorf("unknown provider must be no-op, got: %v", err)
}
- for _, name := range []string{"CLAUDE.md", "AGENTS.md"} {
+ for _, name := range []string{"CLAUDE.md", "CODEBUDDY.md", "AGENTS.md"} {
got, err := os.ReadFile(filepath.Join(dir, name))
if err != nil {
t.Fatalf("read %s: %v", name, err)
@@ -1150,6 +1175,7 @@ func TestCleanupRuntimeConfigByProvider(t *testing.T) {
filename string
}{
{"claude", "CLAUDE.md"},
+ {"codebuddy", "CODEBUDDY.md"},
{"codex", "AGENTS.md"},
{"copilot", "AGENTS.md"},
{"opencode", "AGENTS.md"},
diff --git a/server/internal/daemon/execenv/sidecar_manifest_test.go b/server/internal/daemon/execenv/sidecar_manifest_test.go
index 04704201e8..3d43c09801 100644
--- a/server/internal/daemon/execenv/sidecar_manifest_test.go
+++ b/server/internal/daemon/execenv/sidecar_manifest_test.go
@@ -144,6 +144,7 @@ func runPrepareLikeCycle(t *testing.T, workDir, envRoot, provider string, ctx Ta
// one — review the test diff before merging.
var allFileBasedProviders = []string{
"claude",
+ "codebuddy",
"codex",
"copilot",
"opencode",
@@ -223,6 +224,7 @@ func TestPrepareThenCleanupSidecarsPreservesUserSkillSibling(t *testing.T) {
userSkillFile string // path under userSkillRel
}{
{"claude", filepath.Join(".claude", "skills", "my-own"), "SKILL.md"},
+ {"codebuddy", filepath.Join(".codebuddy", "skills", "my-own"), "SKILL.md"},
{"copilot", filepath.Join(".github", "skills", "my-own"), "SKILL.md"},
{"opencode", filepath.Join(".opencode", "skills", "my-own"), "SKILL.md"},
{"openclaw", filepath.Join("skills", "my-own"), "SKILL.md"},
@@ -287,6 +289,7 @@ func TestPrepareThenCleanupSidecarsPreservesUnrelatedUserFiles(t *testing.T) {
userFile string // path under workDir
}{
{"claude", filepath.Join(".claude", "settings.json")},
+ {"codebuddy", filepath.Join(".codebuddy", "settings.json")},
{"copilot", filepath.Join(".github", "CODEOWNERS")},
{"opencode", filepath.Join(".opencode", "config.json")},
{"pi", filepath.Join(".pi", "config.toml")},
@@ -613,6 +616,7 @@ var sameSlugSkillProviderCases = []struct {
skillDir string // relative path under workDir for the colliding slug
}{
{"claude", filepath.Join(".claude", "skills", "issue-review")},
+ {"codebuddy", filepath.Join(".codebuddy", "skills", "issue-review")},
{"copilot", filepath.Join(".github", "skills", "issue-review")},
{"opencode", filepath.Join(".opencode", "skills", "issue-review")},
{"openclaw", filepath.Join("skills", "issue-review")},
diff --git a/server/internal/daemon/local_skills.go b/server/internal/daemon/local_skills.go
index a3af5b94f0..577497e288 100644
--- a/server/internal/daemon/local_skills.go
+++ b/server/internal/daemon/local_skills.go
@@ -121,8 +121,18 @@ func localSkillRootsForProvider(provider string) ([]localSkillRoot, bool, error)
var providerRoot string
switch provider {
- case "claude", "codebuddy":
+ case "claude":
providerRoot = filepath.Join(home, ".claude", "skills")
+ case "codebuddy":
+ // CodeBuddy Code is a Claude Code fork but ships its own native
+ // config directory; it does NOT read ~/.claude/skills unless the
+ // user manually symlinks it in (the vendor's documented Claude
+ // Code migration path). See
+ // https://www.codebuddy.ai/docs/cli/codebuddy-dir ("Global
+ // directory ~/.codebuddy/") and
+ // https://www.codebuddy.ai/docs/cli/skills ("User-level Skills:
+ // ~/.codebuddy/skills/").
+ providerRoot = filepath.Join(home, ".codebuddy", "skills")
case "codex":
codexHome := strings.TrimSpace(os.Getenv("CODEX_HOME"))
if codexHome == "" {
@@ -173,7 +183,7 @@ func localSkillRootsForProvider(provider string) ([]localSkillRoot, bool, error)
{path: providerRoot, kind: localSkillRootProvider},
{path: filepath.Join(home, ".agents", "skills"), kind: localSkillRootUniversal},
}
- if provider == "claude" || provider == "codebuddy" {
+ if provider == "claude" {
for _, plugin := range listEnabledClaudePlugins(home) {
manifest, _ := readClaudePluginManifest(plugin.InstallPath)
for _, path := range claudePluginComponentPaths(
diff --git a/server/internal/daemon/local_skills_test.go b/server/internal/daemon/local_skills_test.go
index f5e0ed000e..f3b3084df0 100644
--- a/server/internal/daemon/local_skills_test.go
+++ b/server/internal/daemon/local_skills_test.go
@@ -97,6 +97,84 @@ func TestListRuntimeLocalSkills_Claude(t *testing.T) {
}
}
+// TestListRuntimeLocalSkills_Codebuddy is the regression guard for a bug
+// where CodeBuddy was treated as a drop-in alias for Claude and local
+// (user-level) skills were discovered from ~/.claude/skills. CodeBuddy Code
+// is a Claude Code fork but ships its own native config directory and does
+// NOT read ~/.claude/skills by default — see
+// https://www.codebuddy.ai/docs/cli/skills ("User-level Skills:
+// ~/.codebuddy/skills/"). Discovery must use ~/.codebuddy/skills instead.
+func TestListRuntimeLocalSkills_Codebuddy(t *testing.T) {
+ home := t.TempDir()
+ t.Setenv("HOME", home)
+
+ writeTestLocalSkill(t, filepath.Join(home, ".codebuddy", "skills"), "review-helper", map[string]string{
+ "SKILL.md": "---\nname: CodeBuddy Review\ndescription: Review code with CodeBuddy\n---\n# CodeBuddy Review\n",
+ })
+ // ~/.claude/skills is not a CodeBuddy discovery root, so this must not
+ // appear for the codebuddy provider.
+ writeTestLocalSkill(t, filepath.Join(home, ".claude", "skills"), "review-helper", map[string]string{
+ "SKILL.md": "---\nname: Claude Review\ndescription: Should not appear for codebuddy\n---\n# Claude Review\n",
+ })
+
+ skills, supported, err := listRuntimeLocalSkills("codebuddy")
+ if err != nil {
+ t.Fatalf("listRuntimeLocalSkills: %v", err)
+ }
+ if !supported {
+ t.Fatal("codebuddy should be supported")
+ }
+ if len(skills) != 1 {
+ t.Fatalf("expected 1 skill, got %d: %+v", len(skills), skills)
+ }
+
+ skill := skills[0]
+ if skill.Key != "review-helper" {
+ t.Fatalf("key = %q, want review-helper", skill.Key)
+ }
+ if skill.Name != "CodeBuddy Review" {
+ t.Fatalf("name = %q, want CodeBuddy Review", skill.Name)
+ }
+ if skill.SourcePath != "~/.codebuddy/skills/review-helper" {
+ t.Fatalf("source_path = %q, want ~/.codebuddy/skills/review-helper", skill.SourcePath)
+ }
+}
+
+func TestRuntimeLocalSkills_CodebuddyExcludesClaudePluginSkills(t *testing.T) {
+ home := t.TempDir()
+ t.Setenv("HOME", home)
+
+ writeTestLocalSkill(t, filepath.Join(home, ".codebuddy", "skills"), "codebuddy-only", map[string]string{
+ "SKILL.md": "---\nname: CodeBuddy Only\n---\n",
+ })
+ installPath := writeTestClaudePlugin(t, home, "paper-desktop@paper", "paper-desktop", true)
+ writeTestLocalSkill(t, filepath.Join(installPath, "skills"), "design-to-code", map[string]string{
+ "SKILL.md": "---\nname: Claude Plugin Skill\n---\n",
+ })
+
+ skills, supported, err := listRuntimeLocalSkills("codebuddy")
+ if err != nil {
+ t.Fatalf("listRuntimeLocalSkills: %v", err)
+ }
+ if !supported {
+ t.Fatal("codebuddy should be supported")
+ }
+ if len(skills) != 1 || skills[0].Key != "codebuddy-only" {
+ t.Fatalf("CodeBuddy must not list Claude plugin skills, got %#v", skills)
+ }
+
+ bundle, supported, err := loadRuntimeLocalSkillBundle("codebuddy", "paper-desktop:design-to-code")
+ if !supported {
+ t.Fatal("codebuddy should be supported for import")
+ }
+ if err == nil || err.Error() != "local skill not found" {
+ t.Fatalf("load Claude plugin skill for CodeBuddy err = %v, want local skill not found", err)
+ }
+ if bundle != nil {
+ t.Fatalf("load Claude plugin skill for CodeBuddy bundle = %#v, want nil", bundle)
+ }
+}
+
func TestListRuntimeLocalSkills_ClaudeEnabledPlugin(t *testing.T) {
home := t.TempDir()
t.Setenv("HOME", home)
diff --git a/server/internal/daemon/repocache/cache.go b/server/internal/daemon/repocache/cache.go
index 6ac45f53d3..20e8576d23 100644
--- a/server/internal/daemon/repocache/cache.go
+++ b/server/internal/daemon/repocache/cache.go
@@ -51,7 +51,16 @@ func gitEnv() []string {
)
}
-var agentGitExcludePatterns = []string{".agent_context", "CLAUDE.md", "AGENTS.md", ".claude", ".opencode", ".deveco"}
+var agentGitExcludePatterns = []string{
+ ".agent_context",
+ "CLAUDE.md",
+ "AGENTS.md",
+ ".claude",
+ ".opencode",
+ ".deveco",
+ "CODEBUDDY.md",
+ ".codebuddy",
+}
const repoCacheGitTimeout = 10 * time.Minute
diff --git a/server/internal/daemon/repocache/cache_test.go b/server/internal/daemon/repocache/cache_test.go
index ef06246be0..f9ed897553 100644
--- a/server/internal/daemon/repocache/cache_test.go
+++ b/server/internal/daemon/repocache/cache_test.go
@@ -545,6 +545,44 @@ func TestCreateWorktreeExcludesOpenCodeSkills(t *testing.T) {
}
}
+// TestCreateWorktreeExcludesCodebuddySidecars is the regression guard for
+// PR #5224's review feedback: once the daemon started writing
+// .codebuddy/skills/ and CODEBUDDY.md into the task workdir (instead of
+// reusing Claude's .claude/CLAUDE.md, which were already excluded), the
+// repo-cache worktree needed the new CodeBuddy sidecar paths added to
+// .git/info/exclude too — otherwise these daemon-injected files show up in
+// `git status` and risk being committed by the agent.
+func TestCreateWorktreeExcludesCodebuddySidecars(t *testing.T) {
+ t.Parallel()
+ sourceRepo := createTestRepo(t)
+ cacheRoot := t.TempDir()
+
+ cache := New(cacheRoot, testLogger())
+ if err := cache.Sync("ws-1", []RepoInfo{{URL: sourceRepo}}); err != nil {
+ t.Fatalf("sync failed: %v", err)
+ }
+
+ workDir := t.TempDir()
+ result, err := cache.CreateWorktree(WorktreeParams{
+ WorkspaceID: "ws-1",
+ RepoURL: sourceRepo,
+ WorkDir: workDir,
+ AgentName: "CodeBuddy",
+ TaskID: "codebuddy-exclude-test",
+ })
+ if err != nil {
+ t.Fatalf("CreateWorktree failed: %v", err)
+ }
+
+ exclude := gitInfoExclude(t, result.Path)
+ if !strings.Contains(exclude, ".codebuddy\n") {
+ t.Fatalf("expected .git/info/exclude to contain .codebuddy, got:\n%s", exclude)
+ }
+ if !strings.Contains(exclude, "CODEBUDDY.md\n") {
+ t.Fatalf("expected .git/info/exclude to contain CODEBUDDY.md, got:\n%s", exclude)
+ }
+}
+
func gitInfoExclude(t *testing.T, worktreePath string) string {
t.Helper()
cmd := exec.Command("git", "-C", worktreePath, "rev-parse", "--git-dir")