Skip to content

Claude Code auto-recall: expose tag filters (recallTags / tagsMatch / tagGroups) from client config #2329

@keijiro-kawaguchi

Description

@keijiro-kawaguchi

Summary

The Claude Code plugin's auto-recall hook (scripts/recall.py) doesn't expose tag filtering to the client config (~/.hindsight/claude-code.json). When a bank defines entity_labels with tag: true, the LLM classification cost is paid at retain time but cannot be leveraged at recall time via the hook.

Motivation

The official client.recall(tags=..., tag_groups=..., tags_match=...) API supports rich tag filtering — and the best-practices §Filtering by Memory Shape docs explicitly recommend entity_labels with tag: true as the canonical pattern for separating semantically similar memories that serve different purposes (e.g. concise rules vs detailed procedures).

However the auto-recall hook in hindsight-memory/<v>/scripts/recall.py doesn't read any tag-related keys from client config and doesn't pass tags/tag_groups to client.recall():

$ grep -nE "tags|recall_tags|recallTags|tag_groups|tagGroups|tagsMatch" scripts/recall.py
(0 matches)

while lib/client.py does accept tag parameters in recall() (tags: Optional[list] = None around line 138).

Use case (the one we hit)

We maintain a single normative methodology bank that all project sessions read cross-bank via recallAdditionalBanks. We configured entity_labels:

{
  "entity_labels": [
    {"key": "memory_type", "type": "value", "tag": true, "values": [
      {"value": "rule", "description": "concise operating rule"},
      {"value": "procedure", "description": "step-by-step instruction"}
    ]},
    {"key": "tech_stack", "type": "multi-values", "tag": true, "values": [
      {"value": "supabase"}, {"value": "lovable"}, ...
    ]}
  ]
}

We wanted auto-recall to:

  • Bias toward memory_type:rule (durable axioms) over memory_type:procedure (runbooks) on planning-style turns
  • Filter by the current project's tech_stack:<name>

Today we either pay classification cost with zero recall benefit, or remove entity_labels entirely (our current workaround).

Proposal

Add optional config keys to ~/.hindsight/claude-code.json that map to the existing client.recall() parameters:

  • recallTags: list[str] — tags to pass to client.recall(tags=...)
  • tagsMatch: "any" | "all" | "any_strict" | "all_strict" (default "any" per best-practices)
  • tagGroups: <tree> — optional nested boolean tree per recall.md §tag_groups

If those keys are present, recall.py passes them through to client.recall(tags=..., tag_groups=..., tags_match=...). Otherwise behavior unchanged.

Per-bank overrides would be especially useful for our topology — something like recallTagsByBank: { "<bank_id>": [...] } so a normative bank read via recallAdditionalBanks can be filtered (e.g. memory_type:rule only) without affecting the project bank's own recall.

Version

  • plugin: hindsight-memory 0.7.0 (also reviewed 0.7.1 changelog — no mention of tag filter support)
  • platform: Windows 11

Happy to send a PR if this direction is welcome. Thanks for the great plugin.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions