Skip to content

Phase 7 CCH Integration

Rick Hightower edited this page Feb 1, 2026 · 1 revision

Phase 7: CCH Integration

This page aggregates all Phase 7 documentation for the CCH Integration phase.

Phase Overview

Initial CCH hook integration planning.


07-01-PLAN

Plan 07-01: Agentic Memory Query Plugin

Phase: 7 - Agentic Memory Plugin Status: ✅ Complete Completed: 2026-01-30

Goal

Create a Claude Code marketplace plugin that provides natural language commands for querying past conversations from the agent-memory system.

Context

This plan builds on the Phase 6 end-to-end demo by packaging the query capabilities into a reusable Claude Code plugin with:

  • Slash commands for common operations
  • An autonomous agent for complex queries
  • A spec-compliant skill that scores well on the grading rubric

Tasks

Task 1: Create Core Skill ✅

What: Create SKILL.md with spec-compliant frontmatter and PDA structure

Deliverables:

  • skills/memory-query/SKILL.md - Core skill definition
  • skills/memory-query/references/command-reference.md - CLI documentation

Acceptance Criteria:

  • Valid YAML frontmatter with name and description
  • 5+ quoted trigger phrases in description
  • Validation checklist with checkboxes
  • "When Not to Use" section
  • Quick Start table with command examples
  • Error handling guidance

Task 2: Add Slash Commands ✅

What: Create command files for /memory-search, /memory-recent, /memory-context

Deliverables:

  • commands/memory-search.md - Topic-based search
  • commands/memory-recent.md - Recent conversation summaries
  • commands/memory-context.md - Grip expansion for full context

Acceptance Criteria:

  • YAML frontmatter with name, description, parameters
  • Skills reference to memory-query
  • Process section with CLI commands
  • Output format template
  • Usage examples

Task 3: Add Autonomous Agent ✅

What: Create agent for complex multi-step memory queries

Deliverables:

  • agents/memory-navigator.md - Autonomous agent definition

Acceptance Criteria:

  • YAML frontmatter with triggers (regex patterns)
  • Skills reference to memory-query
  • Capabilities documentation
  • Process section with multi-step workflow
  • Output format template
  • Limitations section

Task 4: Create Plugin Manifest ✅

What: Create marketplace.json for plugin registration

Deliverables:

  • .claude-plugin/marketplace.json - Plugin manifest

Acceptance Criteria:

  • Valid JSON with name, owner, metadata
  • Plugins array with skill, commands, agents references
  • Correct relative paths to components

Task 5: Grade and Improve Skill ✅

What: Use improving-skills rubric to grade and iterate until score > 95

Process:

  1. Initial grade: 72/100 (Grade C)
  2. Applied improvements:
    • Spec-compliant frontmatter (metadata wrapper for custom fields)
    • Added 5 quoted trigger phrases
    • Added validation checklist
    • Added "When Not to Use" section
  3. Final grade: 99/100 (Grade A)

Score Breakdown:

Pillar Score Max
PDA 27 30
Ease of Use 24 25
Spec Compliance 15 15
Writing Style 10 10
Utility 18 20
Base 94 100
Modifiers +5 ±15
Final 99 100

Task 6: Monorepo Organization ✅

What: Reorganize repository with plugins/ directory

Deliverables:

  • plugins/memory-query-plugin/ - Complete plugin structure

Final Structure:

plugins/memory-query-plugin/
├── .claude-plugin/
│   └── marketplace.json
├── skills/
│   └── memory-query/
│       ├── SKILL.md
│       └── references/
│           └── command-reference.md
├── commands/
│   ├── memory-search.md
│   ├── memory-recent.md
│   └── memory-context.md
├── agents/
│   └── memory-navigator.md
├── README.md
└── .gitignore

Dependencies

  • Phase 6 complete (memory-daemon query CLI working)
  • skill-creator skill for initialization
  • improving-skills skill for grading
  • creating-plugin-from-skill skill for plugin structure

