Skip to content

Worktrunk is a CLI for Git worktree management, designed for parallel AI agent workflows

fix: approval bypass when using project: filter prefix (#331)

Maximilian Roos9e625ec22aed
diff --git a/docs/content/hook.md b/docs/content/hook.md
index 4949bb15a..22cd4b5ff 100644
--- a/docs/content/hook.md
+++ b/docs/content/hook.md
@@ -15,10 +15,17 @@ Hooks normally run automatically during `wt switch --create`, `wt merge`, and `w
Both user hooks (from `~/.config/worktrunk/config.toml`) and project hooks (from `.config/wt.toml`) are supported.
```bash
-wt hook pre-merge # Run pre-merge hooks
-wt hook pre-merge --yes # Skip approval prompts (for CI)
+wt hook pre-merge # Run all pre-merge hooks
+wt hook pre-merge test # Run hooks named "test" from both sources
+wt hook pre-merge user: # Run all user hooks
+wt hook pre-merge project: # Run all project hooks
+wt hook pre-merge user:test # Run only user's "test" hook
+wt hook pre-merge project:test # Run only project's "test" hook
+wt hook pre-merge --yes # Skip approval prompts (for CI)
```
+The `user:` and `project:` prefixes filter by source. Use `user:` or `project:` alone to run all hooks from that source, or `user:name` / `project:name` to run a specific hook.
+
## Hook types
| Hook | When | Blocking | Fail-fast |
@@ -239,7 +246,7 @@ User hooks support the same hook types and template variables as project hooks.
| Approval | Required | Not required |
| Execution order | After user hooks | Before project hooks |
-Skip hooks with `--no-verify`.
+Skip hooks with `--no-verify`. To run a specific hook when user and project both define the same name, use `user:name` or `project:name` syntax.
**Use cases:**
- Personal notifications or logging
diff --git a/src/cli.rs b/src/cli.rs
index 9cd3764d7..c3af3b4ec 100644
--- a/src/cli.rs
+++ b/src/cli.rs
@@ -1461,10 +1461,17 @@ Hooks normally run automatically during `wt switch --create`, `wt merge`, and `w
Both user hooks (from `~/.config/worktrunk/config.toml`) and project hooks (from `.config/wt.toml`) are supported.
```console
-wt hook pre-merge # Run pre-merge hooks
-wt hook pre-merge --yes # Skip approval prompts (for CI)
+wt hook pre-merge # Run all pre-merge hooks
+wt hook pre-merge test # Run hooks named "test" from both sources
+wt hook pre-merge user: # Run all user hooks
+wt hook pre-merge project: # Run all project hooks
+wt hook pre-merge user:test # Run only user's "test" hook
+wt hook pre-merge project:test # Run only project's "test" hook
+wt hook pre-merge --yes # Skip approval prompts (for CI)
```
+The `user:` and `project:` prefixes filter by source. Use `user:` or `project:` alone to run all hooks from that source, or `user:name` / `project:name` to run a specific hook.
+
## Hook types
| Hook | When | Blocking | Fail-fast |
@@ -1685,7 +1692,7 @@ User hooks support the same hook types and template variables as project hooks.
| Approval | Required | Not required |
| Execution order | After user hooks | Before project hooks |
-Skip hooks with `--no-verify`.
+Skip hooks with `--no-verify`. To run a specific hook when user and project both define the same name, use `user:name` or `project:name` syntax.
**Use cases:**
- Personal notifications or logging
diff --git a/src/commands/command_approval.rs b/src/commands/command_approval.rs
index 87ae01b25..4e95f0890 100644
--- a/src/commands/command_approval.rs
+++ b/src/commands/command_approval.rs
@@ -17,6 +17,7 @@
//! This ensures approval happens exactly once at the command entry point,
//! eliminating the need to thread `auto_trust` through execution layers.
+use super::hooks::{HookSource, ParsedFilter};
use super::project_config::{HookCommand, collect_commands_for_hooks};
use super::repository_ext::RepositoryCliExt;
use crate::output;
@@ -185,11 +186,28 @@ pub fn approve_hooks(
/// When `name_filter` is provided, only commands matching that name are shown
/// in the approval prompt. This is used by `wt hook <type> --name <name>` to
/// approve only the targeted hook rather than all hooks of that type.
+///
+/// Supports filter syntax:
+/// - `"foo"` — approves commands named "foo" from project config
+/// - `"project:foo"` — approves commands named "foo" from project config
+/// - `"project:"` — approves all commands from project config
+/// - `"user:"` or `"user:foo"` — skips approval (user hooks don't need approval)
pub fn approve_hooks_filtered(
ctx: &super::command_executor::CommandContext<'_>,
hook_types: &[HookType],
name_filter: Option<&str>,
) -> anyhow::Result<bool> {
+ // Parse filter to understand source and name separately
+ // Uses the same ParsedFilter as hooks.rs for consistent behavior
+ let parsed = name_filter.map(ParsedFilter::parse);
+
+ // If filter explicitly targets user hooks only, skip project approval entirely
+ if let Some(ref f) = parsed
+ && f.source == Some(HookSource::User)
+ {
+ return Ok(true);
+ }
+
let project_config = match ctx.repo.load_project_config()? {
Some(cfg) => cfg,
None => return Ok(true), // No project config = no commands to approve
@@ -198,8 +216,12 @@ pub fn approve_hooks_filtered(
let mut commands = collect_commands_for_hooks(&project_config, hook_types);
// Apply name filter before approval to only prompt for targeted commands
- if let Some(name) = name_filter {
- commands.retain(|cmd| cmd.command.name.as_deref() == Some(name));
+ // Use the parsed name (not raw filter) for matching
+ // Empty name (e.g., "project:") means match all project commands - no filtering
+ if let Some(ref f) = parsed
+ && !f.name.is_empty()
+ {
+ commands.retain(|cmd| cmd.command.name.as_deref() == Some(f.name));
}
if commands.is_empty() {
diff --git a/src/commands/hooks.rs b/src/commands/hooks.rs
index c936865d6..a77d65918 100644
--- a/src/commands/hooks.rs
+++ b/src/commands/hooks.rs
@@ -1,17 +1,3 @@
-// TODO(hook-naming): Refine hook display and filtering when user and project have same name
-//
-// Current behavior with `wt hook pre-merge foo`:
-// - Both user's "foo" and project's "foo" run (name filter applied to each source separately)
-// - Output: "Running user pre-merge foo:" then "Running project pre-merge foo:"
-//
-// Alternative approaches to consider:
-// 1. Show source in name: "Running pre-merge user:foo" / "Running pre-merge project:foo"
-// 2. Allow filtering by source: `wt hook pre-merge user:foo` runs only user's foo
-// 3. Current approach: always show "user"/"project" prefix, filter runs both
-//
-// The source prefix in filtering (option 2) would need to be used elsewhere too to justify
-// the syntax. Current behavior is reasonable but worth revisiting if users find it confusing.
-
use color_print::cformat;
use worktrunk::HookType;
use worktrunk::config::CommandConfig;
@@ -26,15 +12,22 @@ use crate::output::execute_command_in_worktree;
pub struct SourcedCommand {
pub prepared: PreparedCommand,
pub source: HookSource,
- /// Display label like "user post-start" or "project pre-merge"
- pub label: String,
+ pub hook_type: HookType,
}
impl SourcedCommand {
/// Announce this command before execution.
+ ///
+ /// Format: "Running pre-merge user:foo:" for named, "Running post-create user hook:" for unnamed
fn announce(&self) -> anyhow::Result<()> {
+ // Named: "user:foo" matches filter syntax
+ // Unnamed: "user hook" is clearer than just "user:"
+ let display_name = match &self.prepared.name {
+ Some(n) => format!("{}:{}", self.source, n),
+ None => format!("{} hook", self.source),
+ };
let full_label =
- crate::commands::format_command_label(&self.label, self.prepared.name.as_deref());
+ crate::commands::format_command_label(&self.hook_type.to_string(), Some(&display_name));
crate::output::print(progress_message(format!("{full_label}:")))?;
crate::output::gutter(format_bash_with_gutter(&self.prepared.expanded))?;
Ok(())
@@ -55,7 +48,7 @@ pub enum HookFailureStrategy {
///
/// Approval for project hooks is handled at the gate (command entry point),
/// not during hook execution.
-#[derive(Clone, Copy, strum::Display)]
+#[derive(Clone, Copy, Debug, PartialEq, Eq, strum::Display)]
#[strum(serialize_all = "kebab-case")]
pub enum HookSource {
/// User hooks from ~/.config/worktrunk/config.toml (no approval required)
@@ -64,16 +57,48 @@ pub enum HookSource {
Project,
}
-impl HookSource {
- /// Format a label for display: "user pre-merge" or "project pre-merge"
- pub fn format_label(&self, hook_type: HookType) -> String {
- format!("{} {}", self, hook_type)
+/// A parsed name filter, optionally scoped to a specific source.
+///
+/// Supports formats:
+/// - `"foo"` - matches commands named "foo" from any source
+/// - `"user:foo"` - matches only user's command named "foo"
+/// - `"project:foo"` - matches only project's command named "foo"
+/// - `"user:"` or `"project:"` - matches all commands from that source
+pub struct ParsedFilter<'a> {
+ pub source: Option<HookSource>,
+ pub name: &'a str,
+}
+
+impl<'a> ParsedFilter<'a> {
+ pub fn parse(filter: &'a str) -> Self {
+ if let Some(name) = filter.strip_prefix("user:") {
+ Self {
+ source: Some(HookSource::User),
+ name,
+ }
+ } else if let Some(name) = filter.strip_prefix("project:") {
+ Self {
+ source: Some(HookSource::Project),
+ name,
+ }
+ } else {
+ Self {
+ source: None,
+ name: filter,
+ }
+ }
+ }
+
+ /// Check if this filter matches the given source.
+ fn matches_source(&self, source: HookSource) -> bool {
+ self.source.is_none() || self.source == Some(source)
}
}
/// Prepare hook commands from both user and project configs.
///
/// Collects commands from user config first, then project config, applying the name filter.
+/// The filter supports source prefixes: `user:foo` or `project:foo` to run only from one source.
/// Returns a flat list of commands with source information for execution.
pub fn prepare_hook_commands(
ctx: &CommandContext,
@@ -83,44 +108,56 @@ pub fn prepare_hook_commands(
extra_vars: &[(&str, &str)],
name_filter: Option<&str>,
) -> anyhow::Result<Vec<SourcedCommand>> {
+ let parsed_filter = name_filter.map(ParsedFilter::parse);
let mut commands = Vec::new();
if let Some(config) = user_config {
- let prepared = prepare_commands(config, ctx, extra_vars, hook_type)?;
- let filtered = filter_by_name(prepared, name_filter);
- let label = HookSource::User.format_label(hook_type);
- commands.extend(filtered.into_iter().map(|p| SourcedCommand {
- prepared: p,
- source: HookSource::User,
- label: label.clone(),
- }));
+ // Skip user commands if filter specifies project source
+ if parsed_filter
+ .as_ref()
+ .is_none_or(|f| f.matches_source(HookSource::User))
+ {
+ let prepared = prepare_commands(config, ctx, extra_vars, hook_type)?;
+ let filtered = filter_by_name(prepared, parsed_filter.as_ref().map(|f| f.name));
+ commands.extend(filtered.into_iter().map(|p| SourcedCommand {
+ prepared: p,
+ source: HookSource::User,
+ hook_type,
+ }));
+ }
}
if let Some(config) = project_config {
- let prepared = prepare_commands(config, ctx, extra_vars, hook_type)?;
- let filtered = filter_by_name(prepared, name_filter);
- let label = HookSource::Project.format_label(hook_type);
- commands.extend(filtered.into_iter().map(|p| SourcedCommand {
- prepared: p,
- source: HookSource::Project,
- label: label.clone(),
- }));
+ // Skip project commands if filter specifies user source
+ if parsed_filter
+ .as_ref()
+ .is_none_or(|f| f.matches_source(HookSource::Project))
+ {
+ let prepared = prepare_commands(config, ctx, extra_vars, hook_type)?;
+ let filtered = filter_by_name(prepared, parsed_filter.as_ref().map(|f| f.name));
+ commands.extend(filtered.into_iter().map(|p| SourcedCommand {
+ prepared: p,
+ source: HookSource::Project,
+ hook_type,
+ }));
+ }
}
Ok(commands)
}
/// Filter commands by name (returns empty vec if name not found).
+/// Empty name matches all commands (supports `user:` to mean "all user hooks").
fn filter_by_name(
commands: Vec<PreparedCommand>,
name_filter: Option<&str>,
) -> Vec<PreparedCommand> {
match name_filter {
- Some(name) => commands
+ Some(name) if !name.is_empty() => commands
.into_iter()
.filter(|cmd| cmd.name.as_deref() == Some(name))
.collect(),
- None => commands,
+ _ => commands, // None or empty = match all
}
}
@@ -139,10 +176,20 @@ pub fn spawn_hook_commands_background(
let operation_prefix = hook_type.to_string();
+ // Track index for unnamed commands to prevent log collisions
+ let mut unnamed_index = 0usize;
+
for cmd in commands {
cmd.announce()?;
- let name = cmd.prepared.name.as_deref().unwrap_or("cmd");
+ let name = match &cmd.prepared.name {
+ Some(n) => n.clone(),
+ None => {
+ let idx = unnamed_index;
+ unnamed_index += 1;
+ format!("cmd-{idx}")
+ }
+ };
// Include source in operation name to prevent log file collisions between
// user and project hooks with the same name
let operation = format!("{}-{}-{}", cmd.source, operation_prefix, name);
@@ -184,11 +231,16 @@ fn check_name_filter_matched(
user_config: Option<&CommandConfig>,
project_config: Option<&CommandConfig>,
) -> anyhow::Result<()> {
- if let Some(name) = name_filter
+ if let Some(filter_str) = name_filter
&& total_commands_run == 0
{
+ let parsed = ParsedFilter::parse(filter_str);
let mut available = Vec::new();
- if let Some(config) = user_config {
+
+ // Only show commands from sources that match the filter
+ if parsed.matches_source(HookSource::User)
+ && let Some(config) = user_config
+ {
available.extend(
config
.commands()
@@ -196,7 +248,9 @@ fn check_name_filter_matched(
.filter_map(|c| c.name.as_ref().map(|n| format!("user:{n}"))),
);
}
- if let Some(config) = project_config {
+ if parsed.matches_source(HookSource::Project)
+ && let Some(config) = project_config
+ {
available.extend(
config
.commands()
@@ -205,7 +259,7 @@ fn check_name_filter_matched(
);
}
return Err(worktrunk::git::GitError::HookCommandNotFound {
- name: name.to_string(),
+ name: filter_str.to_string(),
available,
}
.into());
@@ -323,8 +377,8 @@ pub fn run_hook_concurrent_with_filter(
extra_vars: &[(&str, &str)],
name_filter: Option<&str>,
) -> anyhow::Result<()> {
+ use rayon::prelude::*;
use std::process::Stdio;
- use std::thread;
use worktrunk::shell_exec::ShellConfig;
let commands = prepare_hook_commands(
@@ -354,83 +408,58 @@ pub fn run_hook_concurrent_with_filter(
eprint!("{}", anstyle::Reset);
stderr().flush().ok();
- // Spawn all commands in parallel together.
+ // Run commands concurrently using Rayon's thread pool.
//
// Note: Unlike sequential execution (execute_streaming), we don't use process_group(0)
// or sophisticated signal forwarding here. Children inherit the foreground process group,
// so Ctrl+C sends SIGINT to all of them together. This simpler behavior is acceptable for
// "best effort" concurrent hooks - if the user interrupts, everything stops.
- //
- // Adding proper signal forwarding would require either spawning all children from the main
- // thread (not worker threads) or sharing child PIDs across threads with a coordinating
- // signal handler. The complexity isn't warranted for this use case.
let shell = ShellConfig::get();
- let worktree_path = ctx.worktree_path.to_path_buf();
-
- let handles: Vec<_> = commands
- .into_iter()
- .map(|cmd| {
- let shell = shell.clone();
- let worktree_path = worktree_path.clone();
- let prepared = cmd.prepared;
-
- thread::spawn(move || {
- use std::io::Write;
-
- let mut child_cmd = shell.command(&prepared.expanded);
- child_cmd
- .current_dir(&worktree_path)
- .stdin(Stdio::piped())
- .stdout(Stdio::from(std::io::stderr()))
- .stderr(Stdio::inherit())
- .env_remove(worktrunk::shell_exec::DIRECTIVE_FILE_ENV_VAR);
-
- let mut child = match child_cmd.spawn() {
- Ok(child) => child,
- Err(e) => {
- return Some(HookFailure {
- name: prepared.name.clone(),
- error: e.to_string(),
- exit_code: None,
- });
- }
- };
-
- // Pipe context JSON to stdin (same as sequential execution)
- if let Some(mut stdin) = child.stdin.take() {
- // Ignore write errors - command may not read stdin
- let _ = stdin.write_all(prepared.context_json.as_bytes());
- }
-
- match child.wait() {
- Ok(status) if status.success() => None,
- Ok(status) => Some(HookFailure {
- name: prepared.name.clone(),
- error: format!("exit status: {}", status.code().unwrap_or(-1)),
- exit_code: status.code(),
- }),
- Err(e) => Some(HookFailure {
+ let worktree_path = ctx.worktree_path;
+
+ let all_failures: Vec<HookFailure> = commands
+ .par_iter()
+ .filter_map(|cmd| {
+ use std::io::Write;
+
+ let prepared = &cmd.prepared;
+ let mut child_cmd = shell.command(&prepared.expanded);
+ child_cmd
+ .current_dir(worktree_path)
+ .stdin(Stdio::piped())
+ .stdout(Stdio::from(std::io::stderr()))
+ .stderr(Stdio::inherit())
+ .env_remove(worktrunk::shell_exec::DIRECTIVE_FILE_ENV_VAR);
+
+ let mut child = match child_cmd.spawn() {
+ Ok(child) => child,
+ Err(e) => {
+ return Some(HookFailure {
name: prepared.name.clone(),
error: e.to_string(),
exit_code: None,
- }),
+ });
}
- })
- })
- .collect();
+ };
+
+ // Pipe context JSON to stdin (same as sequential execution)
+ if let Some(mut stdin) = child.stdin.take() {
+ // Ignore write errors - command may not read stdin
+ let _ = stdin.write_all(prepared.context_json.as_bytes());
+ }
- // Wait for all and collect failures
- let all_failures: Vec<HookFailure> = handles
- .into_iter()
- .filter_map(|h| match h.join() {
- Ok(result) => result,
- Err(_) => {
- // Thread panicked - treat as failure (command name context is lost)
- Some(HookFailure {
- name: None,
- error: "thread panicked".to_string(),
+ match child.wait() {
+ Ok(status) if status.success() => None,
+ Ok(status) => Some(HookFailure {
+ name: prepared.name.clone(),
+ error: format!("exit status: {}", status.code().unwrap_or(-1)),
+ exit_code: status.code(),
+ }),
+ Err(e) => Some(HookFailure {
+ name: prepared.name.clone(),
+ error: e.to_string(),
exit_code: None,
- })
+ }),
}
})
.collect();
@@ -438,26 +467,28 @@ pub fn run_hook_concurrent_with_filter(
// Report all failures at the end
if !all_failures.is_empty() {
let first = &all_failures[0];
- let error_msg = if all_failures.len() == 1 {
- match &first.name {
- Some(name) => format!("{}: {}", name, first.error),
- None => first.error.clone(),
- }
+ // For single failure, use command_name field (no duplication in error).
+ // For multiple failures, list all names in the error message.
+ let (command_name, error_msg) = if all_failures.len() == 1 {
+ (first.name.clone(), first.error.clone())
} else {
let names: Vec<_> = all_failures
.iter()
.map(|f| f.name.as_deref().unwrap_or("(unnamed)"))
.collect();
- format!(
- "{} commands failed: {}",
- all_failures.len(),
- names.join(", ")
+ (
+ None, // Multiple failures - no single command to blame
+ format!(
+ "{} commands failed: {}",
+ all_failures.len(),
+ names.join(", ")
+ ),
)
};
return Err(WorktrunkError::HookCommandFailed {
hook_type,
- command_name: first.name.clone(),
+ command_name,
error: error_msg,
exit_code: first.exit_code,
}
@@ -477,22 +508,6 @@ mod tests {
assert_eq!(HookSource::Project.to_string(), "project");
}
- #[test]
- fn test_hook_source_format_label() {
- assert_eq!(
- HookSource::User.format_label(HookType::PreMerge),
- "user pre-merge"
- );
- assert_eq!(
- HookSource::Project.format_label(HookType::PostCreate),
- "project post-create"
- );
- assert_eq!(
- HookSource::User.format_label(HookType::PreCommit),
- "user pre-commit"
- );
- }
-
#[test]
fn test_hook_failure_strategy_copy() {
let strategy = HookFailureStrategy::FailFast;
@@ -503,4 +518,54 @@ mod tests {
let copied_warn = warn;
assert!(matches!(copied_warn, HookFailureStrategy::Warn));
}
+
+ #[test]
+ fn test_parsed_filter_no_prefix() {
+ let filter = ParsedFilter::parse("foo");
+ assert!(filter.source.is_none());
+ assert_eq!(filter.name, "foo");
+ assert!(filter.matches_source(HookSource::User));
+ assert!(filter.matches_source(HookSource::Project));
+ }
+
+ #[test]
+ fn test_parsed_filter_user_prefix() {
+ let filter = ParsedFilter::parse("user:foo");
+ assert_eq!(filter.source, Some(HookSource::User));
+ assert_eq!(filter.name, "foo");
+ assert!(filter.matches_source(HookSource::User));
+ assert!(!filter.matches_source(HookSource::Project));
+ }
+
+ #[test]
+ fn test_parsed_filter_project_prefix() {
+ let filter = ParsedFilter::parse("project:bar");
+ assert_eq!(filter.source, Some(HookSource::Project));
+ assert_eq!(filter.name, "bar");
+ assert!(!filter.matches_source(HookSource::User));
+ assert!(filter.matches_source(HookSource::Project));
+ }
+
+ #[test]
+ fn test_parsed_filter_colon_in_name() {
+ // A name like "my:hook" without valid prefix should be parsed as-is
+ let filter = ParsedFilter::parse("my:hook");
+ assert!(filter.source.is_none());
+ assert_eq!(filter.name, "my:hook");
+ }
+
+ #[test]
+ fn test_parsed_filter_source_only() {
+ // "user:" means all user hooks (empty name)
+ let filter = ParsedFilter::parse("user:");
+ assert_eq!(filter.source, Some(HookSource::User));
+ assert_eq!(filter.name, "");
+ assert!(filter.matches_source(HookSource::User));
+ assert!(!filter.matches_source(HookSource::Project));
+
+ // "project:" means all project hooks
+ let filter = ParsedFilter::parse("project:");
+ assert_eq!(filter.source, Some(HookSource::Project));
+ assert_eq!(filter.name, "");
+ }
}
diff --git a/tests/integration_tests/approval_ui.rs b/tests/integration_tests/approval_ui.rs
index a2cfdda26..a8a3b208a 100644
--- a/tests/integration_tests/approval_ui.rs
+++ b/tests/integration_tests/approval_ui.rs
@@ -472,6 +472,102 @@ fn test_step_hook_name_filter_on_unnamed_command(repo: TestRepo) {
});
}
+/// Helper for step hook snapshot tests with extra args and approval prompt
+fn snapshot_run_hook_with_args(test_name: &str, repo: &TestRepo, args: &[&str], approve: bool) {
+ let settings = setup_snapshot_settings(repo);
+ settings.bind(|| {
+ let mut cmd = make_snapshot_cmd(repo, "hook", args, None);
+ cmd.stdin(Stdio::piped())
+ .stdout(Stdio::piped())
+ .stderr(Stdio::piped());
+
+ let mut child = cmd.spawn().unwrap();
+
+ // Write approval response
+ {
+ let stdin = child.stdin.as_mut().unwrap();
+ let response = if approve { b"y\n" } else { b"n\n" };
+ stdin.write_all(response).unwrap();
+ }
+
+ let output = child.wait_with_output().unwrap();
+
+ // Use insta snapshot for combined output
+ let stdout = String::from_utf8_lossy(&output.stdout);
+ let stderr = String::from_utf8_lossy(&output.stderr);
+ let combined = format!(
+ "exit_code: {}\n----- stdout -----\n{}\n----- stderr -----\n{}",
+ output.status.code().unwrap_or(-1),
+ stdout,
+ stderr
+ );
+
+ insta::assert_snapshot!(test_name, combined);
+ });
+}
+
+/// Test that `project:` prefix filter still requires approval (security fix test)
+///
+/// This verifies the fix for the approval bypass vulnerability where `project:name`
+/// filter syntax was not correctly parsed by the approval gate, allowing project
+/// hooks to run without approval.
+#[rstest]
+fn test_project_prefix_requires_approval(repo: TestRepo) {
+ repo.write_project_config(
+ r#"[pre-merge]
+test = "echo 'Running project test'"
+"#,
+ );
+ repo.commit("Add pre-merge hook");
+
+ // Running with project: prefix should still require approval
+ // Decline to verify the prompt appears
+ snapshot_run_hook_with_args(
+ "project_prefix_requires_approval",
+ &repo,
+ &["pre-merge", "project:test"],
+ false,
+ );
+}
+
+/// Test that `project:` (all project hooks) requires approval
+#[rstest]
+fn test_project_prefix_all_requires_approval(repo: TestRepo) {
+ repo.write_project_config(
+ r#"[pre-merge]
+test = "echo 'Running project test'"
+lint = "echo 'Running project lint'"
+"#,
+ );
+ repo.commit("Add pre-merge hooks");
+
+ // Running with project: (no name) should require approval for all project hooks
+ snapshot_run_hook_with_args(
+ "project_prefix_all_requires_approval",
+ &repo,
+ &["pre-merge", "project:"],
+ false,
+ );
+}
+
+/// Test that `user:` prefix skips approval (user hooks don't need it)
+#[rstest]
+fn test_user_prefix_skips_approval(repo: TestRepo) {
+ // Set up user config with a hook
+ repo.write_test_config(
+ r#"[pre-merge]
+test = "echo 'user test'"
+"#,
+ );
+
+ // Running with user: prefix should not prompt for approval
+ let settings = setup_snapshot_settings(&repo);
+ settings.bind(|| {
+ let mut cmd = make_snapshot_cmd(&repo, "hook", &["pre-merge", "user:test"], None);
+ assert_cmd_snapshot!("user_prefix_skips_approval", cmd);
+ });
+}
+
/// Test running all hooks (no name filter) still works
#[rstest]
fn test_step_hook_run_all_commands(repo: TestRepo) {
diff --git a/tests/integration_tests/shell_wrapper.rs b/tests/integration_tests/shell_wrapper.rs
index d813ea15d..f2165857a 100644
--- a/tests/integration_tests/shell_wrapper.rs
+++ b/tests/integration_tests/shell_wrapper.rs
@@ -1354,23 +1354,8 @@ approved-commands = ["echo 'background task'"]
assert_eq!(output.exit_code, 0, "Command should succeed");
- // Critical assertion: progress messages should appear to users
- // This is the test that catches the bug where progress() was incorrectly suppressed
- assert!(
- output.combined.contains("Running project post-start"),
- "Progress message 'Running project post-start' missing from output. \
- Output:\n{}",
- output.combined
- );
-
- // The background command itself should be shown via gutter formatting
- assert!(
- output.combined.contains("background task"),
- "Background command content missing from output"
- );
-
- // Normalize paths in output for snapshot testing
- // Snapshot the full output
+ // Snapshot verifies progress messages appear to users
+ // (catches the bug where progress() was incorrectly suppressed)
assert_snapshot!(output.normalized());
}
@@ -1419,20 +1404,7 @@ approved-commands = ["echo 'fish background task'"]
assert_eq!(output.exit_code, 0, "Command should succeed");
- // Critical: progress messages should appear to users through Fish wrapper
- assert!(
- output.combined.contains("Running project post-start"),
- "Progress message 'Running project post-start' missing from Fish wrapper output. \
- Output:\n{}",
- output.combined
- );
-
- // The background command itself should be shown via gutter formatting
- assert!(
- output.combined.contains("fish background task"),
- "Background command content missing from output"
- );
-
+ // Snapshot verifies progress messages appear to users through Fish wrapper
assert_snapshot!(output.normalized());
}
diff --git a/tests/integration_tests/snapshots/integration__integration_tests__approval_pty__approval_prompt_accept.snap b/tests/integration_tests/snapshots/integration__integration_tests__approval_pty__approval_prompt_accept.snap
index 07d30723b..e68bab69c 100644
--- a/tests/integration_tests/snapshots/integration__integration_tests__approval_pty__approval_prompt_accept.snap
+++ b/tests/integration_tests/snapshots/integration__integration_tests__approval_pty__approval_prompt_accept.snap
@@ -9,7 +9,7 @@ y
○ post-create:
  echo 'test command'
❯ Allow and remember? [y/N]
-◎ Running project post-create:
+◎ Running post-create project hook:
  echo 'test command'
test command
✓ Created new worktree for test-approve from main @ _REPO_/repo.test-approve
diff --git a/tests/integration_tests/snapshots/integration__integration_tests__approval_pty__approval_prompt_mixed_approved_unapproved_accept.snap b/tests/integration_tests/snapshots/integration__integration_tests__approval_pty__approval_prompt_mixed_approved_unapproved_accept.snap
index 7fc8a8d76..02c52c490 100644
--- a/tests/integration_tests/snapshots/integration__integration_tests__approval_pty__approval_prompt_mixed_approved_unapproved_accept.snap
+++ b/tests/integration_tests/snapshots/integration__integration_tests__approval_pty__approval_prompt_mixed_approved_unapproved_accept.snap
@@ -11,13 +11,13 @@ y
○ post-create third:
  echo 'Third command'
❯ Allow and remember? [y/N]
-◎ Running project post-create first:
+◎ Running post-create project:first:
  echo 'First command'
First command
-◎ Running project post-create second:
+◎ Running post-create project:second:
  echo 'Second command'
Second command
-◎ Running project post-create third:
+◎ Running post-create project:third:
  echo 'Third command'
Third command
✓ Created new worktree for test-mixed-accept from main @ _REPO_/repo.test-mixed-accept
diff --git a/tests/integration_tests/snapshots/integration__integration_tests__approval_pty__approval_prompt_multiple_commands.snap b/tests/integration_tests/snapshots/integration__integration_tests__approval_pty__approval_prompt_multiple_commands.snap
index 22cd4189d..1d0a90027 100644
--- a/tests/integration_tests/snapshots/integration__integration_tests__approval_pty__approval_prompt_multiple_commands.snap
+++ b/tests/integration_tests/snapshots/integration__integration_tests__approval_pty__approval_prompt_multiple_commands.snap
@@ -13,13 +13,13 @@ y
○ post-create third:
  echo 'Third command'
❯ Allow and remember? [y/N]
-◎ Running project post-create first:
+◎ Running post-create project:first:
  echo 'First command'
First command
-◎ Running project post-create second:
+◎ Running post-create project:second:
  echo 'Second command'
Second command
-◎ Running project post-create third:
+◎ Running post-create project:third:
  echo 'Third command'
Third command
✓ Created new worktree for test-multi from main @ _REPO_/repo.test-multi
diff --git a/tests/integration_tests/snapshots/integration__integration_tests__approval_pty__approval_prompt_named_commands.snap b/tests/integration_tests/snapshots/integration__integration_tests__approval_pty__approval_prompt_named_commands.snap
index 14502a846..ea79c7790 100644
--- a/tests/integration_tests/snapshots/integration__integration_tests__approval_pty__approval_prompt_named_commands.snap
+++ b/tests/integration_tests/snapshots/integration__integration_tests__approval_pty__approval_prompt_named_commands.snap
@@ -13,13 +13,13 @@ y
○ post-create test:
  echo 'Running tests...'
❯ Allow and remember? [y/N]
-◎ Running project post-create install:
+◎ Running post-create project:install:
  echo 'Installing dependencies...'
Installing dependencies...
-◎ Running project post-create build:
+◎ Running post-create project:build:
  echo 'Building project...'
Building project...
-◎ Running project post-create test:
+◎ Running post-create project:test:
  echo 'Running tests...'
Running tests...
✓ Created new worktree for test-named from main @ _REPO_/repo.test-named
diff --git a/tests/integration_tests/snapshots/integration__integration_tests__approval_pty__approval_prompt_permission_error.snap b/tests/integration_tests/snapshots/integration__integration_tests__approval_pty__approval_prompt_permission_error.snap
index 7e18176f7..3299ee587 100644
--- a/tests/integration_tests/snapshots/integration__integration_tests__approval_pty__approval_prompt_permission_error.snap
+++ b/tests/integration_tests/snapshots/integration__integration_tests__approval_pty__approval_prompt_permission_error.snap
@@ -11,7 +11,7 @@ y
❯ Allow and remember? [y/N]
▲ Failed to save command approval: Failed to write config file: Permission denied (os error 13)
↳ Approval will be requested again next time.
-◎ Running project post-create:
+◎ Running post-create project hook:
  echo 'test command'
test command
✓ Created new worktree for test-permission from main @ _REPO_/repo.test-permission
diff --git a/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__fish_wrapper_preserves_progress_messages.snap b/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__fish_wrapper_preserves_progress_messages.snap
index d276754db..5547244ca 100644
--- a/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__fish_wrapper_preserves_progress_messages.snap
+++ b/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__fish_wrapper_preserves_progress_messages.snap
@@ -3,5 +3,5 @@ source: tests/integration_tests/shell_wrapper.rs
expression: output.normalized()
---
✓ Created new worktree for fish-bg from main @ [TMPDIR]/repo.fish-bg
-◎ Running project post-start:
+◎ Running post-start project hook:
  echo 'fish background task'
diff --git a/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__merge_with_mixed_stdout_stderr_bash.snap b/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__merge_with_mixed_stdout_stderr_bash.snap
index 9d36af1ed..e6cbe1dd5 100644
--- a/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__merge_with_mixed_stdout_stderr_bash.snap
+++ b/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__merge_with_mixed_stdout_stderr_bash.snap
@@ -2,7 +2,7 @@
source: tests/integration_tests/shell_wrapper.rs
expression: output.normalized()
---
-◎ Running project pre-merge check1:
+◎ Running pre-merge project:check1:
  [TMPDIR]/repo/mixed-output.sh check1 3
[check1] stdout line 1
[check1] stderr line 1
@@ -12,7 +12,7 @@ expression: output.normalized()
[check1] stderr line 3
[check1] stdout complete
[check1] stderr complete
-◎ Running project pre-merge check2:
+◎ Running pre-merge project:check2:
  [TMPDIR]/repo/mixed-output.sh check2 3
[check2] stdout line 1
[check2] stderr line 1
diff --git a/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__merge_with_mixed_stdout_stderr_zsh.snap b/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__merge_with_mixed_stdout_stderr_zsh.snap
index 9d36af1ed..e6cbe1dd5 100644
--- a/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__merge_with_mixed_stdout_stderr_zsh.snap
+++ b/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__merge_with_mixed_stdout_stderr_zsh.snap
@@ -2,7 +2,7 @@
source: tests/integration_tests/shell_wrapper.rs
expression: output.normalized()
---
-◎ Running project pre-merge check1:
+◎ Running pre-merge project:check1:
  [TMPDIR]/repo/mixed-output.sh check1 3
[check1] stdout line 1
[check1] stderr line 1
@@ -12,7 +12,7 @@ expression: output.normalized()
[check1] stderr line 3
[check1] stdout complete
[check1] stderr complete
-◎ Running project pre-merge check2:
+◎ Running pre-merge project:check2:
  [TMPDIR]/repo/mixed-output.sh check2 3
[check2] stdout line 1
[check2] stderr line 1
diff --git a/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__merge_with_pre_merge_failure_bash.snap b/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__merge_with_pre_merge_failure_bash.snap
index 33cbb61f3..1407a084a 100644
--- a/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__merge_with_pre_merge_failure_bash.snap
+++ b/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__merge_with_pre_merge_failure_bash.snap
@@ -2,10 +2,10 @@
source: tests/integration_tests/shell_wrapper.rs
expression: output.normalized()
---
-◎ Running project pre-merge format:
+◎ Running pre-merge project:format:
  echo '✓ Code formatting check passed'
✓ Code formatting check passed
-◎ Running project pre-merge test:
+◎ Running pre-merge project:test:
  echo '✗ Test suite failed: 3 tests failing' && exit 1
✗ Test suite failed: 3 tests failing
✗ pre-merge command failed: test: exit status: 1
diff --git a/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__merge_with_pre_merge_failure_zsh.snap b/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__merge_with_pre_merge_failure_zsh.snap
index 33cbb61f3..1407a084a 100644
--- a/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__merge_with_pre_merge_failure_zsh.snap
+++ b/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__merge_with_pre_merge_failure_zsh.snap
@@ -2,10 +2,10 @@
source: tests/integration_tests/shell_wrapper.rs
expression: output.normalized()
---
-◎ Running project pre-merge format:
+◎ Running pre-merge project:format:
  echo '✓ Code formatting check passed'
✓ Code formatting check passed
-◎ Running project pre-merge test:
+◎ Running pre-merge project:test:
  echo '✗ Test suite failed: 3 tests failing' && exit 1
✗ Test suite failed: 3 tests failing
✗ pre-merge command failed: test: exit status: 1
diff --git a/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__merge_with_pre_merge_success_bash.snap b/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__merge_with_pre_merge_success_bash.snap
index 970021aa3..f511c8f3a 100644
--- a/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__merge_with_pre_merge_success_bash.snap
+++ b/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__merge_with_pre_merge_success_bash.snap
@@ -2,13 +2,13 @@
source: tests/integration_tests/shell_wrapper.rs
expression: output.normalized()
---
-◎ Running project pre-merge format:
+◎ Running pre-merge project:format:
  echo '✓ Code formatting check passed'
✓ Code formatting check passed
-◎ Running project pre-merge lint:
+◎ Running pre-merge project:lint:
  echo '✓ Linting passed - no warnings'
✓ Linting passed - no warnings
-◎ Running project pre-merge test:
+◎ Running pre-merge project:test:
  echo '✓ All 47 tests passed in 2.3s'
✓ All 47 tests passed in 2.3s
◎ Merging 1 commit to main @ [HASH] (no commit/squash/rebase needed)
diff --git a/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__merge_with_pre_merge_success_zsh.snap b/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__merge_with_pre_merge_success_zsh.snap
index 970021aa3..f511c8f3a 100644
--- a/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__merge_with_pre_merge_success_zsh.snap
+++ b/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__merge_with_pre_merge_success_zsh.snap
@@ -2,13 +2,13 @@
source: tests/integration_tests/shell_wrapper.rs
expression: output.normalized()
---
-◎ Running project pre-merge format:
+◎ Running pre-merge project:format:
  echo '✓ Code formatting check passed'
✓ Code formatting check passed
-◎ Running project pre-merge lint:
+◎ Running pre-merge project:lint:
  echo '✓ Linting passed - no warnings'
✓ Linting passed - no warnings
-◎ Running project pre-merge test:
+◎ Running pre-merge project:test:
  echo '✓ All 47 tests passed in 2.3s'
✓ All 47 tests passed in 2.3s
◎ Merging 1 commit to main @ [HASH] (no commit/squash/rebase needed)
diff --git a/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__readme_example_hooks_post_create.snap b/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__readme_example_hooks_post_create.snap
index efb562861..b3f09c7db 100644
--- a/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__readme_example_hooks_post_create.snap
+++ b/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__readme_example_hooks_post_create.snap
@@ -2,11 +2,11 @@
source: tests/integration_tests/shell_wrapper.rs
expression: output.normalized()
---
-◎ Running project post-create install:
+◎ Running post-create project:install:
  uv sync
Resolved 24 packages in 145ms
Installed 24 packages in 1.2s
✓ Created new worktree for feature-x from main @ [TMPDIR]/repo.feature-x
-◎ Running project post-start dev:
+◎ Running post-start project:dev:
  uv run dev
diff --git a/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__readme_example_hooks_pre_merge.snap b/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__readme_example_hooks_pre_merge.snap
index dcc20baa2..89cd9fd10 100644
--- a/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__readme_example_hooks_pre_merge.snap
+++ b/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__readme_example_hooks_pre_merge.snap
@@ -9,7 +9,7 @@ expression: output.normalized()
  Implement login and token refresh endpoints with JWT validation.
  Includes comprehensive test coverage and input validation.
✓ Squashed @ [HASH]
-◎ Running project pre-merge test:
+◎ Running pre-merge project:test:
  uv run pytest
============================= test session starts ==============================
@@ -21,7 +21,7 @@ tests/test_auth.py::test_token_validation PASSED [100%]
============================== 3 passed in 0.8s ===============================
-◎ Running project pre-merge lint:
+◎ Running pre-merge project:lint:
  uv run ruff check
All checks passed!
diff --git a/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__switch_with_hooks_zsh.snap b/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__switch_with_hooks_zsh.snap
index 363804262..a97c70959 100644
--- a/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__switch_with_hooks_zsh.snap
+++ b/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__switch_with_hooks_zsh.snap
@@ -2,14 +2,14 @@
source: tests/integration_tests/shell_wrapper.rs
expression: output.normalized()
---
-◎ Running project post-create install:
+◎ Running post-create project:install:
  echo 'Installing dependencies...'
Installing dependencies...
-◎ Running project post-create build:
+◎ Running post-create project:build:
  echo 'Building project...'
Building project...
✓ Created new worktree for feature-hooks from main @ [TMPDIR]/repo.feature-hooks
-◎ Running project post-start server:
+◎ Running post-start project:server:
  echo 'Starting dev server on port 3000'
-◎ Running project post-start watch:
+◎ Running post-start project:watch:
  echo 'Watching for file changes'
diff --git a/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__switch_with_post_start_command_no_directive_leak.snap b/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__switch_with_post_start_command_no_directive_leak.snap
index a0534abc9..cd8cfd019 100644
--- a/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__switch_with_post_start_command_no_directive_leak.snap
+++ b/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__switch_with_post_start_command_no_directive_leak.snap
@@ -3,5 +3,5 @@ source: tests/integration_tests/shell_wrapper.rs
expression: output.normalized()
---
✓ Created new worktree for feature-with-hooks from main @ [TMPDIR]/repo.feature-with-hooks
-◎ Running project post-start:
+◎ Running post-start project hook:
  echo 'test command executed'
diff --git a/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__wrapper_preserves_progress_messages.snap b/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__wrapper_preserves_progress_messages.snap
index 0f2f9f997..07e3a8b2d 100644
--- a/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__wrapper_preserves_progress_messages.snap
+++ b/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__wrapper_preserves_progress_messages.snap
@@ -3,5 +3,5 @@ source: tests/integration_tests/shell_wrapper.rs
expression: output.normalized()
---
✓ Created new worktree for feature-bg from main @ [TMPDIR]/repo.feature-bg
-◎ Running project post-start:
+◎ Running post-start project hook:
  echo 'background task'
diff --git a/tests/snapshots/integration__integration_tests__approval_ui__already_approved_skip_prompt.snap b/tests/snapshots/integration__integration_tests__approval_ui__already_approved_skip_prompt.snap
index d3f834795..962520e4a 100644
--- a/tests/snapshots/integration__integration_tests__approval_ui__already_approved_skip_prompt.snap
+++ b/tests/snapshots/integration__integration_tests__approval_ui__already_approved_skip_prompt.snap
@@ -31,7 +31,7 @@ exit_code: 0
----- stdout -----
----- stderr -----
-◎ Running project post-create:
+◎ Running post-create project hook:
  echo 'approved' > output.txt
✓ Created new worktree for test-approved from main @ _REPO_.test-approved
↳ Run wt config shell install to enable automatic cd
diff --git a/tests/snapshots/integration__integration_tests__approval_ui__project_prefix_all_requires_approval.snap b/tests/snapshots/integration__integration_tests__approval_ui__project_prefix_all_requires_approval.snap
new file mode 100644
index 000000000..40254833b
--- /dev/null
+++ b/tests/snapshots/integration__integration_tests__approval_ui__project_prefix_all_requires_approval.snap
@@ -0,0 +1,16 @@
+---
+source: tests/integration_tests/approval_ui.rs
+expression: combined
+---
+exit_code: 1
+----- stdout -----
+
+----- stderr -----
+▲ repo needs approval to execute 2 commands:
+
+○ pre-merge test:
+  echo 'Running project test'
+○ pre-merge lint:
+  echo 'Running project lint'
+✗ Cannot prompt for approval in non-interactive environment
+↳ To skip prompts in CI/CD, add --yes; to pre-approve commands, run wt hook approvals add
diff --git a/tests/snapshots/integration__integration_tests__approval_ui__project_prefix_requires_approval.snap b/tests/snapshots/integration__integration_tests__approval_ui__project_prefix_requires_approval.snap
new file mode 100644
index 000000000..f76713b12
--- /dev/null
+++ b/tests/snapshots/integration__integration_tests__approval_ui__project_prefix_requires_approval.snap
@@ -0,0 +1,14 @@
+---
+source: tests/integration_tests/approval_ui.rs
+expression: combined
+---
+exit_code: 1
+----- stdout -----
+
+----- stderr -----
+▲ repo needs approval to execute 1 command:
+
+○ pre-merge test:
+  echo 'Running project test'
+✗ Cannot prompt for approval in non-interactive environment
+↳ To skip prompts in CI/CD, add --yes; to pre-approve commands, run wt hook approvals add
diff --git a/tests/snapshots/integration__integration_tests__approval_ui__user_prefix_skips_approval.snap b/tests/snapshots/integration__integration_tests__approval_ui__user_prefix_skips_approval.snap
new file mode 100644
index 000000000..4783fc399
--- /dev/null
+++ b/tests/snapshots/integration__integration_tests__approval_ui__user_prefix_skips_approval.snap
@@ -0,0 +1,36 @@
+---
+source: tests/integration_tests/approval_ui.rs
+info:
+ program: wt
+ args:
+ - hook
+ - pre-merge
+ - "user:test"
+ env:
+ APPDATA: "[TEST_CONFIG_HOME]"
+ CLICOLOR_FORCE: "1"
+ COLUMNS: "150"
+ GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"
+ GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"
+ GIT_CONFIG_GLOBAL: "[TEST_GIT_CONFIG]"
+ GIT_CONFIG_SYSTEM: /dev/null
+ GIT_EDITOR: ""
+ GIT_TERMINAL_PROMPT: "0"
+ HOME: "[TEST_HOME]"
+ LANG: C
+ LC_ALL: C
+ PATH: "[PATH]"
+ RUST_LOG: warn
+ SOURCE_DATE_EPOCH: "1735776000"
+ USERPROFILE: "[TEST_HOME]"
+ WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"
+ XDG_CONFIG_HOME: "[TEST_CONFIG_HOME]"
+---
+success: true
+exit_code: 0
+----- stdout -----
+
+----- stderr -----
+◎ Running pre-merge user:test:
+  echo 'user test'
+user test
diff --git a/tests/snapshots/integration__integration_tests__approval_ui__yes_bypasses_tty_check.snap b/tests/snapshots/integration__integration_tests__approval_ui__yes_bypasses_tty_check.snap
index 15046b1ee..f2e9101b7 100644
--- a/tests/snapshots/integration__integration_tests__approval_ui__yes_bypasses_tty_check.snap
+++ b/tests/snapshots/integration__integration_tests__approval_ui__yes_bypasses_tty_check.snap
@@ -32,7 +32,7 @@ exit_code: 0
----- stdout -----
----- stderr -----
-◎ Running project post-create:
+◎ Running post-create project hook:
  echo 'test command'
test command
✓ Created new worktree for test-yes-tty from main @ _REPO_.test-yes-tty
diff --git a/tests/snapshots/integration__integration_tests__approval_ui__yes_does_not_save_approvals_first_run.snap b/tests/snapshots/integration__integration_tests__approval_ui__yes_does_not_save_approvals_first_run.snap
index 0486e945c..fca85358e 100644
--- a/tests/snapshots/integration__integration_tests__approval_ui__yes_does_not_save_approvals_first_run.snap
+++ b/tests/snapshots/integration__integration_tests__approval_ui__yes_does_not_save_approvals_first_run.snap
@@ -32,7 +32,7 @@ exit_code: 0
----- stdout -----
----- stderr -----
-◎ Running project post-create:
+◎ Running post-create project hook:
  echo 'test command' > output.txt
✓ Created new worktree for test-yes from main @ _REPO_.test-yes
↳ Run wt config shell install to enable automatic cd
diff --git a/tests/snapshots/integration__integration_tests__merge__merge_post_merge_command_failure.snap b/tests/snapshots/integration__integration_tests__merge__merge_post_merge_command_failure.snap
index 22daabac3..4bbd35660 100644
--- a/tests/snapshots/integration__integration_tests__merge__merge_post_merge_command_failure.snap
+++ b/tests/snapshots/integration__integration_tests__merge__merge_post_merge_command_failure.snap
@@ -38,7 +38,7 @@ exit_code: 1
✓ Merged to main (1 commit, 1 file, +1)
◎ Removing feature worktree & branch in background (same commit as main, _)
○ Switched to worktree for main @ _REPO_
-◎ Running project post-merge:
+◎ Running post-merge project hook:
  exit 1
▲ Command failed: exit status: 1
✗ post-merge command failed: exit status: 1
diff --git a/tests/snapshots/integration__integration_tests__merge__merge_post_merge_command_named.snap b/tests/snapshots/integration__integration_tests__merge__merge_post_merge_command_named.snap
index a4c8cd761..8fabefd59 100644
--- a/tests/snapshots/integration__integration_tests__merge__merge_post_merge_command_named.snap
+++ b/tests/snapshots/integration__integration_tests__merge__merge_post_merge_command_named.snap
@@ -38,7 +38,7 @@ exit_code: 0
✓ Merged to main (1 commit, 1 file, +1)
◎ Removing feature worktree & branch in background (same commit as main, _)
○ Switched to worktree for main @ _REPO_
-◎ Running project post-merge notify:
+◎ Running post-merge project:notify:
  echo 'Merge to main complete' > notify.txt
-◎ Running project post-merge deploy:
+◎ Running post-merge project:deploy:
  echo 'Deploying branch feature' > deploy.txt
diff --git a/tests/snapshots/integration__integration_tests__merge__merge_post_merge_command_success.snap b/tests/snapshots/integration__integration_tests__merge__merge_post_merge_command_success.snap
index f02f76ab6..90defff7c 100644
--- a/tests/snapshots/integration__integration_tests__merge__merge_post_merge_command_success.snap
+++ b/tests/snapshots/integration__integration_tests__merge__merge_post_merge_command_success.snap
@@ -38,5 +38,5 @@ exit_code: 0
✓ Merged to main (1 commit, 1 file, +1)
◎ Removing feature worktree & branch in background (same commit as main, _)
○ Switched to worktree for main @ _REPO_
-◎ Running project post-merge:
+◎ Running post-merge project hook:
  echo 'merged feature to main' > post-merge-ran.txt
diff --git a/tests/snapshots/integration__integration_tests__merge__merge_post_merge_runs_from_main_branch.snap b/tests/snapshots/integration__integration_tests__merge__merge_post_merge_runs_from_main_branch.snap
index c8fbf0764..1d18fdee3 100644
--- a/tests/snapshots/integration__integration_tests__merge__merge_post_merge_runs_from_main_branch.snap
+++ b/tests/snapshots/integration__integration_tests__merge__merge_post_merge_runs_from_main_branch.snap
@@ -32,5 +32,5 @@ exit_code: 0
----- stderr -----
○ Already up to date with main (no new commits, no rebase needed)
○ Worktree preserved (main worktree)
-◎ Running project post-merge:
+◎ Running post-merge project hook:
  echo 'post-merge ran from main' > post-merge-ran.txt
diff --git a/tests/snapshots/integration__integration_tests__merge__merge_post_merge_runs_with_nothing_to_merge.snap b/tests/snapshots/integration__integration_tests__merge__merge_post_merge_runs_with_nothing_to_merge.snap
index 3f29b2b0a..ac7dd7c43 100644
--- a/tests/snapshots/integration__integration_tests__merge__merge_post_merge_runs_with_nothing_to_merge.snap
+++ b/tests/snapshots/integration__integration_tests__merge__merge_post_merge_runs_with_nothing_to_merge.snap
@@ -34,5 +34,5 @@ exit_code: 0
○ Already up to date with main (no new commits, no rebase needed)
◎ Removing feature worktree & branch in background (same commit as main, _)
○ Switched to worktree for main @ _REPO_
-◎ Running project post-merge:
+◎ Running post-merge project hook:
  echo 'post-merge ran' > post-merge-ran.txt
diff --git a/tests/snapshots/integration__integration_tests__merge__merge_pre_commit_command_failure.snap b/tests/snapshots/integration__integration_tests__merge__merge_pre_commit_command_failure.snap
index ec5308fb5..0ba34f6f2 100644
--- a/tests/snapshots/integration__integration_tests__merge__merge_pre_commit_command_failure.snap
+++ b/tests/snapshots/integration__integration_tests__merge__merge_pre_commit_command_failure.snap
@@ -33,7 +33,7 @@ exit_code: 1
----- stderr -----
▲ Auto-staging 1 untracked path:
  feature.txt
-◎ Running project pre-commit:
+◎ Running pre-commit project hook:
  exit 1
✗ pre-commit command failed: exit status: 1
↳ To skip pre-commit hooks, re-run with --no-verify
diff --git a/tests/snapshots/integration__integration_tests__merge__merge_pre_commit_command_success.snap b/tests/snapshots/integration__integration_tests__merge__merge_pre_commit_command_success.snap
index ac3f423d0..ccd911bcd 100644
--- a/tests/snapshots/integration__integration_tests__merge__merge_pre_commit_command_success.snap
+++ b/tests/snapshots/integration__integration_tests__merge__merge_pre_commit_command_success.snap
@@ -33,7 +33,7 @@ exit_code: 0
----- stderr -----
▲ Auto-staging 1 untracked path:
  feature.txt
-◎ Running project pre-commit:
+◎ Running pre-commit project hook:
  echo 'Pre-commit check passed'
Pre-commit check passed
◎ Committing changes with default message... (1 file, +1, no squashing needed)
diff --git a/tests/snapshots/integration__integration_tests__merge__merge_pre_merge_command_failure.snap b/tests/snapshots/integration__integration_tests__merge__merge_pre_merge_command_failure.snap
index 02fd69237..24f10adb9 100644
--- a/tests/snapshots/integration__integration_tests__merge__merge_pre_merge_command_failure.snap
+++ b/tests/snapshots/integration__integration_tests__merge__merge_pre_merge_command_failure.snap
@@ -31,7 +31,7 @@ exit_code: 1
----- stdout -----
----- stderr -----
-◎ Running project pre-merge:
+◎ Running pre-merge project hook:
  exit 1
✗ pre-merge command failed: exit status: 1
↳ To skip pre-merge hooks, re-run with --no-verify
diff --git a/tests/snapshots/integration__integration_tests__merge__merge_pre_merge_command_named.snap b/tests/snapshots/integration__integration_tests__merge__merge_pre_merge_command_named.snap
index 94725fc99..f2adae216 100644
--- a/tests/snapshots/integration__integration_tests__merge__merge_pre_merge_command_named.snap
+++ b/tests/snapshots/integration__integration_tests__merge__merge_pre_merge_command_named.snap
@@ -31,11 +31,11 @@ exit_code: 0
----- stdout -----
----- stderr -----
-◎ Running project pre-merge format:
+◎ Running pre-merge project:format:
  exit 0
-◎ Running project pre-merge lint:
+◎ Running pre-merge project:lint:
  exit 0
-◎ Running project pre-merge test:
+◎ Running pre-merge project:test:
  exit 0
◎ Merging 1 commit to main @ 4a48dbd (no commit/squash/rebase needed)
  * 4a48dbd Add feature file
diff --git a/tests/snapshots/integration__integration_tests__merge__merge_pre_merge_command_success.snap b/tests/snapshots/integration__integration_tests__merge__merge_pre_merge_command_success.snap
index c51fbf860..90ef8e3ee 100644
--- a/tests/snapshots/integration__integration_tests__merge__merge_pre_merge_command_success.snap
+++ b/tests/snapshots/integration__integration_tests__merge__merge_pre_merge_command_success.snap
@@ -31,7 +31,7 @@ exit_code: 0
----- stdout -----
----- stderr -----
-◎ Running project pre-merge:
+◎ Running pre-merge project hook:
  exit 0
◎ Merging 1 commit to main @ 4f5863f (no commit/squash/rebase needed)
  * 4f5863f Add feature file
diff --git a/tests/snapshots/integration__integration_tests__merge__merge_pre_squash_command_failure.snap b/tests/snapshots/integration__integration_tests__merge__merge_pre_squash_command_failure.snap
index ffad989cb..6242c8946 100644
--- a/tests/snapshots/integration__integration_tests__merge__merge_pre_squash_command_failure.snap
+++ b/tests/snapshots/integration__integration_tests__merge__merge_pre_squash_command_failure.snap
@@ -31,7 +31,7 @@ exit_code: 1
----- stdout -----
----- stderr -----
-◎ Running project pre-commit:
+◎ Running pre-commit project hook:
  exit 1
✗ pre-commit command failed: exit status: 1
↳ To skip pre-commit hooks, re-run with --no-verify
diff --git a/tests/snapshots/integration__integration_tests__merge__merge_pre_squash_command_success.snap b/tests/snapshots/integration__integration_tests__merge__merge_pre_squash_command_success.snap
index e7e5c2946..9a70fac65 100644
--- a/tests/snapshots/integration__integration_tests__merge__merge_pre_squash_command_success.snap
+++ b/tests/snapshots/integration__integration_tests__merge__merge_pre_squash_command_success.snap
@@ -31,7 +31,7 @@ exit_code: 0
----- stdout -----
----- stderr -----
-◎ Running project pre-commit:
+◎ Running pre-commit project hook:
  echo 'Pre-commit check passed'
Pre-commit check passed
◎ Merging 1 commit to main @ ef627f5 (no commit/squash/rebase needed)
diff --git a/tests/snapshots/integration__integration_tests__merge__readme_example_complex.snap b/tests/snapshots/integration__integration_tests__merge__readme_example_complex.snap
index bd6802252..f34538830 100644
--- a/tests/snapshots/integration__integration_tests__merge__readme_example_complex.snap
+++ b/tests/snapshots/integration__integration_tests__merge__readme_example_complex.snap
@@ -43,7 +43,7 @@ exit_code: 0
  - Add JWT encoding/decoding with signature verification
  - Create test suite covering all authentication flows
✓ Squashed @ 85d3884
-◎ Running project pre-merge test:
+◎ Running pre-merge project:test:
  cargo test
 Finished test [unoptimized + debuginfo] target(s) in 0.12s
Running unittests src/lib.rs (target/debug/deps/worktrunk-abc123)
@@ -55,7 +55,7 @@ test auth::tests::test_token_refresh ... ok
test auth::tests::test_token_validation ... ok
test result: ok. 18 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.08s
-◎ Running project pre-merge lint:
+◎ Running pre-merge project:lint:
  cargo clippy
 Checking worktrunk v0.1.0
Finished dev [unoptimized + debuginfo] target(s) in 1.23s
@@ -68,7 +68,7 @@ test result: ok. 18 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; fin
✓ Merged to main (1 commit, 3 files, +33)
◎ Removing feature-auth worktree & branch in background (same commit as main, _)
○ Switched to worktree for main @ _REPO_
-◎ Running project post-merge install:
+◎ Running post-merge project:install:
  cargo install --path .
 Installing worktrunk v0.1.0
Compiling worktrunk v0.1.0
diff --git a/tests/snapshots/integration__integration_tests__merge__readme_example_hooks_post_create.snap b/tests/snapshots/integration__integration_tests__merge__readme_example_hooks_post_create.snap
index 5a106dcb0..4a04bae49 100644
--- a/tests/snapshots/integration__integration_tests__merge__readme_example_hooks_post_create.snap
+++ b/tests/snapshots/integration__integration_tests__merge__readme_example_hooks_post_create.snap
@@ -32,12 +32,12 @@ exit_code: 0
----- stdout -----
----- stderr -----
-◎ Running project post-create install:
+◎ Running post-create project:install:
  uv sync
Resolved 24 packages in 145ms
Installed 24 packages in 1.2s
✓ Created new worktree for feature-x from main @ _REPO_.feature-x
↳ Run wt config shell install to enable automatic cd
-◎ Running project post-start dev:
+◎ Running post-start project:dev:
  uv run dev
diff --git a/tests/snapshots/integration__integration_tests__merge__readme_example_hooks_pre_merge.snap b/tests/snapshots/integration__integration_tests__merge__readme_example_hooks_pre_merge.snap
index 3315b339e..de45bc842 100644
--- a/tests/snapshots/integration__integration_tests__merge__readme_example_hooks_pre_merge.snap
+++ b/tests/snapshots/integration__integration_tests__merge__readme_example_hooks_pre_merge.snap
@@ -38,7 +38,7 @@ exit_code: 0
  Implement login and token refresh endpoints with JWT validation.
  Includes comprehensive test coverage and input validation.
✓ Squashed @ 7323bc5
-◎ Running project pre-merge test:
+◎ Running pre-merge project:test:
  uv run pytest
============================= test session starts ==============================
@@ -50,7 +50,7 @@ tests/test_auth.py::test_token_validation PASSED [100%]
============================== 3 passed in 0.8s ===============================
-◎ Running project pre-merge lint:
+◎ Running pre-merge project:lint:
  uv run ruff check
All checks passed!
diff --git a/tests/snapshots/integration__integration_tests__post_start_commands__both_create_and_start.snap b/tests/snapshots/integration__integration_tests__post_start_commands__both_create_and_start.snap
index a4fbec8a6..56c0e7c31 100644
--- a/tests/snapshots/integration__integration_tests__post_start_commands__both_create_and_start.snap
+++ b/tests/snapshots/integration__integration_tests__post_start_commands__both_create_and_start.snap
@@ -31,9 +31,9 @@ exit_code: 0
----- stdout -----
----- stderr -----
-◎ Running project post-create:
+◎ Running post-create project hook:
  echo 'Setup done' > setup.txt
✓ Created new worktree for feature from main @ _REPO_.feature
↳ Run wt config shell install to enable automatic cd
-◎ Running project post-start server:
+◎ Running post-start project:server:
  sleep 0.05 && echo 'Server running' > server.txt
diff --git a/tests/snapshots/integration__integration_tests__post_start_commands__execute_with_post_start.snap b/tests/snapshots/integration__integration_tests__post_start_commands__execute_with_post_start.snap
index efdbcbb11..457ac8637 100644
--- a/tests/snapshots/integration__integration_tests__post_start_commands__execute_with_post_start.snap
+++ b/tests/snapshots/integration__integration_tests__post_start_commands__execute_with_post_start.snap
@@ -34,7 +34,7 @@ exit_code: 0
----- stderr -----
✓ Created new worktree for feature from main @ _REPO_.feature
-◎ Running project post-start:
+◎ Running post-start project hook:
  echo 'Background task' > background.txt
◎ Executing (--execute):
  echo 'Execute flag' > execute.txt
diff --git a/tests/snapshots/integration__integration_tests__post_start_commands__post_create_default_branch_template.snap b/tests/snapshots/integration__integration_tests__post_start_commands__post_create_default_branch_template.snap
index 3f6beee29..238efdc76 100644
--- a/tests/snapshots/integration__integration_tests__post_start_commands__post_create_default_branch_template.snap
+++ b/tests/snapshots/integration__integration_tests__post_start_commands__post_create_default_branch_template.snap
@@ -32,7 +32,7 @@ exit_code: 0
----- stdout -----
----- stderr -----
-◎ Running project post-create:
+◎ Running post-create project hook:
  echo 'Default: main' > default.txt
✓ Created new worktree for feature from main @ _REPO_.feature
↳ Run wt config shell install to enable automatic cd
diff --git a/tests/snapshots/integration__integration_tests__post_start_commands__post_create_failing_command.snap b/tests/snapshots/integration__integration_tests__post_start_commands__post_create_failing_command.snap
index e46e71ae3..a2fa63321 100644
--- a/tests/snapshots/integration__integration_tests__post_start_commands__post_create_failing_command.snap
+++ b/tests/snapshots/integration__integration_tests__post_start_commands__post_create_failing_command.snap
@@ -31,7 +31,7 @@ exit_code: 0
----- stdout -----
----- stderr -----
-◎ Running project post-create:
+◎ Running post-create project hook:
  exit 1
▲ Command failed: exit status: 1
✓ Created new worktree for feature from main @ _REPO_.feature
diff --git a/tests/snapshots/integration__integration_tests__post_start_commands__post_create_git_variables_template.snap b/tests/snapshots/integration__integration_tests__post_start_commands__post_create_git_variables_template.snap
index 7a5569378..f4d8618ed 100644
--- a/tests/snapshots/integration__integration_tests__post_start_commands__post_create_git_variables_template.snap
+++ b/tests/snapshots/integration__integration_tests__post_start_commands__post_create_git_variables_template.snap
@@ -32,13 +32,13 @@ exit_code: 0
----- stdout -----
----- stderr -----
-◎ Running project post-create commit:
+◎ Running post-create project:commit:
  echo 'Commit: 5caad75ed9319b7bd5c35c626d7051d252f987e7' > git_vars.txt
-◎ Running project post-create short:
+◎ Running post-create project:short:
  echo 'Short: 5caad75' >> git_vars.txt
-◎ Running project post-create remote:
+◎ Running post-create project:remote:
  echo 'Remote: origin' >> git_vars.txt
-◎ Running project post-create worktree_name:
+◎ Running post-create project:worktree_name:
  echo 'Worktree Name: repo.feature' >> git_vars.txt
✓ Created new worktree for feature from main @ _REPO_.feature
↳ Run wt config shell install to enable automatic cd
diff --git a/tests/snapshots/integration__integration_tests__post_start_commands__post_create_multiline_control_structure.snap b/tests/snapshots/integration__integration_tests__post_start_commands__post_create_multiline_control_structure.snap
index cc510a3af..8f0346b33 100644
--- a/tests/snapshots/integration__integration_tests__post_start_commands__post_create_multiline_control_structure.snap
+++ b/tests/snapshots/integration__integration_tests__post_start_commands__post_create_multiline_control_structure.snap
@@ -31,7 +31,7 @@ exit_code: 0
----- stdout -----
----- stderr -----
-◎ Running project post-create:
+◎ Running post-create project hook:
  if [ ! -f test.txt ]; then
   echo 'File does not exist' > result.txt
  else
diff --git a/tests/snapshots/integration__integration_tests__post_start_commands__post_create_named_commands.snap b/tests/snapshots/integration__integration_tests__post_start_commands__post_create_named_commands.snap
index 0270dbfb9..012035cb4 100644
--- a/tests/snapshots/integration__integration_tests__post_start_commands__post_create_named_commands.snap
+++ b/tests/snapshots/integration__integration_tests__post_start_commands__post_create_named_commands.snap
@@ -31,10 +31,10 @@ exit_code: 0
----- stdout -----
----- stderr -----
-◎ Running project post-create install:
+◎ Running post-create project:install:
  echo 'Installing deps'
Installing deps
-◎ Running project post-create setup:
+◎ Running post-create project:setup:
  echo 'Running setup'
Running setup
✓ Created new worktree for feature from main @ _REPO_.feature
diff --git a/tests/snapshots/integration__integration_tests__post_start_commands__post_create_single_command.snap b/tests/snapshots/integration__integration_tests__post_start_commands__post_create_single_command.snap
index efac0ae7a..7c828abb9 100644
--- a/tests/snapshots/integration__integration_tests__post_start_commands__post_create_single_command.snap
+++ b/tests/snapshots/integration__integration_tests__post_start_commands__post_create_single_command.snap
@@ -31,7 +31,7 @@ exit_code: 0
----- stdout -----
----- stderr -----
-◎ Running project post-create:
+◎ Running post-create project hook:
  echo 'Setup complete'
Setup complete
✓ Created new worktree for feature from main @ _REPO_.feature
diff --git a/tests/snapshots/integration__integration_tests__post_start_commands__post_create_template_expansion.snap b/tests/snapshots/integration__integration_tests__post_start_commands__post_create_template_expansion.snap
index 0ccfc7abd..8342d65e6 100644
--- a/tests/snapshots/integration__integration_tests__post_start_commands__post_create_template_expansion.snap
+++ b/tests/snapshots/integration__integration_tests__post_start_commands__post_create_template_expansion.snap
@@ -31,15 +31,15 @@ exit_code: 0
----- stdout -----
----- stderr -----
-◎ Running project post-create repo:
+◎ Running post-create project:repo:
  echo 'Repo: repo' > info.txt
-◎ Running project post-create branch:
+◎ Running post-create project:branch:
  echo 'Branch: feature/test' >> info.txt
-◎ Running project post-create hash_port:
+◎ Running post-create project:hash_port:
  echo 'Port: 18064' >> info.txt
-◎ Running project post-create worktree:
+◎ Running post-create project:worktree:
  echo 'Worktree: _REPO_.feature-test' >> info.txt
-◎ Running project post-create root:
+◎ Running post-create project:root:
  echo 'Root: _REPO_' >> info.txt
✓ Created new worktree for feature/test from main @ _REPO_.feature-test
↳ Run wt config shell install to enable automatic cd
diff --git a/tests/snapshots/integration__integration_tests__post_start_commands__post_create_upstream_template.snap b/tests/snapshots/integration__integration_tests__post_start_commands__post_create_upstream_template.snap
index ca1ad36a4..e8e327d61 100644
--- a/tests/snapshots/integration__integration_tests__post_start_commands__post_create_upstream_template.snap
+++ b/tests/snapshots/integration__integration_tests__post_start_commands__post_create_upstream_template.snap
@@ -32,7 +32,7 @@ exit_code: 0
----- stdout -----
----- stderr -----
-◎ Running project post-create:
+◎ Running post-create project hook:
  echo 'Upstream: ' > upstream.txt
✓ Created new worktree for feature from main @ _REPO_.feature
↳ Run wt config shell install to enable automatic cd
diff --git a/tests/snapshots/integration__integration_tests__post_start_commands__post_start_complex_shell.snap b/tests/snapshots/integration__integration_tests__post_start_commands__post_start_complex_shell.snap
index 7d4e05087..ea0fb995a 100644
--- a/tests/snapshots/integration__integration_tests__post_start_commands__post_start_complex_shell.snap
+++ b/tests/snapshots/integration__integration_tests__post_start_commands__post_start_complex_shell.snap
@@ -33,7 +33,7 @@ exit_code: 0
----- stderr -----
✓ Created new worktree for feature from main @ _REPO_.feature
↳ Run wt config shell install to enable automatic cd
-◎ Running project post-start:
+◎ Running post-start project hook:
  echo 'line1
  line2
  line3' | grep line2 > filtered.txt
diff --git a/tests/snapshots/integration__integration_tests__post_start_commands__post_start_create_with_command.snap b/tests/snapshots/integration__integration_tests__post_start_commands__post_start_create_with_command.snap
index 7f40e35cd..9a1f1a891 100644
--- a/tests/snapshots/integration__integration_tests__post_start_commands__post_start_create_with_command.snap
+++ b/tests/snapshots/integration__integration_tests__post_start_commands__post_start_create_with_command.snap
@@ -33,5 +33,5 @@ exit_code: 0
----- stderr -----
✓ Created new worktree for feature from main @ _REPO_.feature
↳ Run wt config shell install to enable automatic cd
-◎ Running project post-start:
+◎ Running post-start project hook:
  echo 'POST-START-RAN' > post_start_marker.txt
diff --git a/tests/snapshots/integration__integration_tests__post_start_commands__post_start_invalid_command.snap b/tests/snapshots/integration__integration_tests__post_start_commands__post_start_invalid_command.snap
index fa3d57d82..82449aec7 100644
--- a/tests/snapshots/integration__integration_tests__post_start_commands__post_start_invalid_command.snap
+++ b/tests/snapshots/integration__integration_tests__post_start_commands__post_start_invalid_command.snap
@@ -33,5 +33,5 @@ exit_code: 0
----- stderr -----
✓ Created new worktree for feature from main @ _REPO_.feature
↳ Run wt config shell install to enable automatic cd
-◎ Running project post-start:
+◎ Running post-start project hook:
  echo 'unclosed quote
diff --git a/tests/snapshots/integration__integration_tests__post_start_commands__post_start_log_captures_output.snap b/tests/snapshots/integration__integration_tests__post_start_commands__post_start_log_captures_output.snap
index bdf92d2bc..e60c54ee6 100644
--- a/tests/snapshots/integration__integration_tests__post_start_commands__post_start_log_captures_output.snap
+++ b/tests/snapshots/integration__integration_tests__post_start_commands__post_start_log_captures_output.snap
@@ -33,5 +33,5 @@ exit_code: 0
----- stderr -----
✓ Created new worktree for feature from main @ _REPO_.feature
↳ Run wt config shell install to enable automatic cd
-◎ Running project post-start:
+◎ Running post-start project hook:
  echo 'stdout output' && echo 'stderr output' >&2
diff --git a/tests/snapshots/integration__integration_tests__post_start_commands__post_start_multiline_with_newlines.snap b/tests/snapshots/integration__integration_tests__post_start_commands__post_start_multiline_with_newlines.snap
index ee568d6ea..a58304a71 100644
--- a/tests/snapshots/integration__integration_tests__post_start_commands__post_start_multiline_with_newlines.snap
+++ b/tests/snapshots/integration__integration_tests__post_start_commands__post_start_multiline_with_newlines.snap
@@ -33,7 +33,7 @@ exit_code: 0
----- stderr -----
✓ Created new worktree for feature from main @ _REPO_.feature
↳ Run wt config shell install to enable automatic cd
-◎ Running project post-start:
+◎ Running post-start project hook:
  echo 'first line' > multiline.txt
  echo 'second line' >> multiline.txt
  echo 'third line' >> multiline.txt
diff --git a/tests/snapshots/integration__integration_tests__post_start_commands__post_start_multiple_background.snap b/tests/snapshots/integration__integration_tests__post_start_commands__post_start_multiple_background.snap
index fdb6347e2..22cd57516 100644
--- a/tests/snapshots/integration__integration_tests__post_start_commands__post_start_multiple_background.snap
+++ b/tests/snapshots/integration__integration_tests__post_start_commands__post_start_multiple_background.snap
@@ -33,7 +33,7 @@ exit_code: 0
----- stderr -----
✓ Created new worktree for feature from main @ _REPO_.feature
↳ Run wt config shell install to enable automatic cd
-◎ Running project post-start task1:
+◎ Running post-start project:task1:
  echo 'Task 1 running' > task1.txt
-◎ Running project post-start task2:
+◎ Running post-start project:task2:
  echo 'Task 2 running' > task2.txt
diff --git a/tests/snapshots/integration__integration_tests__post_start_commands__post_start_separate_logs.snap b/tests/snapshots/integration__integration_tests__post_start_commands__post_start_separate_logs.snap
index fed639a0b..184548a9a 100644
--- a/tests/snapshots/integration__integration_tests__post_start_commands__post_start_separate_logs.snap
+++ b/tests/snapshots/integration__integration_tests__post_start_commands__post_start_separate_logs.snap
@@ -33,9 +33,9 @@ exit_code: 0
----- stderr -----
✓ Created new worktree for feature from main @ _REPO_.feature
↳ Run wt config shell install to enable automatic cd
-◎ Running project post-start task1:
+◎ Running post-start project:task1:
  echo 'TASK1_OUTPUT'
-◎ Running project post-start task2:
+◎ Running post-start project:task2:
  echo 'TASK2_OUTPUT'
-◎ Running project post-start task3:
+◎ Running post-start project:task3:
  echo 'TASK3_OUTPUT'
diff --git a/tests/snapshots/integration__integration_tests__post_start_commands__post_start_single_background.snap b/tests/snapshots/integration__integration_tests__post_start_commands__post_start_single_background.snap
index 92cd4bac3..bef471213 100644
--- a/tests/snapshots/integration__integration_tests__post_start_commands__post_start_single_background.snap
+++ b/tests/snapshots/integration__integration_tests__post_start_commands__post_start_single_background.snap
@@ -33,5 +33,5 @@ exit_code: 0
----- stderr -----
✓ Created new worktree for feature from main @ _REPO_.feature
↳ Run wt config shell install to enable automatic cd
-◎ Running project post-start:
+◎ Running post-start project hook:
  sleep 0.1 && echo 'Background task done' > background.txt
diff --git a/tests/snapshots/integration__integration_tests__remove__pre_remove_hook_executes.snap b/tests/snapshots/integration__integration_tests__remove__pre_remove_hook_executes.snap
index 6e88d8a2d..233729475 100644
--- a/tests/snapshots/integration__integration_tests__remove__pre_remove_hook_executes.snap
+++ b/tests/snapshots/integration__integration_tests__remove__pre_remove_hook_executes.snap
@@ -32,7 +32,7 @@ exit_code: 0
----- stderr -----
◎ Removing feature-hook worktree...
-◎ Running project pre-remove:
+◎ Running pre-remove project hook:
  echo 'About to remove worktree'
About to remove worktree
✓ Removed feature-hook worktree & branch (same commit as main, _)
diff --git a/tests/snapshots/integration__integration_tests__remove__pre_remove_hook_failure_aborts.snap b/tests/snapshots/integration__integration_tests__remove__pre_remove_hook_failure_aborts.snap
index 0a35fe14d..4fa6c676d 100644
--- a/tests/snapshots/integration__integration_tests__remove__pre_remove_hook_failure_aborts.snap
+++ b/tests/snapshots/integration__integration_tests__remove__pre_remove_hook_failure_aborts.snap
@@ -32,7 +32,7 @@ exit_code: 1
----- stderr -----
◎ Removing feature-fail worktree...
-◎ Running project pre-remove:
+◎ Running pre-remove project hook:
  exit 1
✗ pre-remove command failed: exit status: 1
↳ To skip pre-remove hooks, re-run with --no-verify
diff --git a/tests/snapshots/integration__integration_tests__remove__pre_remove_hook_runs_for_detached_head.snap b/tests/snapshots/integration__integration_tests__remove__pre_remove_hook_runs_for_detached_head.snap
index 210d12872..ddb9f2736 100644
--- a/tests/snapshots/integration__integration_tests__remove__pre_remove_hook_runs_for_detached_head.snap
+++ b/tests/snapshots/integration__integration_tests__remove__pre_remove_hook_runs_for_detached_head.snap
@@ -31,6 +31,6 @@ exit_code: 0
----- stderr -----
◎ Removing current worktree...
-◎ Running project pre-remove:
+◎ Running pre-remove project hook:
  touch _REPO_/m.txt
✓ Removed worktree (detached HEAD, no branch to delete)
diff --git a/tests/snapshots/integration__integration_tests__remove__pre_remove_hook_runs_for_detached_head_background.snap b/tests/snapshots/integration__integration_tests__remove__pre_remove_hook_runs_for_detached_head_background.snap
index fafaedbfd..286a58465 100644
--- a/tests/snapshots/integration__integration_tests__remove__pre_remove_hook_runs_for_detached_head_background.snap
+++ b/tests/snapshots/integration__integration_tests__remove__pre_remove_hook_runs_for_detached_head_background.snap
@@ -29,6 +29,6 @@ exit_code: 0
----- stdout -----
----- stderr -----
-◎ Running project pre-remove:
+◎ Running pre-remove project hook:
  touch _REPO_/detached-bg-hook-marker.txt
◎ Removing worktree in background (detached HEAD, no branch to delete)
diff --git a/tests/snapshots/integration__integration_tests__remove__pre_remove_hook_template_variables.snap b/tests/snapshots/integration__integration_tests__remove__pre_remove_hook_template_variables.snap
index c69378993..0da671953 100644
--- a/tests/snapshots/integration__integration_tests__remove__pre_remove_hook_template_variables.snap
+++ b/tests/snapshots/integration__integration_tests__remove__pre_remove_hook_template_variables.snap
@@ -32,13 +32,13 @@ exit_code: 0
----- stderr -----
◎ Removing feature-templates worktree...
-◎ Running project pre-remove branch:
+◎ Running pre-remove project:branch:
  echo 'Branch: feature-templates'
Branch: feature-templates
-◎ Running project pre-remove worktree:
+◎ Running pre-remove project:worktree:
  echo 'Worktree: _REPO_.feature-templates'
Worktree: _REPO_.feature-templates
-◎ Running project pre-remove worktree_name:
+◎ Running pre-remove project:worktree_name:
  echo 'Name: repo.feature-templates'
Name: repo.feature-templates
✓ Removed feature-templates worktree & branch (same commit as main, _)
diff --git a/tests/snapshots/integration__integration_tests__user_hooks__user_and_project_post_start.snap b/tests/snapshots/integration__integration_tests__user_hooks__user_and_project_post_start.snap
index 52d9cee97..95009da5a 100644
--- a/tests/snapshots/integration__integration_tests__user_hooks__user_and_project_post_start.snap
+++ b/tests/snapshots/integration__integration_tests__user_hooks__user_and_project_post_start.snap
@@ -33,7 +33,7 @@ exit_code: 0
----- stderr -----
✓ Created new worktree for feature from main @ _REPO_.feature
↳ Run wt config shell install to enable automatic cd
-◎ Running user post-start bg:
+◎ Running post-start user:bg:
  echo 'USER_POST_START' > user_bg.txt
-◎ Running project post-start:
+◎ Running post-start project hook:
  echo 'PROJECT_POST_START' > project_bg.txt
diff --git a/tests/snapshots/integration__integration_tests__user_hooks__user_hook_template_vars.snap b/tests/snapshots/integration__integration_tests__user_hooks__user_hook_template_vars.snap
index 8f933bdd2..c7b2fb305 100644
--- a/tests/snapshots/integration__integration_tests__user_hooks__user_hook_template_vars.snap
+++ b/tests/snapshots/integration__integration_tests__user_hooks__user_hook_template_vars.snap
@@ -31,7 +31,7 @@ exit_code: 0
----- stdout -----
----- stderr -----
-◎ Running user post-create vars:
+◎ Running post-create user:vars:
  echo 'repo=repo branch=feature' > template_vars.txt
✓ Created new worktree for feature from main @ _REPO_.feature
↳ Run wt config shell install to enable automatic cd
diff --git a/tests/snapshots/integration__integration_tests__user_hooks__user_hooks_before_project.snap b/tests/snapshots/integration__integration_tests__user_hooks__user_hooks_before_project.snap
index aa4a45642..36a4d9ca4 100644
--- a/tests/snapshots/integration__integration_tests__user_hooks__user_hooks_before_project.snap
+++ b/tests/snapshots/integration__integration_tests__user_hooks__user_hooks_before_project.snap
@@ -31,9 +31,9 @@ exit_code: 0
----- stdout -----
----- stderr -----
-◎ Running user post-create log:
+◎ Running post-create user:log:
  echo 'USER_HOOK' >> hook_order.txt
-◎ Running project post-create:
+◎ Running post-create project hook:
  echo 'PROJECT_HOOK' >> hook_order.txt
✓ Created new worktree for feature from main @ _REPO_.feature
↳ Run wt config shell install to enable automatic cd
diff --git a/tests/snapshots/integration__integration_tests__user_hooks__user_hooks_no_approval.snap b/tests/snapshots/integration__integration_tests__user_hooks__user_hooks_no_approval.snap
index fdbb83cb0..04399e445 100644
--- a/tests/snapshots/integration__integration_tests__user_hooks__user_hooks_no_approval.snap
+++ b/tests/snapshots/integration__integration_tests__user_hooks__user_hooks_no_approval.snap
@@ -31,7 +31,7 @@ exit_code: 0
----- stdout -----
----- stderr -----
-◎ Running user post-create setup:
+◎ Running post-create user:setup:
  echo 'NO_APPROVAL_NEEDED' > no_approval.txt
✓ Created new worktree for feature from main @ _REPO_.feature
↳ Run wt config shell install to enable automatic cd
diff --git a/tests/snapshots/integration__integration_tests__user_hooks__user_post_create_executes.snap b/tests/snapshots/integration__integration_tests__user_hooks__user_post_create_executes.snap
index 5eb847663..6a8e01aed 100644
--- a/tests/snapshots/integration__integration_tests__user_hooks__user_post_create_executes.snap
+++ b/tests/snapshots/integration__integration_tests__user_hooks__user_post_create_executes.snap
@@ -31,7 +31,7 @@ exit_code: 0
----- stdout -----
----- stderr -----
-◎ Running user post-create log:
+◎ Running post-create user:log:
  echo 'USER_POST_CREATE_RAN' > user_hook_marker.txt
✓ Created new worktree for feature from main @ _REPO_.feature
↳ Run wt config shell install to enable automatic cd
diff --git a/tests/snapshots/integration__integration_tests__user_hooks__user_post_create_failure.snap b/tests/snapshots/integration__integration_tests__user_hooks__user_post_create_failure.snap
index 489657972..2c4e3d4e7 100644
--- a/tests/snapshots/integration__integration_tests__user_hooks__user_post_create_failure.snap
+++ b/tests/snapshots/integration__integration_tests__user_hooks__user_post_create_failure.snap
@@ -31,7 +31,7 @@ exit_code: 0
----- stdout -----
----- stderr -----
-◎ Running user post-create failing:
+◎ Running post-create user:failing:
  exit 1
▲ Command failing failed: exit status: 1
✓ Created new worktree for feature from main @ _REPO_.feature
diff --git a/tests/snapshots/integration__integration_tests__user_hooks__user_post_merge_executes.snap b/tests/snapshots/integration__integration_tests__user_hooks__user_post_merge_executes.snap
index 4050cd45a..f79f39d9c 100644
--- a/tests/snapshots/integration__integration_tests__user_hooks__user_post_merge_executes.snap
+++ b/tests/snapshots/integration__integration_tests__user_hooks__user_post_merge_executes.snap
@@ -38,5 +38,5 @@ exit_code: 0
  1 file changed, 1 insertion(+)
✓ Merged to main (1 commit, 1 file, +1)
○ Worktree preserved (--no-remove)
-◎ Running user post-merge notify:
+◎ Running post-merge user:notify:
  echo 'USER_POST_MERGE_RAN' > user_postmerge.txt
diff --git a/tests/snapshots/integration__integration_tests__user_hooks__user_post_start_executes.snap b/tests/snapshots/integration__integration_tests__user_hooks__user_post_start_executes.snap
index 159fec153..5f2fdd262 100644
--- a/tests/snapshots/integration__integration_tests__user_hooks__user_post_start_executes.snap
+++ b/tests/snapshots/integration__integration_tests__user_hooks__user_post_start_executes.snap
@@ -33,5 +33,5 @@ exit_code: 0
----- stderr -----
✓ Created new worktree for feature from main @ _REPO_.feature
↳ Run wt config shell install to enable automatic cd
-◎ Running user post-start bg:
+◎ Running post-start user:bg:
  echo 'USER_POST_START_RAN' > user_bg_marker.txt
diff --git a/tests/snapshots/integration__integration_tests__user_hooks__user_pre_commit_executes.snap b/tests/snapshots/integration__integration_tests__user_hooks__user_pre_commit_executes.snap
index 15138dc71..6dbcaaf30 100644
--- a/tests/snapshots/integration__integration_tests__user_hooks__user_pre_commit_executes.snap
+++ b/tests/snapshots/integration__integration_tests__user_hooks__user_pre_commit_executes.snap
@@ -34,7 +34,7 @@ exit_code: 0
----- stderr -----
▲ Auto-staging 1 untracked path:
  uncommitted.txt
-◎ Running user pre-commit lint:
+◎ Running pre-commit user:lint:
  echo 'USER_PRE_COMMIT_RAN' > user_precommit.txt
◎ Committing changes with default message... (1 file, +1, no squashing needed)
↳ Using fallback commit message. Run wt config --help for LLM setup guide
diff --git a/tests/snapshots/integration__integration_tests__user_hooks__user_pre_commit_failure.snap b/tests/snapshots/integration__integration_tests__user_hooks__user_pre_commit_failure.snap
index c45a2db0c..810212966 100644
--- a/tests/snapshots/integration__integration_tests__user_hooks__user_pre_commit_failure.snap
+++ b/tests/snapshots/integration__integration_tests__user_hooks__user_pre_commit_failure.snap
@@ -34,7 +34,7 @@ exit_code: 1
----- stderr -----
▲ Auto-staging 1 untracked path:
  uncommitted.txt
-◎ Running user pre-commit lint:
+◎ Running pre-commit user:lint:
  exit 1
✗ pre-commit command failed: lint: exit status: 1
↳ To skip pre-commit hooks, re-run with --no-verify
diff --git a/tests/snapshots/integration__integration_tests__user_hooks__user_pre_merge_executes.snap b/tests/snapshots/integration__integration_tests__user_hooks__user_pre_merge_executes.snap
index 2ea9de72b..9336dfcb5 100644
--- a/tests/snapshots/integration__integration_tests__user_hooks__user_pre_merge_executes.snap
+++ b/tests/snapshots/integration__integration_tests__user_hooks__user_pre_merge_executes.snap
@@ -32,7 +32,7 @@ exit_code: 0
----- stdout -----
----- stderr -----
-◎ Running user pre-merge check:
+◎ Running pre-merge user:check:
  echo 'USER_PRE_MERGE_RAN' > user_premerge.txt
◎ Merging 1 commit to main @ d233817 (no commit/squash/rebase needed)
  * d233817 Add feature
diff --git a/tests/snapshots/integration__integration_tests__user_hooks__user_pre_merge_failure.snap b/tests/snapshots/integration__integration_tests__user_hooks__user_pre_merge_failure.snap
index 078d2c992..421e930cb 100644
--- a/tests/snapshots/integration__integration_tests__user_hooks__user_pre_merge_failure.snap
+++ b/tests/snapshots/integration__integration_tests__user_hooks__user_pre_merge_failure.snap
@@ -32,7 +32,7 @@ exit_code: 1
----- stdout -----
----- stderr -----
-◎ Running user pre-merge check:
+◎ Running pre-merge user:check:
  exit 1
✗ pre-merge command failed: check: exit status: 1
↳ To skip pre-merge hooks, re-run with --no-verify
diff --git a/tests/snapshots/integration__integration_tests__user_hooks__user_pre_remove_executes.snap b/tests/snapshots/integration__integration_tests__user_hooks__user_pre_remove_executes.snap
index 57886adc5..cd6ed3337 100644
--- a/tests/snapshots/integration__integration_tests__user_hooks__user_pre_remove_executes.snap
+++ b/tests/snapshots/integration__integration_tests__user_hooks__user_pre_remove_executes.snap
@@ -31,6 +31,6 @@ exit_code: 0
----- stdout -----
----- stderr -----
-◎ Running user pre-remove cleanup:
+◎ Running pre-remove user:cleanup:
  echo 'USER_PRE_REMOVE_RAN' > ../user_preremove_marker.txt
◎ Removing feature worktree & branch in background (--force-delete)
diff --git a/tests/snapshots/integration__integration_tests__user_hooks__user_pre_remove_failure.snap b/tests/snapshots/integration__integration_tests__user_hooks__user_pre_remove_failure.snap
index a784b6d4a..462044436 100644
--- a/tests/snapshots/integration__integration_tests__user_hooks__user_pre_remove_failure.snap
+++ b/tests/snapshots/integration__integration_tests__user_hooks__user_pre_remove_failure.snap
@@ -31,7 +31,7 @@ exit_code: 1
----- stdout -----
----- stderr -----
-◎ Running user pre-remove block:
+◎ Running pre-remove user:block:
  exit 1
✗ pre-remove command failed: block: exit status: 1
↳ To skip pre-remove hooks, re-run with --no-verify