Skip to content

Add an install plan receipt before mutating agent configs/hooks #388

@caioribeiroclw-pixel

Description

@caioribeiroclw-pixel

Context

codebase-memory-mcp is doing the useful but sensitive thing: one installer can configure MCP entries, instruction files, Skills, and pre-tool hooks across many coding agents.

The README already says the tool reads the codebase and writes agent configuration files. That is a good disclosure. The missing trust primitive I would look for as a user is a machine-readable install plan/receipt before those writes happen.

Proposal

Add an install --plan / install --dry-run mode, or have install emit a pre-mutation receipt before applying -y, with fields like:

{
  "type": "agent.install.plan.v1",
  "project_root": "<path or redacted>",
  "agents_detected": ["claude-code", "opencode", "openclaw"],
  "agents_selected": ["claude-code"],
  "config_files_planned": ["~/.claude/settings.json", ".claude/skills/..."],
  "instruction_files_planned": [".claude/skills/.../SKILL.md"],
  "hooks_planned": [
    {
      "agent": "claude-code",
      "event": "PreToolUse",
      "tools": ["Grep", "Glob"],
      "blocking": false,
      "command_source": "installed shim"
    }
  ],
  "backups_planned": ["~/.claude/settings.json.bak"],
  "writes_started": false,
  "network_after_install": false,
  "next_safe_command": "codebase-memory-mcp install -y"
}

The important part is writes_started=false: users and agents can inspect the plan before any config/hook mutation happens.

Why this matters

This project crosses several boundaries at once:

  • MCP server registration
  • agent instruction/Skill installation
  • repo or user config edits
  • pre-tool hook installation
  • optional indexing / local graph artifacts

For coding agents, those are not just setup details. They decide what tools become visible, what instructions get loaded, and what commands can run around future tool calls.

Acceptance sketch

  • codebase-memory-mcp install --plan prints planned agent/config/hook/instruction writes and exits without mutating files.
  • install -y either prints the same receipt before mutation or writes it to a stable path/log.
  • The plan avoids raw source code, secrets, full environment dumps, prompts, transcripts, and raw tool output.
  • The final install summary maps actual writes back to planned writes.
  • If auto-detection selects multiple agents, the receipt makes that explicit.

This would make the installer easier to trust from Claude Code/OpenClaw/Cursor-style agents, because the agent can prove what it is about to mutate before it mutates the user's toolchain.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestsecuritySecurity vulnerabilities, hardeningux/behaviorDisplay bugs, docs, adoption UX

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions