hindsight-cline
Persistent long-term memory for Cline via Hindsight — no MCP required.
Cline's lifecycle hooks run small scripts at key moments. This integration installs hooks that automatically recall relevant memories before Cline works and retain what happened when a task ends. Memory persists across sessions, so Cline builds on past context instead of starting cold.
What It Does
- Before a task / each message — the
TaskStartandUserPromptSubmithooks recall relevant memories from Hindsight and inject them as context. - When a task ends — the
TaskComplete(andTaskCancel) hook retains the task's prompts and summary for future sessions. - Deterministic — because it runs on hooks, memory happens automatically; it doesn't depend on the model deciding to call a tool (no MCP).
Prerequisites
✨ Recommended: Hindsight Cloud — sign up free, get an API key, and skip self-hosting.
Self-hosting alternative:
pip install hindsight-all
export HINDSIGHT_API_LLM_API_KEY=your-openai-key
hindsight-api # starts on http://localhost:8888
Platform: Cline hooks run on macOS and Linux only (no Windows). Hooks need Python 3.
Installation
pip install hindsight-cline
Then, from your project directory:
hindsight-cline install --api-url https://api.hindsight.vectorize.io --api-token YOUR_KEY
Install globally (applies to all projects):
hindsight-cline install --global --api-url https://api.hindsight.vectorize.io --api-token YOUR_KEY
To remove it later: hindsight-cline uninstall (add --global if you installed globally).
This copies four hook scripts (TaskStart, UserPromptSubmit, TaskComplete, TaskCancel) plus their lib/ and settings.json into:
.clinerules/hooks/(project install — commit it to share with your team), or~/Documents/Cline/Rules/Hooks/(global install).
Final step — enable hooks in Cline: Settings → Features → Hooks.
How It Works
Task starts ─ TaskStart ─────────► recall(task description) → inject memories
You send a message ─ UserPromptSubmit ─► recall(prompt) → inject memories
(and append the prompt to the task transcript)
Task completes ─ TaskComplete ──► retain(accumulated transcript + summary)
Task cancelled ─ TaskCancel ────► retain(partial transcript)
Cline doesn't hand hooks a conversation transcript, so the integration accumulates each task's prompts in ~/.hindsight/cline/state/ and retains them at task end. Memories land in a single bank (cline by default).
Configuration
Defaults live in the installed settings.json; put personal overrides in ~/.hindsight/cline.json (stable across reinstalls). Common keys:
| Setting | Default | Description |
|---|---|---|
hindsightApiUrl |
(empty) | Hindsight server URL. Empty → use a local server on apiPort. |
hindsightApiToken |
null |
API key for Hindsight Cloud. |
bankId |
cline |
Memory bank for this integration. |
autoRecall |
true |
Inject memories before tasks/prompts. |
autoRetain |
true |
Retain the task transcript when it ends. |
recallBudget |
mid |
Recall depth: low / mid / high. |
recallTypes |
["world","experience"] |
Memory types to recall. |
dynamicBankId |
false |
Separate bank per project/session (see dynamicBankGranularity). |
debug |
false |
Log to stderr. |
Every key can also be set via HINDSIGHT_* environment variables (e.g. HINDSIGHT_BANK_ID, HINDSIGHT_AUTO_RECALL=false).
Verifying Setup
- Start Hindsight (
hindsight-apior Hindsight Cloud) and runhindsight-cline installwith your URL/key. - Enable hooks in Cline (Settings → Features → Hooks).
- Start a task — recalled memories appear in context as a
<hindsight_memories>block. - Complete a task, then check the
clinebank (via the API or dashboard) — a memory should appear.
You can smoke-test a hook without Cline:
echo '{"hookName":"UserPromptSubmit","prompt":"how do we authenticate?","taskId":"t1","workspaceRoots":["/tmp/x"]}' \
| .clinerules/hooks/UserPromptSubmit
# → {"cancel": false, "contextModification": "<hindsight_memories>…", "errorMessage": ""}
Development
uv sync
uv run pytest tests/ -v
Metadata
Release files for hindsight-cline 0.2.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_cline-0.2.0.tar.gz | 20.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| hindsight_cline-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 43.9 kB
Release files / hindsight_cline-0.2.0.tar.gz
| Download URL | hindsight_cline-0.2.0.tar.gz |
|---|---|
| Size | 20.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
15338cc5f82efd460e7ac568b99f2220577ca0d8eb378cde6d3b7bf68ba6d6e3
|
|
BLAKE2b-256 checksum How to use checksums |
4dd2ebbb3ec0a67222a17d99c201805effb3e2a3c6c66a7d5beb7edb733de9d5
|
| 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 9, 2026.
Transparency logRelease files / hindsight_cline-0.2.0-py3-none-any.whl
| Download URL | hindsight_cline-0.2.0-py3-none-any.whl |
|---|---|
| Size | 23.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
86ab0f1dd980e987b2bc520f98916a6511774f783dd9a623efa6107700605984
|
|
BLAKE2b-256 checksum How to use checksums |
6a1b0592d1d314f35d3ccadc502fcf19093f10fede78d3095ee202767486da0c
|
| 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 9, 2026.
Transparency log