Skip to content

Commit 86b0a12

Browse files
committed
feat: add ccs here - project-scoped search from current directory
ccs here "auth" searches only sessions from pwd, filtering out all other projects. Useful when you're in a project and want to find past work without noise from other repos. Delegates to the main search with -p flag so numbered results and ccs go still work.
1 parent 01ca1f7 commit 86b0a12

File tree

6 files changed

+20
-5
lines changed

6 files changed

+20
-5
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,8 @@ Coming back after days/weeks?
467467
| Morning standup | `/standup` |
468468
| Name session | `/rename-session` |
469469
| Start planning | `/plan` |
470-
| Search past sessions | `ccs "query"` |
470+
| Search all projects | `ccs "query"` |
471+
| Search current project | `ccs here "query"` |
471472
| List recent sessions | `ccs ls` |
472473
| Resume session | `ccs go 1` (or `ccs go <session-id>`) |
473474
| Stats dashboard | `ccs stats` |

bin/ccs

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ case "$cmd" in
2323
echo "ccs - Claude Code Search"
2424
echo ""
2525
echo "Usage:"
26-
echo " ccs <query> Search (results are numbered)"
26+
echo " ccs <query> Search all projects (numbered)"
27+
echo " ccs here <query> Search current project only"
2728
echo " ccs <query> -d 7 Search last 7 days"
28-
echo " ccs <query> -p ~/proj Search specific project"
2929
echo " ccs ls List sessions (last 7 days)"
3030
echo " ccs ls 30 List sessions (last 30 days)"
3131
echo " ccs go 1 Resume result #1 from last search"
@@ -246,6 +246,18 @@ print()
246246
ix|index|reindex)
247247
cc-conversation-search index --all
248248
;;
249+
here)
250+
# Search scoped to current project directory
251+
query="${1:-}"
252+
if [ -z "$query" ]; then
253+
echo "Usage: ccs here <query>"
254+
echo "Searches only sessions from: $(pwd)"
255+
exit 1
256+
fi
257+
shift
258+
# Re-invoke ourselves with -p set to pwd
259+
exec "$0" "$query" -p "$(pwd)" "$@"
260+
;;
249261
*)
250262
# Default: search, show numbered results, cache session IDs
251263
args=()

completions/_ccs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
_ccs() {
66
local -a subcommands
77
subcommands=(
8+
'here:Search current project only'
89
'ls:List recent sessions'
910
'go:Resume a session by number or ID'
1011
'stats:Show conversation stats dashboard'

completions/ccs.bash

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ _ccs_completions() {
77

88
if [[ ${COMP_CWORD} -eq 1 ]]; then
99
# First arg: subcommands
10-
COMPREPLY=($(compgen -W "ls go stats doctor ix help" -- "$cur"))
10+
COMPREPLY=($(compgen -W "here ls go stats doctor ix help" -- "$cur"))
1111
return
1212
fi
1313

docs/cheatsheet.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ Ghost auto-loads context. Accept or adjust the suggested session name.
1313
| Morning standup | `/standup` |
1414
| Name session | `/rename-session` |
1515
| Start planning | `/plan` |
16-
| Search sessions | `ccs "query"` |
16+
| Search all projects | `ccs "query"` |
17+
| Search current project | `ccs here "query"` |
1718
| Search last N days | `ccs "query" -d 7` |
1819
| Search since date | `ccs "query" --since 2025-03-01` |
1920
| List recent | `ccs ls` |

docs/cheatsheet.pdf

526 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)