read-memories

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese
Search past session logs silently — do NOT narrate the process. Absorb the results and continue with enriched context.
$0
is the keyword. Pass
--here
as
$1
to scope to the current project only.
静默搜索过往会话日志——不要叙述搜索过程。吸收搜索结果并结合丰富的上下文继续对话。
$0
为关键词。传入
--here
作为
$1
可将搜索范围限定为当前项目。

Step 1 — Query

步骤1 — 查询

bash
duckdb :memory: -c "
SELECT
  regexp_extract(filename, 'projects/([^/]+)/', 1) AS project,
  strftime(timestamp::TIMESTAMPTZ, '%Y-%m-%d %H:%M') AS ts,
  message.role AS role,
  left(message.content::VARCHAR, 500) AS content
FROM read_ndjson('<SEARCH_PATH>', auto_detect=true, ignore_errors=true, filename=true)
WHERE message::VARCHAR ILIKE '%<KEYWORD>%'
  AND message.role IS NOT NULL
ORDER BY timestamp
LIMIT 40;
"
Search paths:
  • All projects:
    $HOME/.claude/projects/*/*.jsonl
  • Current only (
    --here
    ):
    $HOME/.claude/projects/$(echo "$PWD" | sed 's|[/_]|-|g')/*.jsonl
Replace
<SEARCH_PATH>
and
<KEYWORD>
before running.
bash
duckdb :memory: -c "
SELECT
  regexp_extract(filename, 'projects/([^/]+)/', 1) AS project,
  strftime(timestamp::TIMESTAMPTZ, '%Y-%m-%d %H:%M') AS ts,
  message.role AS role,
  left(message.content::VARCHAR, 500) AS content
FROM read_ndjson('<SEARCH_PATH>', auto_detect=true, ignore_errors=true, filename=true)
WHERE message::VARCHAR ILIKE '%<KEYWORD>%'
  AND message.role IS NOT NULL
ORDER BY timestamp
LIMIT 40;
"
搜索路径:
  • 所有项目:
    $HOME/.claude/projects/*/*.jsonl
  • 仅当前项目(
    --here
    ):
    $HOME/.claude/projects/$(echo "$PWD" | sed 's|[/_]|-|g')/*.jsonl
运行前请替换
<SEARCH_PATH>
<KEYWORD>

Step 2 — Internalize

步骤2 — 内化信息

From the results, extract decisions, patterns, unresolved TODOs, and user corrections. Use this to inform your current response — do not repeat raw logs to the user.
从搜索结果中提取决策、模式、未完成的TODO以及用户的修正内容。利用这些信息优化当前回复——不要向用户重复原始日志内容。