feat(zcode): add Hindsight long-term memory integration for ZCode#2549
Open
benfrank241 wants to merge 3 commits into
Open
feat(zcode): add Hindsight long-term memory integration for ZCode#2549benfrank241 wants to merge 3 commits into
benfrank241 wants to merge 3 commits into
Conversation
Adds a hooks-based, no-MCP integration for ZCode (Z.ai's GLM desktop coding agent). ZCode embeds the Claude Code agent runtime and reads the standard Claude Code hook schema from its own config namespace (~/.zcode/cli/config.json), so `hindsight-zcode install` wires three process hooks — SessionStart, UserPromptSubmit (recall), and Stop (retain) — without touching the user's ~/.claude config and without an MCP server. Recall injects relevant memories as additionalContext before each prompt; retain assembles each turn from the prompt (captured at UserPromptSubmit) and the response (Stop payload) and stores it to Hindsight. Verified end-to-end in ZCode 3.2.2: hooks fire, retain persists to the cloud bank, and recall injects memory into the agent. Includes the pip package + installer, hook scripts, tests, CI job, release-integration wiring, changelog registration, docs page, and gallery entry.
Publishes the ZCode integration as a hooks-only Claude Code plugin (hindsight-zcode) in the repo's plugin marketplace, so ZCode users can install it via 'zcode plugins add-marketplace vectorize-io/hindsight' without pip and without depending on Z.ai's marketplace. The plugin reuses the pip package's hook scripts via CLAUDE_PLUGIN_ROOT (no duplication) — settings.json resolves as a sibling of scripts/ in both the pip and plugin layouts. Adds a plugin manifest, plugin-format hooks.json (SessionStart/UserPromptSubmit/Stop — no SessionEnd), marketplace entry, validation tests, and docs.
…r release) The /changelog/integrations/zcode page is generated at release time, so linking to it broke the Docusaurus build (build-docs + verify-generated-files). Most unreleased integration pages omit this link; follow that convention.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds a hooks-based, no-MCP integration for ZCode — Z.ai's GLM desktop coding agent.
ZCode embeds the Claude Code agent runtime and reads the standard Claude Code hook schema from its own config namespace (
~/.zcode/cli/config.json). Sohindsight-zcode installwires threeprocesshooks — SessionStart, UserPromptSubmit (recall), and Stop (retain) — withhooks.enabled: true, without touching the user's~/.claudeconfig and without running an MCP server.additionalContextbefore each prompt.UserPromptSubmit) and the response (Stoppayload) and stores it to Hindsight. ZCode has noSessionEndevent, so retention ridesStop.Why the turn is assembled from payloads
ZCode's
Stoptranscript_pathis an ephemeral, assistant-only temp file in a ZCode-specific format. Rather than depend on it, recall stashes the prompt and retain pairs it with theStoppayload'sresponseText— reliable across ZCode versions.Verified end-to-end in ZCode 3.2.2
Integration checklist
hindsight-zcode install/uninstall)test-zcode-integration+ detect-changes filterrelease-integration.shVALID_INTEGRATIONS+generate_changelog.pyINTEGRATIONSdocs-integrations/zcode.md) + gallery entry + icon🤖 Generated with Claude Code