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.3.0.tar.gz (14.8 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.3.0-py3-none-any.whl (15.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: thinqos_harvest-0.3.0.tar.gz
  • Upload date:
  • Size: 14.8 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.3.0.tar.gz
Algorithm Hash digest
SHA256 faeb56a86204e03f7d1f8549c30b0d2a4e6cee3b361e70c8ff392b0b9c6d73d0
MD5 213e52ab2f860885f6c14f35d4ca3c0d
BLAKE2b-256 d74b8d8406a9cd5aaef45b5a7384e4f4775fe4b16a26e52a1f71a73d0562b894

See more details on using hashes here.

Provenance

The following attestation bundles were made for thinqos_harvest-0.3.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.3.0-py3-none-any.whl.

File metadata

  • Download URL: thinqos_harvest-0.3.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.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3dcfbb46c86fd17dcd498dda55d368b35fee5eea49a5414df200ac92f6210dba
MD5 369624e13109183824ef67459eedda5d
BLAKE2b-256 ade666c1c396a165b03452b575f751166b8beb2eb8f0c5d082c376fc0e737f12

See more details on using hashes here.

Provenance

The following attestation bundles were made for thinqos_harvest-0.3.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