Skip to content
Back to skills

Memtrace Cochange

ASecurity

Always use for historical coupling, co-change, what changes with this, hidden dependency, or what else needs to move questions for source code. Do not use git log, git diff, Grep, or manual file search to correlate changes; Memtrace queries co-change and temporal graph data directly.

  • 487 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added May 26, 2026
developmentrefactoringgit

Works with

  • mcp

Security analysis

A100/100

Scanned May 27, 2026

npx -y skills add syncable-dev/memtrace-public --skill memtrace-cochange --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Memtrace Cochange?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Memtrace Cochange
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/syncable-dev-memtrace-cochange/badge)](https://www.skillsdirectory.com/skills/syncable-dev-memtrace-cochange)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: memtrace-cochange
description: "Always use for historical coupling, co-change, what changes with this, hidden dependency, or what else needs to move questions for source code. Do not use git log, git diff, Grep, or manual file search to correlate changes; Memtrace queries co-change and temporal graph data directly."
---

## Overview

Find symbols that historically co-change with a target symbol — ranked by co-occurrence frequency across all episodes. This surfaces **behavioral coupling** that the static call graph cannot see.

`get_impact` answers "who calls this?" (structural).
`get_cochange_context` answers "what always moves when this moves?" (historical).

They are complementary. A symbol with no direct callers can still have strong cochange partners if it's always modified alongside another in every commit.

> **Parameter types:** MCP parameters are strictly typed. Numbers (`limit`, `depth`, `min_size`, `last_n`, etc.) must be JSON numbers — not strings. Use `limit: 20`, never `limit: "20"`. Passing a string yields `MCP error -32602: invalid type: string, expected usize`.


## Steps

### 1. Identify the target symbol

Use `find_symbol` if you need the exact name. The tool matches by `name` field.

### 2. Call `get_cochange_context`

```
get_cochange_context(
  repo_id: "...",
  symbol: "execute",    // exact symbol name
  limit: 20             // default 20, increase for broader view
)
```

### 3. Interpret results

The response contains `cochanges[]`, each with:
- `name` — symbol name
- `kind` — Function / Method / Class / Struct
- `file_path` — where it lives
- `cochange_count` — how many episodes it shared with the target

```
High cochange_count = strong historical coupling
→ If you modify the target, you will likely need to touch this too
→ Or it may be the real root cause you should investigate first
```

### 4. Cross-reference with call graph

For the top cochange partners, optionally run `get_impact` to see if the coupling is also structural:

| Structural coupling | Historical coupling | Interpretation |
|---|---|---|
| Yes | Yes | Core architectural dependency — highest risk |
| No | Yes | Hidden coupling — only visible through history |
| Yes | No | Called frequently but changed independently — lower risk |

## When to Use

- **Before modifying a symbol** — get blast awareness beyond what `get_impact` shows
- **Incident investigation** — when `get_impact` doesn't explain the blast radius, check cochange history
- **Code review** — verify that a PR touched all historically-coupled partners
- **Refactoring** — discover implicit coupling before extracting a module

## Common Mistakes

| Mistake | Reality |
|---------|---------|
| Only using `get_impact` for blast radius | Structural coupling misses behavioral coupling — always pair with cochange |
| Ignoring low-`in_degree` cochange partners | A rarely-called utility with high cochange_count is a strong coupling signal |
| Using cochange as a dependency map | It's not a dependency graph — it's a change correlation. Two symbols can cochange without any direct relationship. |

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.