Skip to content

fix(deprecate): warn on --claude-code flag and wt hook post-create alias - #2436

Merged
max-sixty merged 2 commits into
mainfrom
deprecations
Apr 27, 2026
Merged

max-sixty merged 2 commits into
mainfrom
deprecations

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

Both surfaces previously mapped silently to their canonical replacements, so users had no signal to migrate before eventual removal. Emit per-invocation warnings to stderr matching the existing pattern used by wt select, --no-verify, and wt hook approvals.

The config-section [hooks.post-create] warning path is unchanged — that already errors at config load (#2361). This only adds a warning for the bare CLI alias wt hook post-create, which still maps to pre-start after warning.

One UX consideration: --claude-code is read on every Claude Code statusline redraw, so users with the deprecated form in their statusline integration will see the warning each redraw until they migrate. That's the intent (surface the deprecation), but worth noting.

Co-Authored-By: Claude [email protected]

…` alias

Both surfaces previously mapped silently to their replacements, so users
had no signal to migrate before removal. Emit per-invocation warnings
matching the existing `wt select` / `--no-verify` / `wt hook approvals`
pattern. The config-section `[post-create]` warning is unchanged
(separate path, already errors at load).

Co-Authored-By: Claude <[email protected]>

@worktrunk-bot worktrunk-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Both new branches (if claude_code in handle_list_command and the args.first() == Some("post-create") check in handle_hook_command) lack test coverage, so codecov/patch is likely to fail. The closest precedent is test_switch_no_verify_deprecated_still_works (tests/integration_tests/switch.rs:863) — a similar smoke test that asserts stderr contains the deprecation string would cover both new code paths.

Smoke tests that assert each deprecated CLI surface (1) still works and
(2) emits the deprecation warning to stderr with the migration hint.
Modeled on test_switch_no_verify_deprecated_still_works.

Addresses auto-reviewer feedback on #2436 (codecov/patch coverage gap on
the two new branches).

Co-Authored-By: Claude <[email protected]>
@max-sixty
max-sixty merged commit acb985c into main Apr 27, 2026
25 checks passed
@max-sixty
max-sixty deleted the deprecations branch April 27, 2026 15:45
max-sixty pushed a commit that referenced this pull request Aug 17, 2026
…#3825)

The `running-tend` skill's weekly statusline cache-check recipe can't
run as written: its `sed -i ''` is BSD syntax, and the weekly job runs
on `ubuntu-24.04`. GNU sed reads the `''` as the script and the
substitution expression as a filename, so the step exits 2 and the input
file keeps its `REPLACE_WITH_CWD` placeholder — a session that pushed
past the error would then profile a statusline render against a
nonexistent working directory. Building the JSON with `jq -n --arg`
drops the placeholder dance entirely and can't be corrupted by a path
containing a quote.

The same block also invoked `wt list statusline --claude-code`, which
has been deprecated in favour of `--format=claude-code` since #2436 and
warns on every use.

<details><summary>Verification</summary>

GNU sed 4.9 on this runner, reproducing the failure:

```
$ sed -i '' "s|REPLACE_WITH_CWD|/home/x|" sedtest.txt
sed: can't read s|REPLACE_WITH_CWD|/home/x|: No such file or directory
exit=2
```

The corrected recipe, run end to end against a debug build of this
checkout:

```
$ jq -n --arg cwd "$PWD" '{hook_event_name:"Status", workspace:{current_dir:$cwd}, model:{display_name:"Opus"}, context_window:{used_percentage:42.0}}' > /tmp/statusline-input.json
$ wt -vv list statusline --format=claude-code < /tmp/statusline-input.json > /dev/null
exit=0
$ wt config state logs profile --format=json | jq .cache
{"same_context_duplicates": [...], "same_context_extra_calls": 2, ...}
```

The field names match what `StatuslineInput` reads —
`/workspace/current_dir`, `/model/display_name`,
`/context_window/used_percentage` in `src/commands/statusline.rs`.

Deprecation warning on the old flag:

```
$ wt list statusline --claude-code < /tmp/statusline-input.json
▲ --claude-code is deprecated; use --format=claude-code instead
```

No regression test: the change is to a skill markdown file, which has no
test harness in this repo. The recipe itself was run end to end instead,
as above.

</details>

Found by the nightly survey (`.claude/skills/` is not on the rotation,
but the statusline recipe surfaced while checking `wt list statusline`
doc accuracy in `skills/worktrunk/reference/claude-code.md`).

---------

Co-authored-by: worktrunk-bot <[email protected]>
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