Skip to content

Feature: hook-based integration example for coding agents on subscription auth (no ANTHROPIC_BASE_URL override possible) #715

Description

@sK3n0b1

Context

The documented Claude Code integration relies on rerouting ANTHROPIC_BASE_URL through memory-proxy. That works for API-key users, but Claude Code sessions authenticated via subscription (OAuth) cannot be pointed at a proxy — overriding the base URL breaks subscription auth entirely. Those users currently have no supported way to feed conversations into TencentDB Agent Memory.

Working pattern

I integrated a subscription-authenticated Claude Code with the platform using two small shell hooks (no proxy involved, answers keep flowing through the subscription):

  • Stop hook: extracts the last user/assistant exchange from the session transcript and POST /v2/conversation/add (Bearer = business user key). Fail-silent, curl --max-time 4.
  • SessionStart hook: POST /v2/core/read + /v2/scenario/ls, prints a compact L3-profile block that Claude Code injects into session context.

The L0→L1 pipeline picks conversations up exactly as with the proxy path (verified: atoms extracted).

Proposal

Ship this as a documented example (e.g. examples/claude-code-hooks/) for subscription-auth users. Happy to contribute my scripts as a starting point.

Related wish: a Dockerfile for memory-core so security-conscious users can build the full stack from source (proxy and hub already have one).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions