Skip to main content

Mind-as-observer probe — ship Claude Code (and other external) conversations into your thinqOS Mind.

Project description

thinqos-harvest

Mind-as-observer probe for thinqOS. Ships every Claude Code session you have into your thinqOS Mind as a captured Episode, so the Mind learns from where you actually do your work — without sitting in the request path.

Pattern: observer, not proxy. The probe runs as a Claude Code Stop hook (fires after every model reply), reads the session JSONL from disk, normalizes it to the public external ingest v1 contract, and POSTs it to /api/ingest/external/v1 on your thinqOS instance. Your Claude Code UX is unchanged.

Install

The hook command (uvx thinqos-harvest hook capture) needs uv on PATH; uvx fetches and runs thinqos-harvest on demand, no separate install step.

curl -LsSf https://astral.sh/uv/install.sh | sh

(If you'd rather install the package globally: pipx install thinqos-harvest and reference it as thinqos-harvest hook capture instead of uvx thinqos-harvest hook capture.)

Wire up

  1. Mint an ingest key. Go to https://thinqos.com/api-keys, click Create, copy the tq_... value. (Same key kind as the MCP keys — one key per machine is fine.)

  2. Set env vars in your shell rc (~/.zshrc, ~/.bashrc, or equivalent):

    export THINQOS_BASE_URL=https://thinqos.com
    export INGEST_API_KEY=tq_xxxx...
    

    Reload your shell (source ~/.zshrc).

  3. Print the hook JSON snippet:

    thinqos-harvest install-hook
    

    Copy the JSON it prints.

  4. Paste the snippet into ~/.claude/settings.json under the top-level "hooks" object. Example after pasting:

    {
      "hooks": {
        "Stop": [
          {
            "matcher": "",
            "hooks": [
              {
                "type": "command",
                "command": "uvx thinqos-harvest hook capture",
                "timeout": 30
              }
            ]
          }
        ]
      }
    }
    

    If you already have a Stop hook configured, append our entry to the existing hooks array rather than replacing. install-hook will warn you when this is the case.

  5. Smoke test:

    • Start a Claude Code session, type one prompt, exit normally.
    • Run thinqos-harvest list — your session should appear within a second.

CLI

Command What it does
thinqos-harvest list [--limit N] List your captured sessions newest-first.
thinqos-harvest forget <session_id> Delete one captured session by id (irreversible).
thinqos-harvest install-hook Print the JSON snippet for ~/.claude/settings.json.
thinqos-harvest run Manual sweep — discover any sessions not yet shipped and POST them. Use for backfill or after a long offline period.
thinqos-harvest hook capture Hook entry point — reads transcript_path from stdin JSON. You should not run this directly; Claude Code does.

Denylists

Two opt-out layers, both edited at ~/.config/thinqos-harvest/:

  • denylist.txt — newline-delimited substrings; any session whose cwd contains a substring is skipped entirely. Example: add personal-taxes to skip captures from ~/Documents/personal-taxes/.
  • Content denylist is hard-coded: turns containing .env, api_key=…, sk-…, or matching (api_key|secret|password|token)=<16+ chars> are dropped before POST. Oversized tool_result content (>32KB) is also dropped.

Reliability

  • Probe always exits 0; never blocks a Claude Code session even on bug or network failure.
  • Failed POSTs spool to ~/.config/thinqos-harvest/pending/<uuid>.json and drain on the next run or hook invocation.
  • Server-side dedup keyed by (source, source_external_id); re-shipping the same session is idempotent.

Forgetting a capture

thinqos-harvest forget <session_id>

Where <session_id> is the value thinqos-harvest list shows in the last column (Claude Code session UUID). This deletes the Episode on the server side and cascades to any extracted knowledge.

For a per-turn / per-content scrub (rather than whole-session delete), open an issue on github.com/AI4Outcomes/thinqos — it's a deliberate Phase-A non-goal but ship-able if asked for.

Privacy posture

Opt-out, not opt-in. Adapter ships everything that isn't denied. If you'd rather have explicit opt-in per session, this probe is the wrong tool for you — the design decision is explicit in the spec.

Versioning

Tagged tools/thinqos-harvest-vX.Y.Z in the thinqos monorepo. A push to a matching tag triggers the publish workflow.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

thinqos_harvest-0.2.0.tar.gz (14.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

thinqos_harvest-0.2.0-py3-none-any.whl (15.7 kB view details)

Uploaded Python 3

File details

Details for the file thinqos_harvest-0.2.0.tar.gz.

File metadata

  • Download URL: thinqos_harvest-0.2.0.tar.gz
  • Upload date:
  • Size: 14.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for thinqos_harvest-0.2.0.tar.gz
Algorithm Hash digest
SHA256 f13f369f3219104b071f6a492da5a0a7877b4b6a8fcaf5abf703a406c7aacdd6
MD5 d000c7a6b74b6624ef63dece2c4d13c8
BLAKE2b-256 e6cba874ab406a3e97bf741322a594f1d4128714f17f1a7d32b4c3525ebfc33d

See more details on using hashes here.

Provenance

The following attestation bundles were made for thinqos_harvest-0.2.0.tar.gz:

Publisher: publish-harvest.yml on AI4Outcomes/thinqos

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file thinqos_harvest-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: thinqos_harvest-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 15.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for thinqos_harvest-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bb2a960be8dff20bc08e1ed1535ea2d13eed0e8c594218303372042020fa9016
MD5 60b334b3e7d24f10a86038c605336be1
BLAKE2b-256 0b667e422a3897447e035df220cd7e63622e9bae6122732e2556fa0a570ee3ee

See more details on using hashes here.

Provenance

The following attestation bundles were made for thinqos_harvest-0.2.0-py3-none-any.whl:

Publisher: publish-harvest.yml on AI4Outcomes/thinqos

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page