allow LLM commit messages config in `wt.toml`
Configuring LLM commits can only be done globally, but I would love to have the option for setting this in the repo's wt.toml and this way have everyone on my team have the same commit prompt and use the same agent
https://worktrunk.dev/llm-commits/
Thanks for the suggestion. I searched the codebase to confirm: today [commit.generation] is part of UserConfig only (src/config/user/mod.rs field commit), and ProjectConfig doesn't include a commit section (src/config/project.rs) — so any [commit.generation] block in wt.toml is silently ignored.
A closely related request, #1413, asked for worktree-path in project config (also to share team defaults) and was closed without merging — the reasoning there was that local-environment knobs belong with the user. LLM commit settings sit on a different point of that spectrum since the prompt/template is closer to a team convention than to a filesystem layout, so it may warrant a separate decision.
I'll leave it for a maintainer to evaluate and prioritize.
-
We could add something to allow the project to specify preferences on the git message, would that be helpful? It would probably be appended to the user message.
-
There is a system-wide config file if you control your team's system files — @worktrunk-bot what's the exact path? maybe we make it a bit more prominent in the docs?
-
Adding the command to run to a project config is more perilous — it means we need to put it behind an approval; and I would think it's fairly rare that a project should specify what command is run to make a commit message. (Though I hear you re a single team that uses a private monorepo...)
-
You could add a alias that sets up someone's personal worktrunk config. @worktrunk-bot maybe you could give an example of how that might work?
System config path
wt config show prints the platform default; the lookup is in src/config/user/path.rs#L64-L97.
| Platform | Default path |
|---|---|
| Linux | /etc/xdg/worktrunk/config.toml |
| macOS | /Library/Application Support/worktrunk/config.toml |
| Windows | %PROGRAMDATA%\worktrunk\config.toml |
Lookup order:
WORKTRUNK_SYSTEM_CONFIG_PATHenv var (testing/overrides)- Each dir in
$XDG_CONFIG_DIRS(colon-separated; on Unix, if set, replaces the platform defaults per XDG spec — no fallback) - Platform default from the table
System config sits at the bottom of the precedence chain — user config and env vars override it. Today this is documented as a one-liner in docs/content/config.md#L39. Promoting it into its own row in the "Configuration files" table (or a short section beneath it) would surface the deployment path without requiring users to run wt config show.
Bootstrap-personal-config alias
Here's a project-config alias that appends a recommended [commit.generation] block to each teammate's user config on first run, and no-ops thereafter. Tested locally — first invocation writes, second prints "already set":
# .config/wt.toml
[aliases]
setup-commit-generation = '''
CFG="${XDG_CONFIG_HOME:-$HOME/.config}/worktrunk/config.toml"
if [ -f "$CFG" ] && grep -q '^\[commit\.generation\]' "$CFG"; then
echo "[commit.generation] already set in $CFG"
else
mkdir -p "$(dirname "$CFG")"
cat >> "$CFG" <<'EOF'
[commit.generation]
command = "CLAUDECODE= MAX_THINKING_TOKENS=0 claude -p --no-session-persistence --model=haiku --tools='' --disable-slash-commands --setting-sources='' --system-prompt=''"
EOF
echo "Added [commit.generation] to $CFG"
fi
'''
$ wt setup-commit-generation
Added [commit.generation] to /Users/me/.config/worktrunk/config.toml
$ wt setup-commit-generation
[commit.generation] already set in /Users/me/.config/worktrunk/config.toml
Properties that make this fit the "project preference, not project execution" framing from your third bullet:
- It runs only when a teammate explicitly invokes
wt setup-commit-generation. The project'swt.tomldefining the alias doesn't itself execute anything. - First-run approval prompts the user with the full alias body before it touches their config, so they see exactly what would be appended.
- It writes only when there is no existing
[commit.generation]block — teammates who've already chosen a different agent aren't overridden.
Limitations worth knowing:
- The body is POSIX-shell — it won't work on Windows without a sh-compatible shell. A cross-platform variant could use the
[[aliases.NAME]]pipeline form with per-OS guards, but for most teams a single-shell alias is enough. - "Appended to the user message" (your first bullet) wouldn't help this user's stated goal of "use the same agent" — only
commandcontrols the agent. A project-level prompt addendum would complement this alias for teams that want a shared prompt without dictating the agent.
closed by #2774