Skip to content

Conversation

@TWDickson
Copy link
Contributor

I wanted Claude to analyze subsections of my project in relation to other projects. Adding symlink handling allows me to create a new project with symlinked directories to the originals while still keeping contents the same.

  • Added symlink traversal - Implemented --follow-symlinks (-L) CLI flag and processor.follow_symlinks project config option
  • Improved directory walking - Replaced walk logic with godirwalk library for better symlink handling, cycle detection, and performance
  • Enhanced config system - Added config management with registry

dependabot bot and others added 30 commits December 22, 2024 21:45
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.21.0 to 0.31.0.
- [Commits](golang/crypto@v0.21.0...v0.31.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
When Claude is under heavy load, it starts 403'ing request unless a **very**
specific Accept-Encoding header is set:

    Accept-Encoding: gzip;q=1.0, identity;q=0.3

Not entirely sure why this is the case but this was discovered as a difference
in behavior between the sandworm-rb and sandworm-go projects (the ruby client
sets this value by default whereas golang client sets "gzip" only)
First argument of input was always being interpreted as a subcommand, which
would lead to unknown command errors; e.g.:

```
> sandworm src/
Error: unknown command "src/" for "sandworm"
```

Adding `Args: cobra.ArbitraryArgs,` disables the "always interpret first arg as
subcommand" behavior, fixing the issue.
* feat: global configuration support

Sandworm now uses `$XDG_CONFIG_HOME` when storing global configuration
keys. At the moment this is only one key (the user's Anthropic session
key), but this may expand to include default ignores, default includes,
etc.

* chore: documentation updates
* fix: maps are reference types, baby
* chore: updated documentation
archives.format is now archives.formats
…olonoms#3)

Bumps [github.com/go-git/go-git/v5](https://github.com/go-git/go-git) from 5.12.0 to 5.13.0.
- [Release notes](https://github.com/go-git/go-git/releases)
- [Commits](go-git/go-git@v5.12.0...v5.13.0)

---
updated-dependencies:
- dependency-name: github.com/go-git/go-git/v5
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.33.0 to 0.38.0.
- [Commits](golang/net@v0.33.0...v0.38.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-version: 0.38.0
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Avoids conflict with homebrew installed sandworm, allowing both to co-exist.
Required with golangci lint update
api.claude.ai no longer in use
Not necessarily the same; best rely on mise's setup.
Cleanup main to make it easier to add new commands.
@biasedbit
Copy link
Contributor

Hey @TWDickson just a heads up that most of your config logic has already made it to the main branch. I needed to add the option to print line numbers and I really like what you did with the config command here so I ended up rolling it in.

The commit in which I made the change references this PR for attribution.

I've also moved pretty much all the CLI logic to a CLI package as I can imagine the cmd/ folder growing a bit as we add more commands.

@TWDickson
Copy link
Contributor Author

Hey thanks! Sorry I haven’t had a chance to update this in a bit, things got busy for me with my job job. I'll rebase and update, I think I'll have some time today!

@TWDickson TWDickson force-pushed the ft/Add-Sym-Link-Following branch 2 times, most recently from a4d203e to c2bea0a Compare July 18, 2025 15:17
@TWDickson
Copy link
Contributor Author

Updated! I also added the ProcessorOptions struct to centralize all processor-related settings, making option handling explicit and extensible. This should help make extensions and future cli args more maintainable.

All tests are passing:

?   	github.com/holonoms/sandworm/cmd/sandworm	[no test files]
?   	github.com/holonoms/sandworm/internal/claude	[no test files]
=== RUN   TestGenerateCmd_Flags
Generating project 'sandworm.txt'...
Generated 'sandworm.txt' (73.0 B)
--- PASS: TestGenerateCmd_Flags (0.01s)
=== RUN   TestGenerateCmd_FlagsOverrideConfig
Generating project 'sandworm.txt'...
Generated 'sandworm.txt' (73.0 B)
--- PASS: TestGenerateCmd_FlagsOverrideConfig (0.01s)
=== RUN   TestGenerateCmd_OutputIgnoreKeepFlags
Generating project 'myoutput.txt'...
Generated 'myoutput.txt' (284.0 B)
--- PASS: TestGenerateCmd_OutputIgnoreKeepFlags (0.01s)
PASS
ok  	github.com/holonoms/sandworm/internal/cli	(cached)
=== RUN   TestConfig
=== RUN   TestConfig/new_config_file
=== RUN   TestConfig/load_existing_config
=== RUN   TestConfig/delete_values
=== RUN   TestConfig/invalid_JSON
=== RUN   TestConfig/missing_directory
=== RUN   TestConfig/empty_values
--- PASS: TestConfig (0.01s)
    --- PASS: TestConfig/new_config_file (0.00s)
    --- PASS: TestConfig/load_existing_config (0.00s)
    --- PASS: TestConfig/delete_values (0.00s)
    --- PASS: TestConfig/invalid_JSON (0.00s)
    --- PASS: TestConfig/missing_directory (0.00s)
    --- PASS: TestConfig/empty_values (0.00s)
PASS
ok  	github.com/holonoms/sandworm/internal/config	(cached)
=== RUN   TestFileTree
=== RUN   TestFileTree/empty_input
=== RUN   TestFileTree/single_level_tree
=== RUN   TestFileTree/multi_level_tree
=== RUN   TestFileTree/custom_root_folder
=== RUN   TestFileTree/mixed_path_separators
=== RUN   TestFileTree/edge_cases_with_slashes
--- PASS: TestFileTree (0.00s)
    --- PASS: TestFileTree/empty_input (0.00s)
    --- PASS: TestFileTree/single_level_tree (0.00s)
    --- PASS: TestFileTree/multi_level_tree (0.00s)
    --- PASS: TestFileTree/custom_root_folder (0.00s)
    --- PASS: TestFileTree/mixed_path_separators (0.00s)
    --- PASS: TestFileTree/edge_cases_with_slashes (0.00s)
PASS
ok  	github.com/holonoms/sandworm/internal/filetree	(cached)
=== RUN   TestProcessor
=== RUN   TestProcessor/basic_file_processing
=== RUN   TestProcessor/gitignore_support
=== RUN   TestProcessor/binary_file_handling
=== RUN   TestProcessor/custom_ignore_file
=== RUN   TestProcessor/extra_ignore_patterns
=== RUN   TestProcessor/symbolic_link_following
=== RUN   TestProcessor/symbolic_link_cycle_prevention
=== RUN   TestProcessor/line_numbers
--- PASS: TestProcessor (0.02s)
    --- PASS: TestProcessor/basic_file_processing (0.00s)
    --- PASS: TestProcessor/gitignore_support (0.00s)
    --- PASS: TestProcessor/binary_file_handling (0.00s)
    --- PASS: TestProcessor/custom_ignore_file (0.00s)
    --- PASS: TestProcessor/extra_ignore_patterns (0.00s)
    --- PASS: TestProcessor/symbolic_link_following (0.00s)
    --- PASS: TestProcessor/symbolic_link_cycle_prevention (0.02s)
    --- PASS: TestProcessor/line_numbers (0.00s)
PASS
ok  	github.com/holonoms/sandworm/internal/processor	(cached)
=== RUN   TestFormatSize
=== RUN   TestFormatSize/zero_bytes
=== RUN   TestFormatSize/bytes
=== RUN   TestFormatSize/kilobytes
=== RUN   TestFormatSize/partial_kilobytes
=== RUN   TestFormatSize/megabytes
=== RUN   TestFormatSize/partial_megabytes
=== RUN   TestFormatSize/gigabytes
=== RUN   TestFormatSize/terabytes
=== RUN   TestFormatSize/excessive_size_defaults_to_TB
--- PASS: TestFormatSize (0.00s)
    --- PASS: TestFormatSize/zero_bytes (0.00s)
    --- PASS: TestFormatSize/bytes (0.00s)
    --- PASS: TestFormatSize/kilobytes (0.00s)
    --- PASS: TestFormatSize/partial_kilobytes (0.00s)
    --- PASS: TestFormatSize/megabytes (0.00s)
    --- PASS: TestFormatSize/partial_megabytes (0.00s)
    --- PASS: TestFormatSize/gigabytes (0.00s)
    --- PASS: TestFormatSize/terabytes (0.00s)
    --- PASS: TestFormatSize/excessive_size_defaults_to_TB (0.00s)
PASS
ok  	github.com/holonoms/sandworm/internal/util	(cached)

Copy link
Contributor

@biasedbit biasedbit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for contributing! 🙌 🚢

"testing"
)

func TestGenerateCmd_Flags(t *testing.T) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👌

@biasedbit biasedbit merged commit a630edd into holonoms:main Jul 20, 2025
1 check passed
@biasedbit
Copy link
Contributor

Release 0.3.0 is out with your changes 🚀

@TWDickson TWDickson deleted the ft/Add-Sym-Link-Following branch July 21, 2025 13:37
@JackCA
Copy link

JackCA commented Jul 21, 2025

Awesome work to you both!

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.

4 participants