Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion hindsight-docs/docs-integrations/claude-code.md
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ Auto-retain runs after Claude responds. It extracts the conversation transcript
| `retainOverlapTurns` | — | `2` | When chunked retention fires, this many extra turns from the previous chunk are included for continuity. Total window size = `retainEveryNTurns + retainOverlapTurns`. |
| `retainRoles` | — | `["user", "assistant"]` | Which message roles to include in the retained transcript. |
| `retainToolCalls` | — | `true` | Whether to include tool calls (function invocations and results) in the retained transcript. Captures structured actions like file reads, searches, and code edits. |
| `retainTags` | | `["{session_id}"]` | Tags attached to the retained document. Supports `{session_id}` placeholder which is replaced with the current session ID at runtime. |
| `retainTags` | `HINDSIGHT_RETAIN_TAGS` | `["{session_id}"]` | Tags attached to the retained document. The env var accepts JSON or a comma-separated list. Supports `{session_id}` placeholder which is replaced with the current session ID at runtime. |
| `retainMetadata` | — | `{}` | Arbitrary key-value metadata attached to the retained document. |
| `retainContext` | — | `"claude-code"` | A label attached to retained memories identifying their source. Useful when multiple integrations write to the same bank. |

Expand Down
2 changes: 1 addition & 1 deletion hindsight-integrations/claude-code/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ Auto-retain runs after Claude responds. It extracts the conversation transcript
| `retainOverlapTurns` | — | `2` | When chunked retention fires, this many extra turns from the previous chunk are included for continuity. Total window size = `retainEveryNTurns + retainOverlapTurns`. |
| `retainRoles` | — | `["user", "assistant"]` | Which message roles to include in the retained transcript. |
| `retainToolCalls` | — | `true` | Whether to include tool calls (function invocations and results) in the retained transcript. Captures structured actions like file reads, searches, and code edits. |
| `retainTags` | | `["{session_id}"]` | Tags attached to the retained document. Supports template placeholders: `{session_id}`, `{bank_id}`, `{timestamp}`, and `{user_id}` (resolved from `HINDSIGHT_USER_ID` env var; empty string if unset). Tags whose resolved form ends in an empty namespace part (e.g. `"user:"` when `HINDSIGHT_USER_ID` is unset) are dropped from the outgoing request. See [Template variables](#template-variables-for-retaintags-and-retainmetadata) below. |
| `retainTags` | `HINDSIGHT_RETAIN_TAGS` | `["{session_id}"]` | Tags attached to the retained document. The env var accepts JSON or a comma-separated list. Supports template placeholders: `{session_id}`, `{bank_id}`, `{timestamp}`, and `{user_id}` (resolved from `HINDSIGHT_USER_ID` env var; empty string if unset). Tags whose resolved form ends in an empty namespace part (e.g. `"user:"` when `HINDSIGHT_USER_ID` is unset) are dropped from the outgoing request. See [Template variables](#template-variables-for-retaintags-and-retainmetadata) below. |
| `retainMetadata` | — | `{}` | Arbitrary key-value metadata attached to the retained document. Same template placeholders as `retainTags`. |
| `retainContext` | — | `"claude-code"` | A label attached to retained memories identifying their source. Useful when multiple integrations write to the same bank. |

Expand Down
1 change: 1 addition & 0 deletions hindsight-integrations/claude-code/scripts/lib/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@
"HINDSIGHT_RECALL_TAGS_MATCH": ("recallTagsMatch", str),
"HINDSIGHT_RECALL_TAG_GROUPS": ("recallTagGroups", dict),
"HINDSIGHT_RECALL_ADDITIONAL_BANK_FILTERS": ("recallAdditionalBankFilters", dict),
"HINDSIGHT_RETAIN_TAGS": ("retainTags", list),
"HINDSIGHT_API_PORT": ("apiPort", int),
"HINDSIGHT_DAEMON_IDLE_TIMEOUT": ("daemonIdleTimeout", int),
"HINDSIGHT_REQUEST_TIMEOUT_SECONDS": ("requestTimeoutSeconds", int),
Expand Down
6 changes: 6 additions & 0 deletions hindsight-integrations/claude-code/tests/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,12 @@ def test_recall_tags_env_override_accepts_comma_list(self, tmp_path, monkeypatch
cfg = load_config()
assert cfg["recallTags"] == ["memory_type:rule", "tech_stack:supabase"]

def test_retain_tags_env_override_accepts_comma_list(self, tmp_path, monkeypatch):
monkeypatch.setenv("CLAUDE_PLUGIN_ROOT", str(tmp_path))
monkeypatch.setenv("HINDSIGHT_RETAIN_TAGS", "project:payments, source:claude-code")
cfg = load_config()
assert cfg["retainTags"] == ["project:payments", "source:claude-code"]

def test_recall_tag_groups_env_override_accepts_json(self, tmp_path, monkeypatch):
monkeypatch.setenv("CLAUDE_PLUGIN_ROOT", str(tmp_path))
monkeypatch.setenv(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ Auto-retain runs after Claude responds. It extracts the conversation transcript
| `retainOverlapTurns` | — | `2` | When chunked retention fires, this many extra turns from the previous chunk are included for continuity. Total window size = `retainEveryNTurns + retainOverlapTurns`. |
| `retainRoles` | — | `["user", "assistant"]` | Which message roles to include in the retained transcript. |
| `retainToolCalls` | — | `true` | Whether to include tool calls (function invocations and results) in the retained transcript. Captures structured actions like file reads, searches, and code edits. |
| `retainTags` | | `["{session_id}"]` | Tags attached to the retained document. Supports `{session_id}` placeholder which is replaced with the current session ID at runtime. |
| `retainTags` | `HINDSIGHT_RETAIN_TAGS` | `["{session_id}"]` | Tags attached to the retained document. The env var accepts JSON or a comma-separated list. Supports `{session_id}` placeholder which is replaced with the current session ID at runtime. |
| `retainMetadata` | — | `{}` | Arbitrary key-value metadata attached to the retained document. |
| `retainContext` | — | `"claude-code"` | A label attached to retained memories identifying their source. Useful when multiple integrations write to the same bank. |

Expand Down