Claudemem Orchestration logo

Claudemem Orchestration

Organization
MadAppGang
claudemem-orchestration

Use when orchestrating multi-agent code analysis with claudemem. Run claudemem once, share output across parallel agents. Enables parallel investigation, consensus analysis, and role-based command mapping.

Overview

PublisherMadAppGang
Repositoryclaude-code
Skill nameclaudemem-orchestration
Stars
281
Forks
26
Bundled files
Instructions only
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by MadAppGang on GitHub. Read the source before you install it.

Installation

Install the Claudemem Orchestration AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/MadAppGang/claude-code.git /tmp/claude-code
mkdir -p .claude/skills
cp -r /tmp/claude-code/plugins/code-analysis/skills/claudemem-orchestration .claude/skills/claudemem-orchestration
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Claudemem Orchestration in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Claudemem Orchestration on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Claudemem Orchestration is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Claudemem Multi-Agent Orchestration

Version: 1.1.0 Purpose: Coordinate multiple agents using shared claudemem output

Overview

When multiple agents need to investigate the same codebase:

  1. Run claudemem ONCE to get structural overview
  2. Write output to shared file in session directory
  3. Launch agents in parallel - all read the same file
  4. Consolidate results with consensus analysis

This pattern avoids redundant claudemem calls and enables consensus-based prioritization.

For parallel execution patterns, see: orchestration:multi-model-validation skill

Claudemem-Specific Patterns

This skill focuses on claudemem-specific orchestration. For general parallel execution:

  • 4-Message Pattern - See orchestration:multi-model-validation Pattern 1
  • Session Setup - See orchestration:multi-model-validation Pattern 0
  • Statistics Collection - See orchestration:multi-model-validation Pattern 7

Pattern 1: Shared Claudemem Output

Purpose: Run expensive claudemem commands ONCE, share results across agents.

bash
# Create unique session directory (per orchestration:multi-model-validation Pattern 0)
SESSION_ID="analysis-$(date +%Y%m%d-%H%M%S)-$(head -c 4 /dev/urandom | xxd -p)"
SESSION_DIR="/tmp/${SESSION_ID}"
mkdir -p "$SESSION_DIR"

# Run claudemem ONCE, write to shared files
claudemem --agent map "feature area" > "$SESSION_DIR/structure-map.md"
claudemem --agent test-gaps > "$SESSION_DIR/test-gaps.md" 2>&1 || echo "No gaps found" > "$SESSION_DIR/test-gaps.md"
claudemem --agent dead-code > "$SESSION_DIR/dead-code.md" 2>&1 || echo "No dead code" > "$SESSION_DIR/dead-code.md"

# Export session info
echo "$SESSION_ID" > "$SESSION_DIR/session-id.txt"

Why shared output matters:

  • Claudemem indexing is expensive (full AST parse)
  • Same index serves all queries in session
  • Parallel agents reading same file = no redundant computation

Pattern 2: Role-Based Agent Distribution

After running claudemem, distribute to role-specific agents:

# Parallel Execution (ONLY Task calls - per 4-Message Pattern)
Task: architect-detective
  Prompt: "Analyze architecture from $SESSION_DIR/structure-map.md.
           Focus on layer boundaries and design patterns.
           Write findings to $SESSION_DIR/architect-analysis.md"
---
Task: tester-detective
  Prompt: "Analyze test gaps from $SESSION_DIR/test-gaps.md.
           Prioritize coverage recommendations.
           Write findings to $SESSION_DIR/tester-analysis.md"
---
Task: developer-detective
  Prompt: "Analyze dead code from $SESSION_DIR/dead-code.md.
           Identify cleanup opportunities.
           Write findings to $SESSION_DIR/developer-analysis.md"

All 3 execute simultaneously (3x speedup!)

Pattern 3: Consolidation with Ultrathink