Verification

# Verify plugin structure
ls -la plugins/memory-query-plugin/

# Verify manifest
cat plugins/memory-query-plugin/.claude-plugin/marketplace.json | jq .

# Verify skill
head -20 plugins/memory-query-plugin/skills/memory-query/SKILL.md

Notes

  • CCH hook integration (memory-ingest binary) was deferred to Phase 8
  • Plugin uses existing memory-daemon query CLI, not direct gRPC
  • Skill grading required 2 iterations to achieve > 95 score

07-RESEARCH

Phase 7: CCH Integration - Research

Researched: 2026-01-30 Updated: 2026-01-30 (reflects actual implementation) Domain: Claude Code plugins, marketplace format, agentic skills Confidence: HIGH (implementation complete)

Summary

This phase integrates agent-memory with Claude Code through a marketplace plugin that provides natural language commands for querying past conversations. The implementation followed the Progressive Disclosure Architecture (PDA) pattern and achieved a 99/100 skill grade.

What was built:

  1. memory-query-plugin - A full Claude Code marketplace plugin with:

    • Spec-compliant SKILL.md (99/100 grade)
    • 3 slash commands: /memory-search, /memory-recent, /memory-context
    • 1 autonomous agent: memory-navigator for complex queries
    • marketplace.json manifest for plugin registration
  2. Monorepo reorganization - Repository restructured with plugins/ directory

Deferred to future phase:

  • memory-ingest binary for CCH hook integration (CCH run action pattern)

Implemented Architecture

plugins/memory-query-plugin/
├── .claude-plugin/
│   └── marketplace.json       # Plugin manifest
├── skills/
│   └── memory-query/
│       ├── SKILL.md           # Core skill (99/100 grade)
│       └── references/
│           └── command-reference.md
├── commands/
│   ├── memory-search.md       # /memory-search <topic>
│   ├── memory-recent.md       # /memory-recent [--days N]
│   └── memory-context.md      # /memory-context <grip>
├── agents/
│   └── memory-navigator.md    # Autonomous agent for complex queries
├── README.md
└── .gitignore

Standard Stack

Core

Library Version Purpose Why Standard
memory-daemon CLI local Query interface Existing CLI with query subcommands
YAML frontmatter - Skill/command metadata Claude Code plugin spec
marketplace.json 1.0 Plugin manifest Claude Code marketplace format

Plugin Components

Component File Purpose
Skill skills/memory-query/SKILL.md Core capability definition
Command commands/memory-search.md /memory-search <topic>
Command commands/memory-recent.md /memory-recent [--days N]
Command commands/memory-context.md /memory-context <grip>
Agent agents/memory-navigator.md Complex multi-step queries

Plugin Manifest (marketplace.json)

{
  "name": "memory-query-agentic-plugin",
  "owner": {
    "name": "SpillwaveSolutions",
    "email": "rick@spillwave.com"
  },
  "metadata": {
    "description": "Query past conversations from the agent-memory system",
    "version": "1.0.0"
  },
  "plugins": [
    {
      "name": "memory-query",
      "description": "Query past conversations from the agent-memory system...",
      "source": "./",
      "strict": false,
      "skills": ["./skills/memory-query"],
      "commands": [
        "./commands/memory-search.md",
        "./commands/memory-recent.md",
        "./commands/memory-context.md"
      ],
      "agents": ["./agents/memory-navigator.md"]
    }
  ]
}

Skill Grading Results

The skill underwent iterative improvement using the improving-skills rubric:

Iteration Score Grade Key Changes
1 72/100 C Initial version with non-standard frontmatter
2 99/100 A Spec-compliant, 5 triggers, validation checklist

Final Score Breakdown:

