Skip to content

Conversation

@tobymarsden
Copy link
Contributor

Gah, more formatting shenanigans. I don't know if you have a formatter config which will let me not screw up your style each time?

Anyway:

Directory Context

claude()
  .addDirectory('/path/to/dir') // Add single directory
  .addDirectory(['../apps', '../lib']) // Add multiple directories
  .addDirectory('/another/dir'); // Accumulate with multiple calls

The addDirectory method allows you to add additional working directories for Claude to access (validates each path exists as a directory).

  • Single directory: Pass a string path
  • Multiple directories: Pass an array of string paths
  • Accumulative: Multiple calls to addDirectory will accumulate all directories
  • CLI mapping: Generates --add-dir flag with space-separated paths

Classic configuration

In classic mode the option is addDirectories

@acebytes
Copy link
Contributor

PR #7 Review

Hey @tobymarsden, great work on PR #7! 🎉

I've reviewed your implementation of the addDirectory feature and it looks excellent. The code is clean, well-tested, and follows the existing patterns in the codebase perfectly.

What I particularly liked:

  • The fluent API design with support for both single directories and arrays
  • Accumulative behavior allowing multiple addDirectory() calls
  • Comprehensive test coverage including all use cases
  • Clear documentation with examples
  • Proper CLI flag mapping to --add-dir

I've successfully integrated your changes into the beta release (v0.3.0-beta.1). The feature works seamlessly with all the other production features we've added:

  • ✅ All tests pass (24/24 in fluent.test.ts)
  • ✅ TypeScript build successful
  • ✅ No conflicts with existing features

Note about formatting: I noticed you mentioned formatting issues. The codebase uses Prettier with default settings. You can run npm run format to automatically format your code before committing.

This is a valuable addition to the SDK as it allows users to expand Claude's context with additional directories, which is particularly useful for monorepos and multi-project workspaces.

Thank you for your continued contributions! This feature will be included in the upcoming v0.3.0 release. 🚀

@acebytes acebytes merged commit 3eee0b7 into instantlyeasy:main Jun 25, 2025
@tobymarsden
Copy link
Contributor Author

@acebytes any chance you could commit your .prettierrc? I tried with every setting I could think of but npm run format is still making the diffs look like an explosion in a firework factory. I have another PR ready but I'm embarrassed to commit a complete reformatting ;-)

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.

2 participants