Skip to content

feat: add working directory control for Claude terminal #117

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: thomask33/feat_add_Shift_Enter_keybinding_for_new_line_in_terminal
Choose a base branch
from

Conversation

ThomasK33
Copy link
Member

Working Directory Control for Claude Terminal

This PR adds the ability to fix Claude terminal's working directory regardless of autochdir and buffer-local cwd changes. The feature provides three options (in precedence order):

  1. cwd_provider(ctx): A function that returns a directory string, receiving context with { file, file_dir, cwd }
  2. cwd: A static path to use as working directory
  3. git_repo_cwd = true: Resolves git root from the current file directory (or cwd if no file)

The implementation includes:

  • A new claudecode.cwd module with directory resolution helpers
  • Support for top-level aliases in the config for convenience
  • Working directory resolution at terminal creation time
  • Proper passing of cwd to both native terminal and snacks providers
  • Comprehensive test coverage for the new functionality

This makes it easier to ensure Claude has the correct context when working with projects, especially in monorepos or when navigating between different parts of a codebase.

Copy link
Member Author

ThomasK33 commented Aug 8, 2025

Change-Id: I0cc3cf3815bc5634a6c01f4d708e0ccda8e53404
Signed-off-by: Thomas Kosiewski <tk@coder.com>
@ThomasK33 ThomasK33 force-pushed the thomask33/feat_add_Shift_Enter_keybinding_for_new_line_in_terminal branch from f756826 to 81582b3 Compare August 8, 2025 14:18
@ThomasK33 ThomasK33 force-pushed the thomask33/feat_add_working_directory_control_for_Claude_terminal branch from e2c03ba to dacbe9b Compare August 8, 2025 14:18
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.

[FEATURE] allow configuring a static Workdir (CWD) directory
1 participant