Skip to content

hook: --ultra-compact and --skip-env are accepted but never propagate into the rewritten command #2984

Description

@cboydstun

Description

rtk hook claude accepts --ultra-compact and --skip-env (they're documented in rtk hook --help), but neither flag has any effect: the rewritten command emitted to Claude Code is byte-identical with and without them. The flags are silently dropped.

This matters because the hook is the only path most Claude Code users ever exercise — commands are rewritten transparently, so a user never types rtk by hand. Configuring "command": "rtk hook claude --ultra-compact" in ~/.claude/settings.json looks like it enables Level 2 savings, but it is a no-op. There is no error and no warning, so the setting appears to work.

Repro steps

for f in "" "--ultra-compact" "--skip-env"; do
  echo '{"tool_name":"Bash","tool_input":{"command":"next build"}}' \
    | rtk hook claude $f \
    | python3 -c 'import sys,json;print(json.load(sys.stdin)["hookSpecificOutput"]["updatedInput"]["command"])'
done

Output:

rtk next     # no flag
rtk next     # --ultra-compact
rtk next     # --skip-env

Same result for every command type I tried (git status, jest, tsc --noEmit, eslint src, grep -rn foo src, npm run build).

Expected

The hook should propagate its flags into the rewritten command, e.g.

rtk hook claude --ultra-compact   ->  rtk next --ultra-compact
rtk hook claude --skip-env        ->  rtk next --skip-env

rtk next (and the other subcommands) already accept both flags — rtk next --help lists them — so the target side is in place; only the hook's rewrite is missing them.

If the flags are intentionally unsupported on the hook path, they should be rejected at parse time or removed from rtk hook --help rather than accepted and ignored.

Actual

Flags are accepted, produce no change, and emit no warning.

Version / environment

  • rtk 0.43.0, macOS arm64 (Darwin 24.6.0)
  • Hook configured as a PreToolUse / Bash matcher in ~/.claude/settings.json

Note

Distinct from #2369, which is about the top-level -u shorthand not being implemented on the main CLI. This report is about the long flags being accepted by rtk hook claude and then not reaching the rewritten command.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions