You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Option to run the restored assistant through a wrapper command #138
Thanks for maintaining this plugin, I rely on it to get my assistant sessions back after a reboot.
I start claude through a small launcher that prepares the process environment before it executes the real binary: it unsets one variable and injects a few secrets that are decrypted only for that process tree. They are read by MCP servers at startup, so they have to be in the environment of the claude process itself.
Two things get in the way when a session started this way is restored. #137 fixes the first one, a saved -- in front of the prompt. This issue is about the second.
Restore types command claude <saved args> --resume <id> into the pane, so a restored session comes back without that environment. The existing options cover part of it:
@assistant-resurrect-claude-drop-env handles the variable to unset.
@assistant-resurrect-capture-env could replay the secrets, but it stores their values in the sidecar and types them into the shell, which is what the launcher exists to avoid.
What I am missing is a way to put a command in front of the restored one, per tool, something like
set -g @assistant-resurrect-claude-launch-prefix 'my-env-wrapper'
giving my-env-wrapper claude <saved args> --resume <id>, where the wrapper sets up the environment and executes its arguments unchanged. The plugin would keep building and quoting the assistant command exactly as today.
I understand command <tool> is deliberate, to bypass aliases and functions, and that #136 is about typed text running commands, so a free-form prefix may not be something you want. A stricter shape could be a single executable path with no arguments, checked to exist at restore time. I'm not sure which shape fits the project, if any, so I will let you decide. I can prepare a PR with tests if one of them does.
Thanks for the detailed write-up, @gwarf, and for #137, which is merged.
Let's go with the stricter shape:
@assistant-resurrect-<tool>-launch-prefix takes one absolute path to an executable, with no arguments.
At restore time, check it with -x and reject it if it contains whitespace or control characters. If it fails, log that and fall back to the plain command.
Quote it with shell_quote and put it in front of the command restore builds today: '/path/wrapper' claude <args> --resume <id>. Inside the wrapper, use exec "$@". With a wrapper, command no longer bypasses aliases and functions, and exec'ing the real binary covers that.
Only the tmux option sets it. It is never read from the sidecar.
Please build on the control-character check in #139 (the fix for #136), so both share the same validation. A PR with tests is very welcome, including a note in the docs about the exec "$@" contract.
Activity
timvw commentedon Nov 24, 2026
Thanks for the detailed write-up, @gwarf, and for #137, which is merged.
Let's go with the stricter shape:
@assistant-resurrect-<tool>-launch-prefixtakes one absolute path to an executable, with no arguments.-xand reject it if it contains whitespace or control characters. If it fails, log that and fall back to the plain command.shell_quoteand put it in front of the command restore builds today:'/path/wrapper' claude <args> --resume <id>. Inside the wrapper, useexec "$@". With a wrapper,commandno longer bypasses aliases and functions, and exec'ing the real binary covers that.Please build on the control-character check in #139 (the fix for #136), so both share the same validation. A PR with tests is very welcome, including a note in the docs about the
exec "$@"contract.gwarf commentedon Dec 2, 2026
Thanks, @timvw! I'm now using this version, will report in case I've any issue.