Skip to content

Add /remove-dir and keep /add-dir grants across resets - #389

Merged
neich merged 1 commit into
mainfrom
feat/add-remove-dir
Nov 18, 2026
Merged

neich merged 1 commit into
mainfrom
feat/add-remove-dir

Conversation

@neich

@neich neich commented Nov 18, 2026

Copy link
Copy Markdown
Owner

Summary

Adds a /remove-dir [N] TUI chat command and changes /add-dir grants to persist across /reset, /clear and /handoff. Grants are now removed only explicitly with /remove-dir.

Changes

  • /remove-dir (commands.rs, side_panel.rs, app.rs): bare form removes all grants of the active conversation; /remove-dir N removes the Nth grant (1-based). Out-of-range or non-numeric values leave grants untouched and show a usage message with the current listing. Dispatch matches on the first token, so /remove-dir is not confused with other commands.
  • Numbered /add-dir listing: bare /add-dir now numbers grants from 1 so the numbers match what /remove-dir N takes. Listing text is factored into add_dir_listing.
  • Grants survive resets (agent_chat.rs): reset_conversation_at no longer clears session_read_folders, so /reset, /clear and /handoff keep them. Doc comments, /help text and the /add-dir confirmation message are updated accordingly.
  • Docs: the /add-dir rule in CLAUDE.md now describes the new persistence and /remove-dir.
  • Tests: new tests for numbered listing, removing the Nth grant, removing all, and rejecting bad arguments. The reset and handoff tests are inverted to assert grants are kept. /remove-dir is asserted not to be in REMOTE_ALLOWED_SLASH.

Testing

  • git diff --check origin/main...HEAD
  • cargo test — skipped (not run for this PR). New and updated unit tests are included but were not executed here.

Risks / Notes

  • Behavior change: users who relied on /reset, /clear or /handoff to drop read-only folder grants must now run /remove-dir. Grants remain persisted with the conversation, so they carry on until removed.
  • Like /add-dir, /remove-dir is desktop only and is not in the remote slash allow-list.
  • Tests were not run, so the new and modified tests are unverified.

Adds a /remove-dir [N] command that drops the Nth granted folder, or all
of them when called bare, and numbers the bare /add-dir listing from 1.
Grants now survive /reset, /clear and /handoff, so /remove-dir is the
only way to drop them. The help text, the CLAUDE.md rule and the tests
are updated to match.
@neich
neich merged commit 1d99786 into main Nov 18, 2026
@neich
neich deleted the feat/add-remove-dir branch November 18, 2026 21:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant