Skip to content

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

feat(step): add require-include option + CLI flags to copy-ignored (#3196)

Zexin Yuan6fc6b37b6b5b
diff --git a/docs/content/step.md b/docs/content/step.md
index 59c53ce8d..69952b0f3 100644
--- a/docs/content/step.md
+++ b/docs/content/step.md
@@ -393,6 +393,14 @@ After `.worktreeinclude` selects entries, you can add more gitignore-style exclu
exclude = [".cache/", ".turbo/"]
```
+To copy nothing unless `.worktreeinclude` exists — matching Claude Code desktop, where the file is required — pass `--require-include`:
+
+```bash
+wt step copy-ignored --require-include
+```
+
+Without `.worktreeinclude`, the command is a no-op (it reports that nothing was copied and why). With the file present, only matching files copy as above. To apply this across every repository, put the flag in a user-config hook: `post-start = "wt step copy-ignored --require-include"`.
+
### Common patterns
| Type | Patterns |
@@ -452,7 +460,7 @@ Virtual environments contain absolute paths and can't be copied. Use `uv sync` i
The `.worktreeinclude` pattern is shared with [Claude Code on desktop](https://code.claude.com/docs/en/desktop), which copies matching files when creating worktrees. Differences:
-- worktrunk copies all gitignored files by default; Claude Code requires `.worktreeinclude`
+- worktrunk copies all gitignored files by default; Claude Code requires `.worktreeinclude`. Pass `--require-include` to match Claude Code (copy nothing without `.worktreeinclude`)
- worktrunk uses copy-on-write for large directories like `target/` — potentially 30x faster on macOS, 6x on Linux
- worktrunk runs as a configurable hook in the worktree lifecycle
@@ -482,6 +490,9 @@ Usage: <b><span class=c>wt step copy-ignored</span></b> <span class=c>[OPTIONS]<
<b><span class=c>--force</span></b>
Overwrite existing files in destination
+ <b><span class=c>--require-include</span></b>
+ Require .worktreeinclude to copy anything
+
<b><span class=c>-h</span></b>, <b><span class=c>--help</span></b>
Print help (see a summary with &#39;-h&#39;)
diff --git a/skills/worktrunk/reference/step.md b/skills/worktrunk/reference/step.md
index cdaa39709..1d96d303f 100644
--- a/skills/worktrunk/reference/step.md
+++ b/skills/worktrunk/reference/step.md
@@ -404,6 +404,14 @@ After `.worktreeinclude` selects entries, you can add more gitignore-style exclu
exclude = [".cache/", ".turbo/"]
```
+To copy nothing unless `.worktreeinclude` exists — matching Claude Code desktop, where the file is required — pass `--require-include`:
+
+```bash
+wt step copy-ignored --require-include
+```
+
+Without `.worktreeinclude`, the command is a no-op (it reports that nothing was copied and why). With the file present, only matching files copy as above. To apply this across every repository, put the flag in a user-config hook: `post-start = "wt step copy-ignored --require-include"`.
+
### Common patterns
| Type | Patterns |
@@ -463,7 +471,7 @@ Virtual environments contain absolute paths and can't be copied. Use `uv sync` i
The `.worktreeinclude` pattern is shared with [Claude Code on desktop](https://code.claude.com/docs/en/desktop), which copies matching files when creating worktrees. Differences:
-- worktrunk copies all gitignored files by default; Claude Code requires `.worktreeinclude`
+- worktrunk copies all gitignored files by default; Claude Code requires `.worktreeinclude`. Pass `--require-include` to match Claude Code (copy nothing without `.worktreeinclude`)
- worktrunk uses copy-on-write for large directories like `target/` — potentially 30x faster on macOS, 6x on Linux
- worktrunk runs as a configurable hook in the worktree lifecycle
@@ -493,6 +501,9 @@ Options:
--force
Overwrite existing files in destination
+ --require-include
+ Require .worktreeinclude to copy anything
+
-h, --help
Print help (see a summary with '-h')
diff --git a/src/cli/step.rs b/src/cli/step.rs
index 130976a5e..c3d474cb9 100644
--- a/src/cli/step.rs
+++ b/src/cli/step.rs
@@ -305,6 +305,14 @@ After `.worktreeinclude` selects entries, you can add more gitignore-style exclu
exclude = [".cache/", ".turbo/"]
```
+To copy nothing unless `.worktreeinclude` exists — matching Claude Code desktop, where the file is required — pass `--require-include`:
+
+```console
+wt step copy-ignored --require-include
+```
+
+Without `.worktreeinclude`, the command is a no-op (it reports that nothing was copied and why). With the file present, only matching files copy as above. To apply this across every repository, put the flag in a user-config hook: `post-start = "wt step copy-ignored --require-include"`.
+
## Common patterns
| Type | Patterns |
@@ -364,7 +372,7 @@ Virtual environments contain absolute paths and can't be copied. Use `uv sync` i
The `.worktreeinclude` pattern is shared with [Claude Code on desktop](https://code.claude.com/docs/en/desktop), which copies matching files when creating worktrees. Differences:
-- worktrunk copies all gitignored files by default; Claude Code requires `.worktreeinclude`
+- worktrunk copies all gitignored files by default; Claude Code requires `.worktreeinclude`. Pass `--require-include` to match Claude Code (copy nothing without `.worktreeinclude`)
- worktrunk uses copy-on-write for large directories like `target/` — potentially 30x faster on macOS, 6x on Linux
- worktrunk runs as a configurable hook in the worktree lifecycle
"#)]
@@ -389,6 +397,10 @@ The `.worktreeinclude` pattern is shared with [Claude Code on desktop](https://c
#[arg(long)]
force: bool,
+ /// Require .worktreeinclude to copy anything
+ #[arg(long)]
+ require_include: bool,
+
/// Output format
///
/// JSON prints structured result to stdout after the copy completes.
diff --git a/src/commands/step/copy_ignored.rs b/src/commands/step/copy_ignored.rs
index 72ff519ab..9551b26b8 100644
--- a/src/commands/step/copy_ignored.rs
+++ b/src/commands/step/copy_ignored.rs
@@ -4,12 +4,13 @@ use std::fs;
use std::path::PathBuf;
use anyhow::Context;
+use color_print::cformat;
use worktrunk::copy::{copy_dir_recursive, copy_leaf};
use worktrunk::git::Repository;
use worktrunk::path::format_path_for_display;
use worktrunk::progress::{Progress, format_bytes};
use worktrunk::styling::{
- eprintln, format_with_gutter, info_message, println, success_message, verbosity,
+ eprintln, format_with_gutter, hint_message, info_message, println, success_message, verbosity,
};
use super::shared::{list_and_filter_ignored_entries, resolve_copy_ignored_config};
@@ -26,6 +27,7 @@ pub fn step_copy_ignored(
to: Option<&str>,
dry_run: bool,
force: bool,
+ require_include: bool,
format: crate::cli::SwitchFormat,
) -> anyhow::Result<()> {
// Self-lower only when we're running inside a background hook pipeline
@@ -100,6 +102,41 @@ pub fn step_copy_ignored(
.iter()
.map(|wt| wt.path.clone())
.collect();
+
+ // `--require-include` gate: when passed, copy nothing unless a
+ // `.worktreeinclude` file exists in the source worktree. Checked before
+ // discovery so the `git ls-files --ignored` traversal is skipped entirely
+ // when nothing copies.
+ if require_include && !source_path.join(".worktreeinclude").exists() {
+ if json_mode {
+ let payload = serde_json::json!({
+ "outcome": if dry_run { "planned" } else { "copied" },
+ "dry_run": dry_run,
+ "from": source_path,
+ "to": dest_path,
+ "reason": "require-include-no-worktreeinclude",
+ "entries": Vec::<serde_json::Value>::new(),
+ "files": 0,
+ "bytes": 0,
+ });
+ println!("{}", serde_json::to_string_pretty(&payload)?);
+ } else {
+ eprintln!(
+ "{}",
+ info_message(cformat!(
+ "Nothing copied — <bold>--require-include</> was passed but no <bold>.worktreeinclude</> exists"
+ ))
+ );
+ eprintln!(
+ "{}",
+ hint_message(cformat!(
+ "Add a <underline>.worktreeinclude</> to select files, or drop <underline>--require-include</> to copy everything"
+ ))
+ );
+ }
+ return Ok(());
+ }
+
let entries_to_copy = list_and_filter_ignored_entries(
&source_path,
&source_context,
diff --git a/src/main.rs b/src/main.rs
index 415ba94d3..7913f5b6c 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -364,8 +364,16 @@ fn handle_step_command(
to,
dry_run,
force,
+ require_include,
format,
- } => step_copy_ignored(from.as_deref(), to.as_deref(), dry_run, force, format),
+ } => step_copy_ignored(
+ from.as_deref(),
+ to.as_deref(),
+ dry_run,
+ force,
+ require_include,
+ format,
+ ),
StepCommand::Eval { template, format } => step_eval(&template, format),
StepCommand::ForEach { format, args } => step_for_each(args, format),
StepCommand::Promote { branch } => {
diff --git a/tests/integration_tests/help.rs b/tests/integration_tests/help.rs
index 7f0486287..31d6fdef9 100644
--- a/tests/integration_tests/help.rs
+++ b/tests/integration_tests/help.rs
@@ -73,6 +73,7 @@ fn snapshot_help(test_name: &str, args: &[&str]) {
#[case("help_step_short", "step -h")]
#[case("help_step_long", "step --help")]
#[case("help_step_promote", "step promote --help")]
+#[case("help_step_copy_ignored", "step copy-ignored --help")]
// Config subcommands (long help only - these are less frequently accessed)
#[case("help_config_shell", "config shell --help")]
#[case("help_config_create", "config create --help")]
diff --git a/tests/integration_tests/step_copy_ignored.rs b/tests/integration_tests/step_copy_ignored.rs
index f54c645e8..068cf4dc8 100644
--- a/tests/integration_tests/step_copy_ignored.rs
+++ b/tests/integration_tests/step_copy_ignored.rs
@@ -1744,3 +1744,125 @@ fn test_copy_ignored_no_matches_json(mut repo: TestRepo) {
0
);
}
+
+// ============================================================================
+// --require-include flag
+// ============================================================================
+
+/// `--require-include` with no `.worktreeinclude` copies nothing and explains
+/// why (text mode). The recovery hint names the flag to drop, not a config key.
+#[rstest]
+fn test_copy_ignored_require_include_gates_and_hint(mut repo: TestRepo) {
+ let feature_path = repo.add_worktree("feature");
+ fs::write(repo.root_path().join(".env"), "SECRET=value").unwrap();
+ fs::write(repo.root_path().join(".gitignore"), ".env\n").unwrap();
+
+ let output = repo
+ .wt_command()
+ .args(["step", "copy-ignored", "--require-include"])
+ .current_dir(&feature_path)
+ .output()
+ .unwrap();
+ assert!(
+ output.status.success(),
+ "copy-ignored should succeed: {}",
+ String::from_utf8_lossy(&output.stderr)
+ );
+ let stderr = String::from_utf8_lossy(&output.stderr);
+ assert!(
+ stderr.contains("--require-include"),
+ "stderr should explain the --require-include gate: {stderr}"
+ );
+ assert!(
+ !feature_path.join(".env").exists(),
+ "--require-include with no .worktreeinclude copies nothing"
+ );
+}
+
+/// The `--require-include` gate surfaces a machine-readable `reason` in JSON mode.
+#[rstest]
+fn test_copy_ignored_require_include_json_reason(mut repo: TestRepo) {
+ let feature_path = repo.add_worktree("feature");
+ fs::write(repo.root_path().join(".env"), "SECRET=value").unwrap();
+ fs::write(repo.root_path().join(".gitignore"), ".env\n").unwrap();
+
+ let output = repo
+ .wt_command()
+ .args(["step", "copy-ignored", "--require-include", "--format=json"])
+ .current_dir(&feature_path)
+ .output()
+ .unwrap();
+ assert!(output.status.success());
+ let parsed: serde_json::Value =
+ serde_json::from_str(&String::from_utf8_lossy(&output.stdout)).expect("valid JSON");
+ assert_eq!(parsed["reason"], "require-include-no-worktreeinclude");
+ assert_eq!(parsed["files"], 0);
+ assert!(!feature_path.join(".env").exists());
+}
+
+/// With `.worktreeinclude` present, `--require-include` does not gate — matching
+/// files copy as usual (the flag doesn't bypass the include filter).
+#[rstest]
+fn test_copy_ignored_require_include_with_worktreeinclude(mut repo: TestRepo) {
+ let feature_path = repo.add_worktree("feature");
+ fs::write(repo.root_path().join(".env"), "SECRET=value").unwrap();
+ fs::write(repo.root_path().join(".gitignore"), ".env\n").unwrap();
+ fs::write(repo.root_path().join(".worktreeinclude"), ".env\n").unwrap();
+
+ let output = repo
+ .wt_command()
+ .args(["step", "copy-ignored", "--require-include"])
+ .current_dir(&feature_path)
+ .output()
+ .unwrap();
+ assert!(output.status.success());
+ assert!(
+ feature_path.join(".env").exists(),
+ ".env should copy when --require-include is set and .worktreeinclude matches it"
+ );
+}
+
+/// The gate checks the SOURCE worktree for `.worktreeinclude`, not the
+/// destination. Here only the destination has the file.
+#[rstest]
+fn test_copy_ignored_require_include_checks_source(mut repo: TestRepo) {
+ let feature_path = repo.add_worktree("feature");
+ fs::write(repo.root_path().join(".env"), "SECRET=value").unwrap();
+ fs::write(repo.root_path().join(".gitignore"), ".env\n").unwrap();
+ // `.worktreeinclude` in the DESTINATION only — source (main) lacks it.
+ fs::write(feature_path.join(".worktreeinclude"), ".env\n").unwrap();
+
+ let output = repo
+ .wt_command()
+ .args(["step", "copy-ignored", "--require-include"])
+ .current_dir(&feature_path)
+ .output()
+ .unwrap();
+ assert!(output.status.success());
+ assert!(
+ !feature_path.join(".env").exists(),
+ "source has no .worktreeinclude — gate fires regardless of destination"
+ );
+}
+
+/// An empty `.worktreeinclude` is present (gate passes) but matches nothing,
+/// so nothing copies — distinct from the missing-file gate case.
+#[rstest]
+fn test_copy_ignored_require_include_empty_worktreeinclude(mut repo: TestRepo) {
+ let feature_path = repo.add_worktree("feature");
+ fs::write(repo.root_path().join(".env"), "SECRET=value").unwrap();
+ fs::write(repo.root_path().join(".gitignore"), ".env\n").unwrap();
+ fs::write(repo.root_path().join(".worktreeinclude"), "").unwrap();
+
+ let output = repo
+ .wt_command()
+ .args(["step", "copy-ignored", "--require-include"])
+ .current_dir(&feature_path)
+ .output()
+ .unwrap();
+ assert!(output.status.success());
+ assert!(
+ !feature_path.join(".env").exists(),
+ "empty .worktreeinclude matches nothing — nothing copied"
+ );
+}
diff --git a/tests/integration_tests/step_promote.rs b/tests/integration_tests/step_promote.rs
index 897e42d1e..2eb884cbc 100644
--- a/tests/integration_tests/step_promote.rs
+++ b/tests/integration_tests/step_promote.rs
@@ -477,6 +477,54 @@ fn test_promote_swap_only_main_has_ignored(mut repo: TestRepo) {
);
}
+/// `require-include` must not affect `wt step promote` — promote swaps all
+/// gitignored artifacts between worktrees by design and ignores copy-ignored
+/// config. Regression guard for the require-include feature.
+#[rstest]
+fn test_promote_swap_ignores_require_include(mut repo: TestRepo) {
+ let feature_path = repo.add_worktree("feature");
+
+ let gitignore = "build/\n*.log\n";
+ commit_gitignore(&repo, repo.root_path(), gitignore);
+ commit_gitignore(&repo, &feature_path, gitignore);
+
+ // require-include is set via CLI override, but promote must still swap
+ // ignored files — it never reads copy-ignored config. Using --config-set
+ // avoids leaving an untracked .config/ that would itself block promote.
+ fs::create_dir_all(repo.root_path().join("build")).unwrap();
+ fs::write(repo.root_path().join("build/artifact"), "main artifact").unwrap();
+ fs::write(repo.root_path().join("app.log"), "main log").unwrap();
+
+ let output = repo
+ .wt_command()
+ .args([
+ "--config-set",
+ "step.copy-ignored.require-include=true",
+ "step",
+ "promote",
+ "feature",
+ ])
+ .output()
+ .unwrap();
+ assert!(
+ output.status.success(),
+ "{}",
+ String::from_utf8_lossy(&output.stderr)
+ );
+
+ // Ignored files still swapped to feature despite require-include.
+ assert!(!repo.root_path().join("build").exists());
+ assert!(!repo.root_path().join("app.log").exists());
+ assert_eq!(
+ fs::read_to_string(feature_path.join("build/artifact")).unwrap(),
+ "main artifact"
+ );
+ assert_eq!(
+ fs::read_to_string(feature_path.join("app.log")).unwrap(),
+ "main log"
+ );
+}
+
/// Only feature worktree has gitignored files — they should move to the main worktree
#[rstest]
fn test_promote_swap_only_feature_has_ignored(mut repo: TestRepo) {
diff --git a/tests/snapshots/integration__integration_tests__help__help_step_copy_ignored.snap b/tests/snapshots/integration__integration_tests__help__help_step_copy_ignored.snap
new file mode 100644
index 000000000..e92d231c7
--- /dev/null
+++ b/tests/snapshots/integration__integration_tests__help__help_step_copy_ignored.snap
@@ -0,0 +1,181 @@
+---
+source: tests/integration_tests/help.rs
+info:
+ program: wt
+ args:
+ - step
+ - copy-ignored
+ - "--help"
+ env:
+ CLICOLOR_FORCE: "1"
+ COLUMNS: "500"
+ LANG: C
+ LC_ALL: C
+ LLVM_PROFILE_FILE: "[LLVM_PROFILE_FILE]"
+ TERM: alacritty
+ WORKTRUNK_APPROVALS_PATH: "[TEST_APPROVALS]"
+ WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"
+ WORKTRUNK_SYSTEM_CONFIG_PATH: "[TEST_SYSTEM_CONFIG]"
+ WORKTRUNK_TEST_BASH_INSTALLED: "0"
+ WORKTRUNK_TEST_CLAUDE_INSTALLED: "0"
+ WORKTRUNK_TEST_CODEX_INSTALLED: "0"
+ WORKTRUNK_TEST_DELAYED_STREAM_MS: "-1"
+ WORKTRUNK_TEST_EPOCH: "1735776000"
+ WORKTRUNK_TEST_FISH_INSTALLED: "0"
+ WORKTRUNK_TEST_GEMINI_INSTALLED: "0"
+ WORKTRUNK_TEST_NUSHELL_ENV: "0"
+ WORKTRUNK_TEST_OPENCODE_INSTALLED: "0"
+ WORKTRUNK_TEST_POWERSHELL_ENV: "0"
+ WORKTRUNK_TEST_POWERSHELL_INSTALLED: "0"
+ WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
+ WORKTRUNK_TEST_ZSH_INSTALLED: "0"
+---
+success: true
+exit_code: 0
+----- stdout -----
+wt step copy-ignored - Copy gitignored files to another worktree
+
+Eliminates cold starts by copying build caches and dependencies.
+
+Usage: wt step copy-ignored [OPTIONS]
+
+Options:
+ --from <FROM>
+ Source worktree branch
+
+ Defaults to main worktree.
+
+ --to <TO>
+ Destination worktree branch
+
+ Defaults to current worktree.
+
+ --dry-run
+ Show what would be copied
+
+ --force
+ Overwrite existing files in destination
+
+ --require-include
+ Require .worktreeinclude to copy anything
+
+ -h, --help
+ Print help (see a summary with '-h')
+
+Automation:
+ --format <FORMAT>
+ Output format
+
+ JSON prints structured result to stdout after the copy completes.
+
+ [default: text]
+ [possible values: text, json]
+
+Global Options:
+ -C <path>
+ Working directory for this command
+
+ --config <path>
+ User config file path
+
+ --config-set <toml>
+ Override config with inline TOML, e.g. --config-set list.full=true (repeatable)
+
+ -v, --verbose...
+ Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug logs and raw subprocess output written to .git/wt/logs/). Set WORKTRUNK_VERBOSE=0|1|2 to apply the same level everywhere — including shell completion, which no flag can reach
+
+ -y, --yes
+ Skip approval prompts
+
+Setup
+
+Add to the project config:
+
+  # .config/wt.toml
+  [post-start]
+  copy = "wt step copy-ignored"
+
+What gets copied
+
+All gitignored files are copied by default, except for built-in excluded directories: VCS metadata (.bzr/, .hg/, .jj/, .pijul/, .sl/, .svn/) and tool-state (.conductor/, .entire/, .worktrees/). Tracked files are never touched.
+
+To limit what gets copied further, create .worktreeinclude with gitignore-style patterns. Files must be both gitignored and in .worktreeinclude:
+
+  # .worktreeinclude
+  .env
+  node_modules/
+  target/
+
+After .worktreeinclude selects entries, you can add more gitignore-style excludes in user config, per-project user overrides, or project config:
+
+  [step.copy-ignored]
+  exclude = [".cache/", ".turbo/"]
+
+To copy nothing unless .worktreeinclude exists — matching Claude Code desktop, where the file is required — pass --require-include:
+
+  wt step copy-ignored --require-include
+
+Without .worktreeinclude, the command is a no-op (it reports that nothing was copied and why). With the file present, only matching files copy as above. To apply this across every repository, put the flag in a user-config hook: post-start = "wt step copy-ignored --require-include".
+
+Common patterns
+
+ Type Patterns
+ ───────────────── ──────────────────────────────────────────────
+ Dependencies node_modules/, .venv/, target/, vendor/, Pods/
+ Build caches .cache/, .next/, .parcel-cache/, .turbo/
+ Generated assets Images, ML models, binaries too large for git
+ Environment files .env (if not generated per-worktree)
+
+Features
+
+- Uses copy-on-write (reflink) when available for space-efficient copies
+- Handles nested .gitignore files, global excludes, and .git/info/exclude
+- Skips existing files by default (safe to re-run)
+- --force overwrites existing files in the destination
+- Always skips built-in excluded directories — VCS metadata (.bzr/, .hg/, .jj/, .pijul/, .sl/, .svn/) and tool-state (.conductor/, .entire/, .worktrees/) — and nested worktrees
+
+Performance
+
+Reflink copies share disk blocks until modified — no data is actually copied. For a 14GB target/ directory:
+
+ Command Time
+ ───────────────────────────── ────
+ cp -R (full copy) 2m
+ cp -Rc / wt step copy-ignored 20s
+
+Uses per-file reflink (like cp -Rc) — copy time scales with file count.
+
+Use the post-start hook so the copy runs in the background. Use pre-start instead if subsequent hooks or --execute command need the copied files immediately.
+
+Background-hook priority (experimental)
+
+When invoked from a background hook pipeline (post-* hooks), wt step copy-ignored self-lowers its CPU and I/O priority — taskpolicy -b on macOS, nice -n 19 plus ionice -c 3 on Linux — so it yields to interactive work. Foreground callers (pre-* hooks, direct interactive use) run at normal priority so the user isn't waiting on a throttled copy.
+
+wt signals background-hook context by exporting WORKTRUNK_FOREGROUND=-1 into every detached hook pipeline; copy-ignored inspects that variable on entry. The variable name is experimental and may change.
+
+Language-specific notes
+
+Rust
+
+The target/ directory is huge (often 1-10GB). Copying with reflink cuts first build from ~68s to ~3s by reusing compiled dependencies.
+
+Node.js
+
+node_modules/ is large but mostly static. If the project has no native dependencies, symlinks are even faster:
+
+  [pre-start]
+  deps = "ln -sf {{ primary_worktree_path }}/node_modules ."
+
+Python
+
+Virtual environments contain absolute paths and can't be copied. Use uv sync instead — it's fast enough that copying isn't worth it.
+
+Behavior vs Claude Code on desktop
+
+The .worktreeinclude pattern is shared with Claude Code on desktop, which copies matching files when creating worktrees. Differences:
+
+- worktrunk copies all gitignored files by default; Claude Code requires .worktreeinclude. Pass --require-include to match Claude Code (copy nothing without .worktreeinclude)
+- worktrunk uses copy-on-write for large directories like target/ — potentially 30x faster on macOS, 6x on Linux
+- worktrunk runs as a configurable hook in the worktree lifecycle
+
+----- stderr -----