Skip to content

fix(init): honor --no-mcp and --no-hooks for Claude Code - #124

Draft
michaelxer wants to merge 1 commit into
NanoNets:mainfrom
michaelxer:michaelxer/fix-claude-init-no-mcp-118-20260816
Draft

fix(init): honor --no-mcp and --no-hooks for Claude Code#124
michaelxer wants to merge 1 commit into
NanoNets:mainfrom
michaelxer:michaelxer/fix-claude-init-no-mcp-118-20260816

Conversation

@michaelxer

Copy link
Copy Markdown

Fixes #118.

Problem

graft init --no-mcp (and --no-hooks) only reached other-agent wiring. Claude Code still wrote .mcp.json and the hook shim/settings, even though the README says --no-mcp skips Claude Code MCP registration.

That's the path that burns extra LLM cache when Claude Code is pointed at a DeepSeek endpoint.

Fix

  • runInit honors mcp / hooks the same way runHostsInit already did
  • --dry-run / the picker drop those Claude paths
  • a later wiring refresh replays the stamp so an upgrade does not put them back
  • default graft init is unchanged

How I tested

node --import tsx --test test/claude-init.test.ts test/claude-settings-merge.test.ts test/hosts-init.test.ts test/hosts-plan.test.ts test/upkeep.test.ts

80 passed.

Local repro after the change:

graft init <tmp> --no-build --agents claude --no-mcp --no-hooks

writes statusline + skill, no .mcp.json, no graft-hooks.cjs. Default --agents claude still writes both.

Did not run a live Claude Code session against DeepSeek.

Those flags only reached other-agent wiring. Claude Code still wrote
.mcp.json and the hook shim. Skip the matching Claude writes, keep
dry-run/picker in sync, and replay the stamp on refresh.

Fixes NanoNets#118
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

graft init --no-mcp does not work for Claude Code

1 participant