Skip to content

The cross-harness, self-improving memory layer for AI agents. Join our community: https://discord.com/invite/zdNChS2fBu

Cover Claude MCP and symlinked skills

shukieshah45f3f3930731
diff --git a/cli/beacon/internal/endpoint/inventory/inventory.go b/cli/beacon/internal/endpoint/inventory/inventory.go
index 68d10f9d..3287ec72 100644
--- a/cli/beacon/internal/endpoint/inventory/inventory.go
+++ b/cli/beacon/internal/endpoint/inventory/inventory.go
@@ -210,6 +210,7 @@ func candidates(home, wd string) []candidate {
func claudeCandidates(home, wd string) []candidate {
return []candidate{
+ {runtime: "claude_code", path: filepath.Join(home, ".claude.json"), scope: ScopeUser, format: formatJSON, kind: KindNativeConfig},
{runtime: "claude_code", path: filepath.Join(home, ".claude", "settings.json"), scope: ScopeUser, format: formatJSON, kind: KindNativeConfig},
{runtime: "claude_code", path: filepath.Join(wd, ".claude", "settings.json"), scope: ScopeProject, format: formatJSON, kind: KindNativeConfig},
{runtime: "claude_code", path: "/Library/Application Support/ClaudeCode/managed-settings.json", scope: ScopeManaged, format: formatJSON, kind: KindManagedConfig},
diff --git a/cli/beacon/internal/endpoint/inventory/inventory_test.go b/cli/beacon/internal/endpoint/inventory/inventory_test.go
index f5db7faf..9258cc61 100644
--- a/cli/beacon/internal/endpoint/inventory/inventory_test.go
+++ b/cli/beacon/internal/endpoint/inventory/inventory_test.go
@@ -51,26 +51,21 @@ GITHUB_TOKEN = "secret"
assertServer(t, result.MCPServers, "codex_cli", "github", TransportStdio, true, 2, 0, 1)
assertServer(t, result.MCPServers, "cursor", "remote", TransportSSE, false, 0, 0, 0)
- foundClaudeConfig := false
- for _, config := range result.Configs {
- if config.Runtime == "claude_code" && config.Scope == ScopeUser {
- foundClaudeConfig = true
- if !config.Exists || !config.Readable || config.ParserStatus != StatusOK {
- t.Fatalf("Claude config status = exists:%t readable:%t parser:%s", config.Exists, config.Readable, config.ParserStatus)
- }
- if config.MCPServerCount != 1 {
- t.Fatalf("Claude MCPServerCount = %d, want 1", config.MCPServerCount)
- }
- if config.FileSHA256 == "" || config.PathHash == "" {
- t.Fatal("Claude config missing hashes")
- }
- if config.ParserMode != formatJSON || config.ConfigKind != KindNativeConfig {
- t.Fatalf("Claude config mode/kind = %s/%s, want %s/%s", config.ParserMode, config.ConfigKind, formatJSON, KindNativeConfig)
- }
- }
+ claudeSettings := findConfig(result.Configs, "claude_code", filepath.Join(home, ".claude", "settings.json"))
+ if claudeSettings == nil {
+ t.Fatal("Claude settings config not found in inventory")
}
- if !foundClaudeConfig {
- t.Fatal("Claude user config not found in inventory")
+ if !claudeSettings.Exists || !claudeSettings.Readable || claudeSettings.ParserStatus != StatusOK {
+ t.Fatalf("Claude config status = exists:%t readable:%t parser:%s", claudeSettings.Exists, claudeSettings.Readable, claudeSettings.ParserStatus)
+ }
+ if claudeSettings.MCPServerCount != 1 {
+ t.Fatalf("Claude MCPServerCount = %d, want 1", claudeSettings.MCPServerCount)
+ }
+ if claudeSettings.FileSHA256 == "" || claudeSettings.PathHash == "" {
+ t.Fatal("Claude config missing hashes")
+ }
+ if claudeSettings.ParserMode != formatJSON || claudeSettings.ConfigKind != KindNativeConfig {
+ t.Fatalf("Claude config mode/kind = %s/%s, want %s/%s", claudeSettings.ParserMode, claudeSettings.ConfigKind, formatJSON, KindNativeConfig)
}
}
@@ -106,6 +101,36 @@ func TestScanIncludesNamesAndPaths(t *testing.T) {
}
}
+func TestScanClaudeJSONMCPInventory(t *testing.T) {
+ home := t.TempDir()
+ work := t.TempDir()
+ writeFile(t, filepath.Join(home, ".claude.json"), `{
+ "mcpServers": {
+ "github": {
+ "command": "gh",
+ "args": ["mcp", "serve"],
+ "env": {"GITHUB_TOKEN": "secret", "GH_HOST": "github.com"}
+ }
+ }
+}`)
+
+ result := Scan(Options{
+ HomeDir: home,
+ WorkingDir: work,
+ Runtimes: []string{"claude_code"},
+ Now: fixedNow,
+ })
+
+ assertServer(t, result.MCPServers, "claude_code", "github", TransportStdio, true, 2, 1, 2)
+ config := findConfig(result.Configs, "claude_code", filepath.Join(home, ".claude.json"))
+ if config == nil {
+ t.Fatalf("Claude ~/.claude.json config not found in %#v", result.Configs)
+ }
+ if config.MCPServerCount != 1 || config.ParserStatus != StatusOK {
+ t.Fatalf("Claude ~/.claude.json status = %#v, want one MCP server", config)
+ }
+}
+
func TestScanFiltersRuntimes(t *testing.T) {
home := t.TempDir()
work := t.TempDir()
@@ -162,18 +187,13 @@ command = "gh"
Now: fixedNow,
})
- var malformedFound bool
- for _, config := range result.Configs {
- if config.Runtime == "claude_code" && config.Scope == ScopeUser {
- malformedFound = true
- if config.ParserStatus != StatusParseFailed {
- t.Fatalf("malformed Claude parser status = %s, want %s", config.ParserStatus, StatusParseFailed)
- }
- }
- }
- if !malformedFound {
+ malformed := findConfig(result.Configs, "claude_code", filepath.Join(home, ".claude", "settings.json"))
+ if malformed == nil {
t.Fatal("malformed Claude config result not found")
}
+ if malformed.ParserStatus != StatusParseFailed {
+ t.Fatalf("malformed Claude parser status = %s, want %s", malformed.ParserStatus, StatusParseFailed)
+ }
assertServer(t, result.MCPServers, "codex_cli", "github", TransportStdio, true, 0, 0, 0)
}
@@ -211,6 +231,7 @@ func TestScanIncludesAllSupportedCurrentUserAndProjectConfigs(t *testing.T) {
})
expected := []candidate{
+ {runtime: "claude_code", path: filepath.Join(home, ".claude.json"), scope: ScopeUser, format: formatJSON, kind: KindNativeConfig},
{runtime: "claude_code", path: filepath.Join(home, ".claude", "settings.json"), scope: ScopeUser, format: formatJSON, kind: KindNativeConfig},
{runtime: "claude_code", path: filepath.Join(work, ".claude", "settings.json"), scope: ScopeProject, format: formatJSON, kind: KindNativeConfig},
{runtime: "claude_code", path: "/Library/Application Support/ClaudeCode/managed-settings.json", scope: ScopeManaged, format: formatJSON, kind: KindManagedConfig},
@@ -465,6 +486,35 @@ func TestSkillScanIsBoundedToDirectSkillManifests(t *testing.T) {
}
}
+func TestSkillScanFollowsSymlinkedSkillDirectories(t *testing.T) {
+ home := t.TempDir()
+ work := t.TempDir()
+ target := filepath.Join(home, ".agents", "skills", "find-skills")
+ writeFile(t, filepath.Join(target, "SKILL.md"), "# Find Skills")
+ linkRoot := filepath.Join(home, ".claude", "skills")
+ if err := os.MkdirAll(linkRoot, 0755); err != nil {
+ t.Fatal(err)
+ }
+ if err := os.Symlink(target, filepath.Join(linkRoot, "find-skills")); err != nil {
+ t.Fatal(err)
+ }
+
+ result := Scan(Options{
+ HomeDir: home,
+ WorkingDir: work,
+ Runtimes: []string{"claude_code"},
+ Now: fixedNow,
+ })
+
+ skill := findSkill(result.Skills, "claude_code", "find-skills", filepath.Join(linkRoot, "find-skills", "SKILL.md"))
+ if skill == nil {
+ t.Fatalf("symlinked Claude skill not found in %#v", result.Skills)
+ }
+ if !skill.Exists || !skill.Readable || skill.ParserStatus != StatusOK {
+ t.Fatalf("symlinked Claude skill status = %#v", skill)
+ }
+}
+
func TestInventoryLogAndStatePathsFollowRuntimeLog(t *testing.T) {
runtimeLog := filepath.Join("/tmp", "beacon", "runtime.jsonl")
if got, want := LogPath(runtimeLog, true), filepath.Join("/tmp", "beacon", "inventory_state.jsonl"); got != want {
diff --git a/cli/beacon/internal/endpoint/inventory/skills.go b/cli/beacon/internal/endpoint/inventory/skills.go
index 73b63468..16f9a31e 100644
--- a/cli/beacon/internal/endpoint/inventory/skills.go
+++ b/cli/beacon/internal/endpoint/inventory/skills.go
@@ -113,7 +113,10 @@ func inspectSkillRoot(root skillRoot, redaction string) []Skill {
if len(skills) >= maxSkillsPerRoot {
break
}
- if !entry.IsDir() || skipSkillDir(entry.Name()) {
+ if skipSkillDir(entry.Name()) {
+ continue
+ }
+ if !entry.IsDir() && entry.Type()&os.ModeSymlink == 0 {
continue
}
manifestPath := filepath.Join(root.path, entry.Name(), "SKILL.md")