Skip to content

Force agent to use CMM? #34

Closed
Closed

Description

@sonicviz

Is there any way to force the agent to always use MCC for search as the default, or is that the "wrong" way to use it?
Or have I misinterpreted how it's used by agents?

For example, here's the heuristic it came back with when I asked how it decided when to switch:

My heuristic:
Use grep_search when:
• I know (or can guess) the exact string/symbol — function name, variable, import path
• I want to find where something is used across files
• The codebase is small enough that raw text search is fast and precise
• I need current file contents (grep always reflects the live files)

Use codebase-memory-mcp when:
• The question is conceptual — "how does X work", "what calls Y", "what's the architecture of Z"
• I need a call graph or dependency trace across many files
• grep would require 5+ sequential searches to piece together a picture
• The repo has been indexed and the graph is fresh

The practical tell: If I can write the search string in 5 seconds, I use grep. If I'd need to follow a chain of "grep → read result → grep again → read result" more than 2-3 times, the MCP graph traversal is cheaper.

Activity

  1. sonicviz commented on Mar 15, 2026

    @sonicviz
    ContributorAuthor

    I'm just asking if I misinterpreted how it's supposed to work via agents like copilot.
    Is the above correct, or not?
    It's not exactly clear in the docs how and when you can trigger it or if you have any control in agent mode unless you invoke directly via terminal?

  2. DeusData commented on Mar 19, 2026

    @DeusData
    Owner

    Fixed in 159378a and 442cb95 — shipping with v0.5.0.

    The install command now enforces MCP tool preference through multiple mechanisms per agent:

    • Claude Code: PreToolUse hook on Grep|Glob|Read + directive skill descriptions (100% activation)
    • Gemini CLI: BeforeTool hook on grep_search|read_file + GEMINI.md instructions
    • Codex/OpenCode/Antigravity/Aider/KiloCode: AGENTS.md or equivalent instruction files with "ALWAYS prefer MCP tools" directives

    The heuristic you described (grep for exact strings, MCP for conceptual/multi-hop queries) is exactly right — our instructions explicitly tell agents when to fall back to built-in search. The hooks are advisory (exit 0), not blocking.

    Thanks for the detailed analysis @sonicviz — it directly shaped the instruction content.

    If agents still default to grep too often after v0.5.0, please reopen or file a new issue.

  3. sonicviz commented on Mar 20, 2026

    @sonicviz
    ContributorAuthor

    Thanks. Does this also install for CoPilot in VSCode?

    Another issue, not sure if it needs a report, is when you update it installs a bunch of integrations which are not installed, causing issues with the agent trying to start noni-runnable MCP servers as the base app is not installed.
    I don't have cursor, windsurg, or zed but it installed them. I only use CoPilot (as main) and claude/gemini cli as alternates.
    CoPilot lets you choose any model easily, and the agentic harness is as good as any of the others.
    Plus, it's subsidized, best cost-effective deal you can get for models like opus.

    Image
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    ux/behaviorDisplay bugs, docs, adoption UX

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions