Purpose: Verify the search system works correctly.
memory-search "memory"Expected: Find entries mentioning "memory" across memory files.
Verify:
- Results displayed with file:line
- Preview text shown
- Results ranked by relevance
memory-search --tag decisionExpected: Find entries tagged with #decision.
Verify:
- Only decision-tagged entries shown
- Tag shown in output
- Results from tagged files only
# Relative
memory-search "kit" --since 7d
# Absolute
memory-search "kit" --since 2026-02-01Expected: Only results from specified date range.
Verify:
- File dates match range
- Older files excluded
- Date shown in output
memory-search --today
memory-search --recent-decisions
memory-search --recent-wins
memory-search --active-blockersExpected: Each shortcut works as filter combination.
Verify:
--today= today's date only--recent-decisions= #decision + last 7d- Results match filter intent
memory-search --procedure "posting"Expected: Search procedures/ folder only.
Verify:
- Only procedure files shown
- Files from memory/procedures/
- Daily logs excluded
memory-search "kit" --countExpected: Count occurrences, show summary.
Verify:
- Total count shown
- By-file breakdown
- Most recent date
- Tag aggregation (if entries tagged)
memory-search --tag kits --tag distributionExpected: AND logic — entries with BOTH tags.
Verify:
- Results have both tags
- Fewer results than single tag
- Correct filtering
memory-search "ClawHub" --tag decision --since 7dExpected: Keyword + tag + date range all applied.
Verify:
- Contains "ClawHub"
- Tagged #decision
- Within last 7 days
- All filters active
memory-search "memory" --format jsonExpected: Valid JSON array.
Verify:
- Valid JSON syntax
- Fields: file, date, line, tags, preview, score
- Can pipe to jq
memory-search "memory" --format json | jq '.[0]'memory-search "nonexistentxyzabc123"Expected: "No results found."
Verify:
- Clean error message
- No crashes
- Exit code 0
Create test-search.sh:
#!/bin/bash
echo "=== Memory Kit Search Tests ==="
# Test 1: Help
echo -n "Test 1: Help... "
memory-search --help > /dev/null && echo "✓" || echo "✗"
# Test 2: Basic search
echo -n "Test 2: Basic search... "
memory-search "memory" > /dev/null && echo "✓" || echo "✗"
# Test 3: Tag search
echo -n "Test 3: Tag search... "
memory-search --tag decision > /dev/null && echo "✓" || echo "✗"
# Test 4: Date range
echo -n "Test 4: Date range... "
memory-search --since 7d > /dev/null && echo "✓" || echo "✗"
# Test 5: Shortcuts
echo -n "Test 5: Shortcuts... "
memory-search --today > /dev/null && echo "✓" || echo "✗"
# Test 6: Count mode
echo -n "Test 6: Count mode... "
memory-search "kit" --count > /dev/null && echo "✓" || echo "✗"
# Test 7: JSON output
echo -n "Test 7: JSON output... "
memory-search "memory" --format json | jq . > /dev/null 2>&1 && echo "✓" || echo "✗"
# Test 8: Procedure search
echo -n "Test 8: Procedure search... "
memory-search --procedure "test" > /dev/null && echo "✓" || echo "✗"
echo "=== Tests Complete ==="Run:
chmod +x test-search.sh
./test-search.sh# Count total memory files
find memory -name "*.md" | wc -l
# Time a search
time memory-search "memory"
# Time with filters
time memory-search --tag decision --since 30dTarget: <2 seconds for 100 files
# Search with no filters (all files)
time memory-search ""
# Complex multi-filter query
time memory-search "kit" --tag kits --tag distribution --project "Memory Kit" --since 30dmemory-search ""Expected: Return all tagged/filtered entries if filters present, or empty.
memory-search "token-limit"
memory-search "memory/procedures"
memory-search "API call"Expected: Handle hyphens, slashes, spaces correctly.
memory-search "MEMORY"
memory-search "memory"
memory-search "Memory"Expected: All return same results (case-insensitive).
memory-search "token limit"
memory-search "decision making"Expected: Treat as phrase or individual words.
memory-search --tag decision
memory-search --tag Decision
memory-search --tag #decisionExpected: All should work (normalize input).
memory-search --since 2026-99-99
memory-search --since "invalid"Expected: Graceful error or skip invalid dates.
-
Basic search still works
memory-search "memory" -
Tag filtering works
memory-search --tag decision
-
Date ranges work
memory-search --since 7d
-
Count mode works
memory-search "kit" --count -
JSON output valid
memory-search "memory" --format json | jq .
Task: Wake up, get oriented quickly.
Actions:
memory-search --today
memory-search --active-blockersSuccess: <30 seconds to understand current state.
Task: "What did we decide about ClawHub publishing?"
Actions:
memory-search "ClawHub" --tag decisionSuccess: Find decision in <10 seconds.
Task: "How do we post to DEV.to again?"
Actions:
memory-search --procedure "DEV.to"Success: Find procedure immediately.
Task: "How often do we hit token limits?"
Actions:
memory-search "token limit" --countSuccess: See frequency and context.
If you find issues:
- Note the exact command you ran
- Note the error message (full output)
- Note your environment (bash version, OS)
- Log to memory/feedback.md with
#bugtag
Example:
### Search Bug: Tag Filtering Not Working #bug #search
**Command:** `memory-search --tag decision`
**Expected:** Find tagged entries
**Actual:** No results, but entries exist
**Environment:** macOS, bash 3.2
**Date:** 2026-02-04Issue: Older bash doesn't support associative arrays.
Solution: Using temp files for compatibility.
Status: Fixed in v2.1.0
Issue: grep may warn about binary files.
Solution: Use 2>/dev/null to suppress.
Status: Working as intended.
Issue: --context 100 may be slow.
Solution: Keep context reasonable (3-5 lines).
Status: User education.
# Check search usage (if logging enabled)
grep "memory-search" memory/*.md | wc -l
# Check tag coverage
grep -r "#" memory/*.md | wc -l
# Check average search time
for i in {1..10}; do
time memory-search "memory" > /dev/null
doneTesting ensures reliability. Test often, test early.