Problem
When running ck inside a subdirectory of an already indexed project, a new .ck directory is created in that subdirectory. This leads to redundant indexes, increased disk usage, and unnecessary re-indexing work.
Proposed Behavior
When executed in a subdirectory, ck should:
- Traverse upward from the current working directory to locate an existing
.ck directory.
- If found, reuse that index instead of creating a new one.
- Scope search results to files within the current subdirectory only.
Example
Given:
project/
.ck/
src/
module/
Running:
cd project/src/module
ck “query”
Expected behavior:
- Use
project/.ck as the index
- Return only results under
project/src/module
Optional Optimization
For performance, ck could optionally:
- Prioritize scanning and updating only files within the current subdirectory
- Defer or avoid reprocessing unrelated parts of the repository
Benefits
- Avoids duplicate
.ck directories
- Reduces disk usage and indexing time
- Improves usability in nested workflows
- Aligns with common tooling patterns (e.g., git, npm, etc.)
Notes / Open Questions
- Should there be a flag to disable parent lookup (e.g.,
--no-parent-index)?
Thanks so much for building such a wonderful tool!
Problem
When running
ckinside a subdirectory of an already indexed project, a new.ckdirectory is created in that subdirectory. This leads to redundant indexes, increased disk usage, and unnecessary re-indexing work.Proposed Behavior
When executed in a subdirectory,
ckshould:.ckdirectory.Example
Given:
project/
.ck/
src/
module/
Running:
cd project/src/module
ck “query”
Expected behavior:
project/.ckas the indexproject/src/moduleOptional Optimization
For performance,
ckcould optionally:Benefits
.ckdirectoriesNotes / Open Questions
--no-parent-index)?Thanks so much for building such a wonderful tool!