claude-code: read and remove the person's own home items through the mesh
Hand-written items in an account's ~/.claude could only be removed over a shell on the machine. claude_code_home_show reads one in full (memory, ~/.claude/CLAUDE.md, included); claude_code_home_remove removes one on the person's word, with a required reason, refusing what the mesh placed and symbolic links, keeping a dated copy in the module's state and logging it.
This commit is contained in:
@@ -665,7 +665,7 @@ type HomeItem struct {
|
||||
|
||||
var mcpToolRef = regexp.MustCompile(`mcp__([A-Za-z0-9_-]+)__[A-Za-z0-9_-]+`)
|
||||
|
||||
// HomeItems lists the home's skills, subagents, commands, output styles and rule files, says which the mesh
|
||||
// HomeItems lists the home's skills, subagents, commands, output styles, rule files and its own memory (CLAUDE.md), says which the mesh
|
||||
// placed, and notes those that share a name with a mesh item or call a tool server that is not loaded here.
|
||||
func HomeItems(p Paths, c Config, loaded Servers) []HomeItem {
|
||||
dir := filepath.Join(p.Home, ".claude")
|
||||
@@ -718,6 +718,9 @@ func HomeItems(p Paths, c Config, loaded Servers) []HomeItem {
|
||||
add(kind, strings.TrimSuffix(e.Name(), ".md"), sub+"/"+e.Name(), string(body))
|
||||
}
|
||||
}
|
||||
if body, err := os.ReadFile(filepath.Join(dir, "CLAUDE.md")); err == nil {
|
||||
add(KindMemory, memoryName, "CLAUDE.md", string(body))
|
||||
}
|
||||
sort.Slice(out, func(i, j int) bool {
|
||||
if out[i].Kind != out[j].Kind {
|
||||
return out[i].Kind < out[j].Kind
|
||||
|
||||
Reference in New Issue
Block a user