Skip to content

docs(faq): list the agent-integration files worktrunk writes outside its own config - #4036

Merged
max-sixty merged 3 commits into
mainfrom
nightly/clean-34092448184
Sep 7, 2026
Merged

max-sixty merged 3 commits into
mainfrom
nightly/clean-34092448184

Conversation

@worktrunk-bot

Copy link
Copy Markdown
Collaborator

CLAUDE.md names the FAQ's What files does Worktrunk create? and What can Worktrunk delete? as the full inventory of worktrunk's file surface, and tells reviewers to check new code against them. Neither section has ever covered wt config plugins <agent> install, so the inventory has been incomplete since the OpenCode plugin landed, and adding the Pi hook this week widened the gap.

The sections now carry an "Agent integrations" entry listing the three files worktrunk writes into another tool's config tree, and the "does NOT create" bullet — which read "No files outside .git/, config directories, worktree directories, or the system temporary directory" — now says which agent paths are the exception and that they are only touched when you run the install command. wt config plugins {opencode,pi} uninstall is added to the deletion list.

Nightly sweep finding; no linked issue.

What each claim is grounded in

Files worktrunk writes directly:

  • <opencode config dir>/plugins/worktrunk.ts — opencode_plugins_dir in src/commands/config/opencode.rs, precedence $OPENCODE_CONFIG_DIR > $XDG_CONFIG_HOME/opencode > ~/.config/opencode.
  • <pi agent dir>/hooks/pre/worktrunk.ts — pi_agent_dir / plugin_path in src/commands/config/pi.rs, honoring $PI_CONFIG_DIR, $OMP_PROFILE/$PI_PROFILE, and $PI_CODING_AGENT_DIR.
  • <claude config dir>/settings.json — handle_claude_install_statusline in src/commands/config/plugins.rs, which merges the statusLine key (command wt list statusline --format=claude-code) into the existing object rather than replacing the file, and writes through write_atomically — the same settings.json that CLAUDE.md's Data Safety section already names as a write_atomically target.

Files worktrunk does not write itself: wt config plugins claude install and codex install shell out to claude / codex, which record the marketplace and plugin in their own config (~/.claude/plugins/known_marketplaces.json and installed_plugins.json, read back by is_marketplace_configured / is_plugin_installed in show.rs; ~/.codex/config.toml's [marketplaces.*] tables, read by is_marketplace_configured in codex.rs). Gemini is left out — worktrunk has no install path for it, only a wt config show status line pointing at gemini extensions install.

The three faq.md copies stay in sync via test_docs_are_in_sync; the site page is primary and the two skill mirrors are generated.

No test: documentation only. cargo test --test integration test_docs_are_in_sync and test_plugin_layout_is_consolidated pass locally.

@worktrunk-bot worktrunk-bot added the nightly-cleanup Issues found by nightly code quality sweep label Sep 7, 2026

@worktrunk-bot worktrunk-bot left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

The new section checks out against the code — OpenCode's $OPENCODE_CONFIG_DIR > $XDG_CONFIG_HOME/opencode > ~/.config/opencode precedence, Pi's ~/.omp/agent/hooks/pre/worktrunk.ts with the PI_CODING_AGENT_DIR-only-on-default-profile caveat, claude_config_dir()'s $CLAUDE_CONFIG_DIR fallback to ~/.claude, the statusLine merge through write_atomically, and codex.rs only ever reading config.toml. uninstall_file_plugin removes exactly the worktrunk.ts path and nothing else, so the deletion bullet is right too. Gemini's omission is correct — there's no gemini variant on ConfigPluginsCommand.

One problem with the rewritten "does NOT create" bullet. Replacing the old generic "config directories" with "worktrunk's config directory" narrows the enumeration past what section 3 of this same FAQ documents: wt config shell install writes ~/.bashrc, ~/.zshrc (or $ZDOTDIR/.zshrc), ~/.config/fish/functions/wt.fish and completions/wt.fish, wt.nu under Nushell's vendor-autoload directory (which is under the data dir, not a config dir at all), and both PowerShell profiles under Documents/. As written the bullet now asserts worktrunk creates no files at any of those paths, which contradicts the section three headings above it. Since CLAUDE.md sends reviewers here as the full inventory, a false negative in the closing bullet is the same gap this PR is fixing, just moved.

Smaller point folded into the same suggestion: the bullet's exception is scoped to wt config plugins <agent> install, but the settings.json row in the table it points at is written by install-statusline, not install.

The two mirrors carry the identical line (skills/worktrunk/reference/faq.md:188, plugins/worktrunk/skills/worktrunk/reference/faq.md:188); cargo test --test integration test_docs_are_in_sync regenerates them from the primary.

Comment thread docs/src/content/docs/faq.md Outdated
@worktrunk-bot

Copy link
Copy Markdown
Collaborator Author

Both points were right — fixed in 0e5c113.

The bullet now reads: No files outside the five sections above: .git/, worktrunk's config directory, worktree directories, the shell startup files and wrapper paths of section 3, the agent config paths of section 5 (only when you run a wt config plugins install), and the system temporary directory.

That restores the shell-integration coverage the old generic "config directories" carried (including the Nushell wrapper, which sits under the data dir), and the parenthetical is scoped to "a wt config plugins install" rather than naming install specifically, since install-statusline is the one that writes settings.json.

@worktrunk-bot worktrunk-bot left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

The install / install-statusline fix landed in the bullet but not in the section-5 lead-in, and the rewritten bullet now miscounts the sections it points at. Two suggestions below, both on the primary; the two mirrors carry the identical lines (skills/worktrunk/reference/faq.md:168 and :188, same offsets under plugins/worktrunk/skills/), and cargo test --test integration test_docs_are_in_sync regenerates them.

Everything else in the new section re-verifies against the code: OpenCode's $OPENCODE_CONFIG_DIR > $XDG_CONFIG_HOME/opencode > ~/.config/opencode precedence, Pi's PI_CONFIG_DIR / profile / PI_CODING_AGENT_DIR resolution, claude_config_dir()'s $CLAUDE_CONFIG_DIR fallback, the statusLine merge through write_atomically, codex.rs only ever reading config.toml, and uninstall_file_plugin removing exactly the one worktrunk.ts path. InstallStatusline has no uninstall counterpart on ConfigPluginsClaudeCommand, so "the statusline entry is removed by editing settings.json" is right too.

Comment thread docs/src/content/docs/faq.md Outdated
Comment thread docs/src/content/docs/faq.md Outdated
@max-sixty
max-sixty merged commit 5a552b2 into main Sep 7, 2026
43 checks passed
@max-sixty
max-sixty deleted the nightly/clean-34092448184 branch September 7, 2026 16:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

nightly-cleanup Issues found by nightly code quality sweep

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants