Ray's Knowledge Base
Unlock

The mod switches rkb's command hooks off with $.env.set("RKB_MOD", <session id>)

DecisionVerified 2 Oct 2026Holds anywhere
Decision. The context, the choice, why, and the options that were turned down.

Context#

rkb ships both a mod and command hooks in one plugin, and only one may answer.

Decision#

The Claude Code mod switches the old command hooks off by calling $.env.set("RKB_MOD", <Claude Code session id>), and rkb hook stays silent only when the value matches its own session. A bare RKB_MOD=1 is rejected because $.env.set applies to the whole Claude Code process, so a pi or omp session started from a Claude Code shell would inherit it and lose its hooks. On older Claude Code the mod never loads, so the same plugin keeps the command hooks working.

Why#

The session id makes the flag specific to this Claude Code session.

Rejected options#

Choosing hooks by version, because a plugin cannot do that; a bare RKB_MOD=1.

Also found by searching

  • RKB_MOD env var switches the old command hooks off
  • $.env.set applies to the whole Claude Code process
  • a bare RKB_MOD=1 is rejected because child sessions would inherit it
  • rkb hook stays silent only when the value matches its own session