Task: ultrathink-detective
  Prompt: "Consolidate analyses from:
           - $SESSION_DIR/architect-analysis.md
           - $SESSION_DIR/tester-analysis.md
           - $SESSION_DIR/developer-analysis.md

           Create unified report with prioritized action items.
           Write to $SESSION_DIR/consolidated-analysis.md"

Pattern 4: Consolidated Feedback Reporting (v0.8.0+)

When multiple agents perform searches, consolidate feedback for efficiency.

Why Consolidate?

  • Avoid duplicate feedback submissions
  • Single point of failure handling
  • Cleaner session cleanup

Shared Feedback Collection:

Each agent writes feedback to a shared file in the session directory:

bash
# Agent writes feedback entry (atomic with flock)
report_agent_feedback() {
  local query="$1"
  local helpful="$2"
  local unhelpful="$3"

  # Use file locking to prevent race conditions
  (
    flock -x 200
    printf '%s|%s|%s\n' "$query" "$helpful" "$unhelpful" >> "$SESSION_DIR/feedback.log"
  ) 200>"$SESSION_DIR/feedback.lock"
}

# Usage in agent
report_agent_feedback "$SEARCH_QUERY" "$HELPFUL_IDS" "$UNHELPFUL_IDS"

Orchestrator Consolidation:

After all agents complete, the orchestrator submits all feedback:

bash
consolidate_feedback() {
  local session_dir="$1"
  local feedback_log="$session_dir/feedback.log"

  # Skip if no feedback collected
  [ -f "$feedback_log" ] || return 0

  # Check if feedback command available (v0.8.0+)
  if ! claudemem feedback --help 2>&1 | grep -qi "feedback"; then
    echo "Note: Search feedback requires claudemem v0.8.0+"
    return 0
  fi

  local success=0
  local failed=0

  while IFS='|' read -r query helpful unhelpful; do
    # Skip empty lines
    [ -n "$query" ] || continue

    if timeout 5 claudemem feedback \
      --query "$query" \
      --helpful "$helpful" \
      --unhelpful "$unhelpful" 2>/dev/null; then
      ((success++))
    else
      ((failed++))
    fi
  done < "$feedback_log"

  echo "Feedback: $success submitted, $failed failed"

  # Cleanup
  rm -f "$feedback_log" "$session_dir/feedback.lock"
}

# Call after consolidation
consolidate_feedback "$SESSION_DIR"

Multi-Agent Workflow Integration:

Phase 1: Session Setup
  └── Create SESSION_DIR with feedback.log

Phase 2: Parallel Agent Execution
  └── Agent 1: Search → Track → Write feedback entry
  └── Agent 2: Search → Track → Write feedback entry
  └── Agent 3: Search → Track → Write feedback entry

Phase 3: Results Consolidation
  └── Consolidate agent outputs

Phase 4: Feedback Consolidation (NEW)
  └── Read all feedback entries from log
  └── Submit each to claudemem
  └── Report success/failure counts

Phase 5: Cleanup
  └── Remove SESSION_DIR (includes feedback files)

Best Practices Update:

Do:

  • Use file locking for concurrent writes (flock -x)
  • Consolidate feedback AFTER agent completion
  • Report success/failure counts
  • Clean up feedback files after submission

Don't:

  • Submit feedback from each agent individually
  • Skip the version check
  • Block on feedback submission failures
  • Track feedback for non-search commands (map, symbol, callers, etc.)

Role-Based Command Mapping

Agent RolePrimary CommandsSecondary CommandsFocus
Architectmap, dead-codecontextStructure, cleanup
Developercallers, callees, impactsymbolModification scope
Testertest-gapscallersCoverage priorities
Debuggercontext, impactsymbol, callersError tracing
UltrathinkALLALLComprehensive

Sequential Investigation Flow

For complex bugs or features requiring ordered investigation:

Phase 1: Architecture Understanding
  claudemem --agent map "problem area"  Identify high-PageRank symbols (> 0.05)

Phase 2: Symbol Deep Dive
  For each high-PageRank symbol:
    claudemem --agent context <symbol>    Document dependencies and callers

Phase 3: Impact Assessment (v0.4.0+)
  claudemem --agent impact <primary-symbol>  Document full blast radius

Phase 4: Gap Analysis (v0.4.0+)
  claudemem --agent test-gaps --min-pagerank 0.01  Identify coverage holes in affected code

Phase 5: Action Planning
  Prioritize by: PageRank * impact_depth * test_coverage

Agent System Prompt Integration

When an agent needs deep code analysis, it should reference the claudemem skill:

yaml
---
skills: code-analysis:claudemem-search, code-analysis:claudemem-orchestration
---

The agent then follows this pattern:

  1. Check claudemem status: claudemem status
  2. Index if needed: claudemem index
  3. Run appropriate command based on role
  4. Write results to session file for sharing
  5. Return brief summary to orchestrator

Best Practices

Do:

  • Run claudemem ONCE per investigation type
  • Write all output to session directory
  • Use parallel execution for independent analyses (see orchestration:multi-model-validation)
  • Consolidate with ultrathink for cross-perspective insights
  • Handle empty results gracefully

Don't:

  • Run same claudemem command multiple times
  • Let each agent run its own claudemem (wasteful)
  • Skip the consolidation step
  • Forget to clean up session directory (automatic TTL cleanup via session-start.sh)

Session Lifecycle Management

Automatic TTL Cleanup:

The session-start.sh hook automatically cleans up expired session directories:

  • Default TTL: 24 hours
  • Runs at session start
  • Cleans /tmp/analysis-*, /tmp/review-* directories older than TTL
  • See plugins/code-analysis/hooks/session-start.sh for implementation

Manual Cleanup:

bash
# Clean up specific session
rm -rf "$SESSION_DIR"

# Clean all old sessions (24+ hours)
find /tmp -maxdepth 1 -name "analysis-*" -o -name "review-*" -mtime +1 -exec rm -rf {} \;

Error Handling Templates

For robust orchestration, handle common claudemem errors. See claudemem-search skill for complete error handling templates:

Empty Results

bash
RESULT=$(claudemem --agent map "query" 2>/dev/null)
if [ -z "$RESULT" ] || echo "$RESULT" | grep -q "No results found"; then
  echo "No results - try broader keywords or check index status"
fi

Version Compatibility

bash
# Check if command is available (v0.4.0+ commands)
if claudemem --agent dead-code 2>&1 | grep -q "unknown command"; then
  echo "dead-code requires claudemem v0.4.0+"
  echo "Fallback: Use map command instead"
fi

Index Status

bash
# Verify index before running commands
if ! claudemem status 2>&1 | grep -qE "[0-9]+ (chunks|symbols)"; then
  echo "Index not found - run: claudemem index"
  exit 1
fi

Reference: For complete error handling patterns, see templates in code-analysis:claudemem-search skill (Templates 1-5)


Maintained by: MadAppGang Plugin: code-analysis v2.8.0 Last Updated: December 2025 (v1.1.0 - Search feedback protocol support)

Frequently asked questions

What does the Claudemem Orchestration AI skill do?

Use when orchestrating multi-agent code analysis with claudemem. Run claudemem once, share output across parallel agents. Enables parallel investigation, consensus analysis, and role-based command mapping.

Why use Claudemem Orchestration on TypingMind?

Because you install it once and use it with any model. Claudemem Orchestration is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Claudemem Orchestration in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/MadAppGang/claude-code/tree/main/plugins/code-analysis/skills/claudemem-orchestration. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Claudemem Orchestration?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Claudemem Orchestration?

As many as you like. As long as a model supports skills, you can use Claudemem Orchestration with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Claudemem Orchestration AI skill free?

Yes. It is published on GitHub by MadAppGang under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