hindsight-claude-agent-sdk
Persistent memory tools and hooks for the Claude Agent SDK, powered by Hindsight.
Installation
pip install hindsight-claude-agent-sdk
Quick Start
Tools (explicit memory)
Give your Claude agent retain/recall/reflect tools so it can decide when to use memory:
from claude_agent_sdk import query, ClaudeAgentOptions
from hindsight_claude_agent_sdk import create_hindsight_server
server = create_hindsight_server(
bank_id="my-agent",
hindsight_api_url="http://localhost:8888",
)
async for msg in query(
prompt="Remember that I prefer dark mode. Then check what you know about me.",
options=ClaudeAgentOptions(
mcp_servers={"hindsight": server},
allowed_tools=["mcp__hindsight__*"],
),
):
print(msg)
Hooks (automatic memory)
Auto-recall relevant memories before each prompt and auto-retain results after each session:
from claude_agent_sdk import query, ClaudeAgentOptions
from hindsight_claude_agent_sdk import create_hindsight_server, create_memory_hooks
server = create_hindsight_server(bank_id="my-agent", hindsight_api_url="http://localhost:8888")
hooks = create_memory_hooks(bank_id="my-agent", hindsight_api_url="http://localhost:8888")
async for msg in query(
prompt="Help me refactor the auth module.",
options=ClaudeAgentOptions(
mcp_servers={"hindsight": server},
allowed_tools=["mcp__hindsight__*"],
hooks=hooks,
),
):
print(msg)
Global configuration
from hindsight_claude_agent_sdk import configure
configure(
hindsight_api_url="http://localhost:8888",
api_key="your-api-key",
budget="mid",
)
Hook Configuration
Fine-tune automatic memory behavior:
from hindsight_claude_agent_sdk import MemoryHookConfig, create_memory_hooks
hooks = create_memory_hooks(
bank_id="my-agent",
hook_config=MemoryHookConfig(
auto_recall=True, # inject memories before each prompt
auto_retain=True, # save results after each session
retain_on_tools=["Bash"], # also retain notable Bash outputs
recall_max_results=5, # max memories to inject
retain_tags=["source:my-app"],
),
)
Metadata
Release files for hindsight-claude-agent-sdk 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| hindsight_claude_agent_sdk-0.1.0.tar.gz | 120.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| hindsight_claude_agent_sdk-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 133.1 kB
Release files / hindsight_claude_agent_sdk-0.1.0.tar.gz
| Download URL | hindsight_claude_agent_sdk-0.1.0.tar.gz |
|---|---|
| Size | 120.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d92c743fc6a7b5bff4048e29c9fde763d1eecbd445d85eb9e4719ecc3ffc764e
|
|
BLAKE2b-256 checksum How to use checksums |
f2a7b64ef65c9864f742186c626d6f2f970f67b57952e83c7c53185665f86253
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 8, 2026.
Transparency logRelease files / hindsight_claude_agent_sdk-0.1.0-py3-none-any.whl
| Download URL | hindsight_claude_agent_sdk-0.1.0-py3-none-any.whl |
|---|---|
| Size | 12.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0dab63c7c5bad823d0891d2890fcab0b433f091ed670259d822bab0c89adde37
|
|
BLAKE2b-256 checksum How to use checksums |
e4d22fa26d8c28fc5dfa4cdd06d5ec496392ca1553b60bd7b25524aecc0f428b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 8, 2026.
Transparency log