Skip to content

wrap/init seeds the Claude Code permission allowlist with tool names that do not match the active profile #1289

Description

@mmashwani

Environment

  • lean-ctx 3.9.12 (official Homebrew build), macOS
  • Client: Claude Code
  • Active tool profile: lean (default)

Summary

lean-ctx wrap claude (and init) writes MCP tool entries into Claude Code's ~/.claude/settings.json under permissions.allow. The seeded set does not match the tools the active lean profile advertises: it omits tools that are directly callable and includes several that are reachable only through the ctx_call gateway. In Claude Code's permission syntax (mcp__<server>__<tool>), an allow entry for a gateway-only tool never matches a real call, because the invocation is mcp__lean-ctx__ctx_call.

Seeded set (3.9.12)

ctx_read, ctx_search, ctx_tree, ctx_overview, ctx_plan, ctx_metrics, ctx_compress, ctx_session, ctx_knowledge, ctx_graph, ctx_retrieve, ctx_provider

Problems

  1. Omits the lean-advertised tools that are directly callable and used most: ctx_glob, ctx_compose, ctx_expand, ctx_callgraph, ctx_patch, ctx_shell, ctx_call. Those are the entries that would actually take effect; none are seeded.
  2. Includes tools that are gateway-only in lean, producing dead allow entries: ctx_overview, ctx_graph, ctx_plan, ctx_metrics, ctx_compress, ctx_retrieve, ctx_provider. All exist (per ctx_discover_tools) but are not standalone MCP tools in lean.
  3. The seeded set matches no shipped profile boundary (lean, standard, or power), consistent with the outdated tool taxonomy behind the SKILL.md "Core Tools" table.

Direct callability of the seeded gateway-only names, by profile

Tool lean (12) standard (17) power (81)
ctx_overview gateway-only direct direct
ctx_graph gateway-only direct direct
ctx_plan gateway-only gateway-only direct
ctx_metrics gateway-only gateway-only direct
ctx_compress gateway-only gateway-only direct
ctx_retrieve gateway-only gateway-only direct
ctx_provider gateway-only gateway-only direct

Profile switch does not reconcile the allowlist

Switching profiles (lean-ctx tools <name> or lean-ctx profile <name>) changes only the advertised MCP tool set; it does not modify ~/.claude/settings.json. A stale seeded allowlist is therefore never corrected by a later profile change. To reproduce: compare ~/.claude/settings.json before and after a profile switch; it is byte-identical.

Suggested fix

Seed permissions.allow from the active profile's advertised tool set at wrap/init time (the same source that should drive the SKILL.md "Core Tools" table), so the documentation, the advertised tools, and the seeded allowlist stay in sync. Optionally reconcile the allowlist on profile switch.

Related

The SKILL.md "Core Tools (10 always visible)" table shows the same taxonomy drift (same root cause).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingcliCLI commands / dispatchpriority: mediumNormalstatus: integratedFix merged to main but NOT yet in a tagged release

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions