Skip to content

Add OPEN_PLAN_ANNOTATOR_SKIP_FILE to bypass the hook - #9

Merged
ndom91 merged 2 commits into
ndom91:mainfrom
plain-thinh-tran:skip-file
Oct 6, 2026
Merged

ndom91 merged 2 commits into
ndom91:mainfrom
plain-thinh-tran:skip-file

Conversation

@plain-thinh-tran

@plain-thinh-tran plain-thinh-tran commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Problem

When a Claude Code session is continued from another device through Remote Control, plans can't be approved. The ExitPlanMode hook opens the UI on localhost on the host machine and blocks until it gets a decision

Change

New env var OPEN_PLAN_ANNOTATOR_SKIP_FILE. While the file it names exists, the wrapper exits 0 in hook mode with no output, before resolving the runtime, so Claude Code falls back to its native plan approval. It's a file instead of a plain env var because the hook's environment is fixed when the session starts

  • shared/skipHook.mjs: the check, plus unit tests
  • bin/open-plan-annotator.mjs: skip in hook mode only; review and other CLI modes are unaffected

plain-thinh-tran and others added 2 commits October 6, 2026 01:21
While the file named by OPEN_PLAN_ANNOTATOR_SKIP_FILE exists, the
ExitPlanMode hook exits 0 with no output, so Claude Code falls back to
its native plan approval. The file is checked on every call, so the
bypass can be toggled mid session, e.g. while driving a session through
Remote Control where the local browser UI is unreachable and the hook
would otherwise block plan approval.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
When the runtime exits before the wrapper finishes writing the hook
payload to its stdin, the write fails with EPIPE. The stream had no
error listener, so Node crashed with exit 1 instead of reaching the
close handler, which exits 2 with a diagnosis. Exit 1 is a non-blocking
hook error, so the plan silently skipped review. This is the Linux CI
failure in the wrapper test on main.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
env: childEnv,
});

child.stdin.on("error", () => {});

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this fixes a test that is also faiing on main

@ndom91 ndom91 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just out of curiosity, how do you use this with claude remote? i.e. what would you set OPEN_PLAN_ANNOTATOR_SKIP_FILE to?

@plain-thinh-tran

Copy link
Copy Markdown
Contributor Author

@ndom91 I launch Claude through a small wrapper that starts Remote Control on demand. It sets OPEN_PLAN_ANNOTATOR_SKIP_FILE and creates the file when Remote Control connects and deletes it when it disconnects.

I had to do it this way because im still using conductor and the small wrapper allows me to use RC from within conductor :D

@ndom91
ndom91 merged commit 9145111 into ndom91:main Oct 6, 2026
1 check passed
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.

2 participants