Repository navigation
Conversation
If no user-level btw.md exists, btw_client() and btw_app() now fall back to
a user-level AGENTS.md, searched in ~/.btw/, ~/.config/btw/,
tools::R_user_dir("btw"), and ~/.agents/, in that order; a user-level
CLAUDE.md is never used. edit_btw_md("user") opens a user-level AGENTS.md
when no user-level btw.md exists, and use_btw_md("user") warns before
creating a btw.md that would take priority over an existing AGENTS.md.
The path_btw argument of btw_client() and btw_app() now also accepts a
named list with project and/or user fields, each TRUE (search the default
locations), FALSE (skip that scope), or a path to a specific file; a
missing field keeps the default for that scope. A scalar path now uses
only that file (previously the user-level btw.md was also loaded alongside
it); pass list(project = "path") to combine a specific project file with
the default user-level context. The new btw.client.path_btw_user option
sets the default for the user scope.
Fixes #226
A user-level AGENTS.md is a cross-tool convention, so it is now searched only in ~/.agents/ rather than in btw's own config directories, which remain reserved for btw.md. The multiple-user-config warning now points AGENTS.md duplicates at ~/.agents/AGENTS.md as the consolidation target.
gadenbuie
marked this pull request as ready for review
October 6, 2026 14:47
Trim implementation details now covered in the function docs and break up the dense path_btw bullet into separate sentences.
Drop a redundant restatement and merge two sentences explaining the user-level lookup.
A user-level CLAUDE.md not being used is covered in ?btw_client and ?btw-config; NEWS needn't mention a non-feature.
Generalize the user-scope option default into btw_path_scope_default() so the project scope has a matching option. Both options are documented in ?btw_client and set the defaults for the corresponding path_btw scope. Also mention the user-level CLAUDE.md exclusion only in ?btw-config, dropping it from the vignette, ?use_btw_md, and ?btw_client where it appeared without context.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #226
Summary
When no user-level
btw.mdexists,btw_client()andbtw_app()now fall back to a user-levelAGENTS.mdin the cross-tool~/.agents/directory. This mirrors the project-level precedencebtw.md>AGENTS.md>CLAUDE.md, except a user-levelCLAUDE.mdis never used. Frontmatter in a user-levelAGENTS.mdconfiguresclient,tools, andoptionsjust like abtw.md, and user-level context is combined with the project-level context file.edit_btw_md("user")opens a user-levelAGENTS.mdwhen only one exists and includes them in the multi-file menu.use_btw_md("user")warns (or asks interactively) before creating a~/.btw/btw.mdthat would take priority over an existing user-levelAGENTS.md.path_btwinbtw_client()andbtw_app()now also accepts a named list withprojectand/oruserfields, eachTRUE(search the default locations),FALSE(skip that scope), or a path to a specific file. A missing field keeps the default for that scope:projectsearches project locations anduserfollows the newbtw.client.path_btw_useroption (TRUE/FALSE/path), sooptions(btw.client.path_btw_user = FALSE)in~/.Rprofileopts out of user-level context globally.btw_app()'s chat history scoping understands the list form too.One deliberate behavior change: a scalar path now uses only that file, a shortcut for
list(project = path, user = FALSE). Previously the user-levelbtw.mdwas also loaded alongside it; passlist(project = "path")to combine a specific project file with the default user-level context.Verification
Full test suite passes locally: 2709 pass, 0 fail, 1 skip (CI-only web tool test).