Skip to content

claude-code: rtk init --hook-only leaves the in-container agent without RTK.md (no meta-command awareness) #115

Open

Description

@gatezh

Context

The claude-code template's init-plugins.sh initializes rtk with:

rtk init -g --hook-only --auto-patch

--hook-only installs the PreToolUse rewrite hook but creates no RTK.md. Because the
container's Claude config dir is an isolated named volume
(CLAUDE_CONFIG_DIR=/home/node/.claude, mounted as …-claude-config-…) rather than a mount of the
host ~/.claude, the in-container Claude — both the claude CLI and the VS Code extension — never
sees any RTK.md. The host's RTK.md does not propagate.

Result: the agent benefits from transparent command rewriting, but has no awareness of the
meta-commands
(rtk gain, rtk discover, rtk proxy). On creation rtk even prints:

No RTK.md created. Claude won't know about meta commands (gain, discover, proxy).

Proposal

Drop --hook-only while keeping -g:

rtk init -g --auto-patch

Verified in a running claude-code container (rtk 0.x, bun 1.3.14):

  • Creates /home/node/.claude/RTK.md (~10 lines) and adds @RTK.md to /home/node/.claude/CLAUDE.md.
  • Because of -g, the workspace stays clean — no RTK.md, CLAUDE.md, or .rtk/ appears under
    /workspace (confirmed by ls).
  • The hook itself is unchanged/idempotent (settings.json: hook already present).

Tradeoff

  • Cost: ~1 KB (~10 lines) added to the agent's context per session.
  • Benefit: the agent proactively uses meta-commands (e.g. runs rtk gain to report savings, uses
    rtk proxy <cmd> to bypass filtering while debugging).

This is a default-policy preference. If --hook-only is the deliberate default (keep the agent's
context minimal), closing as intended is reasonable — filing so the choice is explicit and
discoverable. Related wiring issue: #107 (Finding 1 — init-plugins.sh is the intended
postCreateCommand but the default variant never defines it).

Environment

  • gatezh/devcontainers, claude-code template; ghcr.io/gatezh/devcontainers/claude-code:latest.
  • Found while setting up a consumer project from the claude-code variant.

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions