* feat: Add Claude Code integration plugin Complete port of hindsight-openclaw (v0.4.19) adapted to Claude Code's hook-based plugin architecture. Pure Python stdlib, no external dependencies. - Auto-recall via UserPromptSubmit hook (additionalContext injection) - Auto-retain via async Stop hook (chunked retention with sliding window) - Daemon management (auto-start/stop hindsight-embed via uvx) - Dynamic bank IDs with per-agent/project/channel/user granularity - All 34 configuration options with env var overrides - File-based state persistence with fcntl locking - Graceful degradation on all error paths Works with Claude Code Channels (Telegram, Discord, Slack) and interactive sessions. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: Set correct chunked retention defaults (10/2, not 1/0) retainEveryNTurns=10 and retainOverlapTurns=2 are the production-tested values — every 10 turns, retain a 12-turn sliding window. The previous defaults (1/0) would retain every single turn with no overlap, defeating the chunked retention design that prevents API bombardment. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: Align recallBudget and daemonIdleTimeout with Openclaw defaults recallBudget: "low" → "mid" (Openclaw default) daemonIdleTimeout: 300 → 0 (Openclaw default, never auto-stop) As an official Hindsight integration, defaults should match Openclaw. Users can optimize locally via settings.json or env vars. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
59 lines
1.9 KiB
Bash
Executable file
59 lines
1.9 KiB
Bash
Executable file
#!/bin/bash
|
|
set -e
|
|
|
|
echo "Installing Hindsight Memory Plugin for Claude Code..."
|
|
|
|
# Get the directory where this script is located
|
|
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
|
|
|
# Check Python version
|
|
if ! command -v python3 &> /dev/null; then
|
|
echo "Error: Python 3 not found. Please install Python 3.8+"
|
|
exit 1
|
|
fi
|
|
|
|
PYTHON_VERSION=$(python3 -c 'import sys; print(f"{sys.version_info.major}.{sys.version_info.minor}")')
|
|
echo "Found Python $PYTHON_VERSION"
|
|
|
|
# Check Claude Code is available
|
|
if ! command -v claude &> /dev/null; then
|
|
echo "Warning: 'claude' command not found. Make sure Claude Code is installed."
|
|
echo " See: https://docs.anthropic.com/en/docs/claude-code"
|
|
fi
|
|
|
|
# Install via Claude Code plugin system
|
|
echo ""
|
|
echo "To install the plugin, run the following in Claude Code:"
|
|
echo ""
|
|
echo " /plugin install $SCRIPT_DIR"
|
|
echo ""
|
|
echo "Or copy it manually:"
|
|
echo ""
|
|
|
|
PLUGIN_DIR="$HOME/.claude/plugins/hindsight-memory"
|
|
echo " mkdir -p $PLUGIN_DIR"
|
|
echo " cp -r $SCRIPT_DIR/.claude-plugin $PLUGIN_DIR/"
|
|
echo " cp -r $SCRIPT_DIR/hooks $PLUGIN_DIR/"
|
|
echo " cp -r $SCRIPT_DIR/scripts $PLUGIN_DIR/"
|
|
echo " cp $SCRIPT_DIR/settings.json $PLUGIN_DIR/"
|
|
|
|
echo ""
|
|
echo "Next steps:"
|
|
echo ""
|
|
echo "1. Configure your LLM provider for memory extraction:"
|
|
echo " # Option A: OpenAI (auto-detected)"
|
|
echo " export OPENAI_API_KEY=\"sk-your-key\""
|
|
echo ""
|
|
echo " # Option B: Anthropic (auto-detected)"
|
|
echo " export ANTHROPIC_API_KEY=\"your-key\""
|
|
echo ""
|
|
echo " # Option C: Explicit provider"
|
|
echo " export HINDSIGHT_API_LLM_PROVIDER=openai"
|
|
echo " export HINDSIGHT_API_LLM_API_KEY=\"sk-your-key\""
|
|
echo ""
|
|
echo "2. Or connect to an external Hindsight server:"
|
|
echo " Edit settings.json and set hindsightApiUrl"
|
|
echo ""
|
|
echo "3. Start Claude Code — the plugin will activate automatically."
|
|
echo ""
|
|
echo "On first use with daemon mode, uvx will download hindsight-embed (no manual install needed)."
|