Pillar Score Max Assessment
PDA 27 30 Concise SKILL.md, layered references
Ease of Use 24 25 5 triggers, clear workflow
Spec Compliance 15 15 Valid frontmatter, all conventions
Writing Style 10 10 Imperative, no marketing
Utility 18 20 Real capability gap, feedback loops
Base 94 100
Modifiers +5 ±15 Checklist, scope, triggers, metadata
Final 99 100 Grade: A

Command Implementations

/memory-search

Search past conversations by topic or keyword:

# Usage
/memory-search <topic>
/memory-search <topic> --period "last week"

# Implementation (via Bash tool)
memory-daemon query --endpoint http://[::1]:50051 root
memory-daemon query --endpoint http://[::1]:50051 browse --parent-id "toc:month:2026-01"

/memory-recent

Show recent conversation summaries:

# Usage
/memory-recent
/memory-recent --days 7

# Implementation
memory-daemon query --endpoint http://[::1]:50051 root
memory-daemon query --endpoint http://[::1]:50051 node --node-id "toc:day:2026-01-30"

/memory-context

Expand a grip to get full context:

# Usage
/memory-context <grip-id>

# Implementation
memory-daemon query --endpoint http://[::1]:50051 expand \
  --grip-id "grip:1706620800000:01ARZ3NDEKTSV4RRFFQ69G5FAV" \
  --before 3 --after 3

Autonomous Agent: memory-navigator

Handles complex queries that require multi-step navigation:

Triggers:

  • "what (did|were) we (discuss|talk|work)"
  • "(remember|recall|find).*(conversation|discussion|session)"
  • "(last|previous|earlier) (session|conversation|time)"
  • "context from (last|previous|yesterday|last week)"

Capabilities:

  1. Multi-period navigation across weeks/months
  2. Keyword aggregation and correlation
  3. Grip chain following for conversation threads
  4. Synthesis and summary generation

Deferred Work: CCH Hook Integration

The original plan included a memory-ingest binary for CCH integration. This was deferred to a future phase. The research for that component remains valid:

memory-ingest Binary (Future Phase)

# hooks.yaml configuration (deferred)
rules:
  - name: capture-to-memory
    description: Send events to agent-memory daemon
    matchers:
      operations:
        - SessionStart
        - UserPromptSubmit
        - PostToolUse
        - SessionEnd
    actions:
      run: "~/.local/bin/memory-ingest"

Implementation pattern:

  • Read CCH JSON from stdin
  • Map to memory events via hook_mapping module
  • Ingest via gRPC MemoryClient
  • Return {"continue": true} JSON to CCH

Installation

# Clone plugin to Claude Code skills directory
cd ~/.claude/skills
git clone https://github.com/SpillwaveSolutions/memory-query-agentic-plugin.git

# Or symlink from workspace
ln -s /path/to/agent-memory/plugins/memory-query-plugin ~/.claude/skills/

Validation Checklist

Before using the skill:

  • Daemon running: memory-daemon status returns "running"
  • TOC populated: root command returns year nodes
  • Query returns results: Check for non-empty bullets arrays
  • Grip IDs valid: Format matches grip:{13-digit-ms}:{26-char-ulid}

Sources

Primary (HIGH confidence)

  • plugins/memory-query-plugin/ - Actual implementation
  • /Users/richardhightower/.claude/skills/skill-creator/ - Skill creation guidelines
  • /Users/richardhightower/.claude/skills/improving-skills/ - Grading rubric
  • /Users/richardhightower/.claude/skills/creating-plugin-from-skill/ - Plugin structure

Secondary (MEDIUM confidence)

  • Claude Code marketplace documentation
  • PDA (Progressive Disclosure Architecture) best practices

Metadata

Confidence breakdown:

  • Plugin structure: HIGH - Implementation complete and validated
  • Skill grading: HIGH - Scored 99/100 using official rubric
  • CLI integration: HIGH - Uses existing memory-daemon query commands
  • CCH integration: MEDIUM - Research complete but implementation deferred

Research date: 2026-01-30 Implementation date: 2026-01-30 Valid until: Stable (implementation complete)


Clone this wiki locally