Two modes
Capture mode
Activated at the start of a session. Logs every capability gap to a JSONL file as work proceeds. Claude continues all tasks normally — the only change is that every “I can’t” also writes a structured log entry.
Review mode
Summarises an existing gap log into a ranked integration roadmap. Groups gaps by capability type, scores by frequency and impact, and outputs the highest-leverage integrations to build first.
Invocation
./magic-fetch.jsonl in the current working directory.
Capture mode workflow
Activate
Confirm the log file path (default:
./magic-fetch.jsonl). Create it if it doesn’t exist. Claude announces: Magic fetch active. I'll log every capability gap to {path}.Proceed normally
Claude carries out all tasks as usual. The only change is that every capability gap now also writes a log entry. No tasks are blocked or deferred.
Log every gap
Whenever Claude cannot perform a requested action due to a missing tool, access, data, or permission, it appends one JSON entry to the JSONL file before or alongside explaining the limitation.Each entry contains:
After writing, Claude outputs inline:
| Field | Description |
|---|---|
ts | ISO 8601 timestamp |
session_task | What the user was trying to accomplish |
requested | The specific action Claude attempted |
missing | The exact capability, data, or permission that was absent |
capability_type | Category (see below) |
would_need | Concrete solution: MCP server name, API name, permission scope |
impact | high / medium / low — how much this blocked the user’s goal |
notes | Optional context about frequency, workarounds, priority signals |
[gap logged: {would_need} — {capability_type}]Capability types
Every gap entry is assigned exactly one of thesecapability_type values:
| Type | Examples |
|---|---|
code_repository | GitHub, GitLab, Bitbucket: PRs, commits, branches, issues |
code_execution | Running code in a remote env, container, or specific runtime |
external_api | Any third-party API (Datadog, Sentry, Stripe, Slack, etc.) |
file_system | Files outside the working directory, remote paths, cloud storage |
database | Querying a database, data warehouse, or cache |
observability | Metrics, logs, traces, dashboards (Grafana, Datadog, etc.) |
web_fetch | Fetching a URL, scraping a page, calling a public endpoint |
authentication | Credentials, secrets, tokens, OAuth flows |
internal_tool | Company-internal system with no public API |
realtime_data | Live data: stock prices, weather, current status, deploys |
human_approval | Requires a human decision or sign-off |
other | Anything that doesn’t fit above |
Gap log format
Each gap is one line of JSONL (newline-delimited JSON):Review mode workflow
Load and parse the log
Read the JSONL file line by line. If the file is empty or missing, inform the user no gaps have been captured yet.
Cluster by capability type
Group all entries by
capability_type. Count frequency per type. Within each cluster, collect all unique would_need values.Score by frequency and impact
For each Sort clusters descending by score.
capability_type cluster, compute a priority score:Output the roadmap
Produce a ranked table of integrations followed by per-integration details (top 5, or all if ≤10 total):
Each integration detail includes: gap count, sessions affected, specific actions that were blocked, a concrete install path, and estimated complexity (low / medium / high).
| Rank | Integration | Type | Gaps logged | Impact | Example use case |
|---|---|---|---|---|---|
| 1 | GitHub MCP server | code_repository | 12 | 8 high, 4 med | List open PRs, view commits |
| 2 | Datadog MCP server | observability | 8 | 7 high, 1 low | Error rates, service latency |
Self-review checklist
Before delivering, verify all of the following:- Log file path was confirmed with the user or defaulted to
./magic-fetch.jsonl - Every gap entry contains:
ts,session_task,requested,missing,capability_type,would_need,impact - No gap was silently dropped — every “I can’t” has a corresponding log entry
[gap logged: ...]confirmation shown for each entry- Review mode produces a ranked table, not a raw log dump
- Review mode ends with: “Based on X gaps across Y sessions, the highest-leverage first integration is: Z.”
Golden rules
1. Log before you explain
1. Log before you explain
Write the gap entry to the file before or alongside telling the user you can’t do something. Never explain first and forget to log.
2. Be specific about what's missing
2. Be specific about what's missing
“No internet access” is useless. “GitHub API access to list commits for repo X” is useful. Every entry must name the specific data, endpoint, or permission needed.
3. Include the user's intent
3. Include the user's intent
The log must capture what the user was trying to accomplish, not just what Claude couldn’t do. This is what makes the roadmap actionable.
4. One entry per gap, not per turn
4. One entry per gap, not per turn
If a single turn has 3 capability walls, log 3 entries.
5. Never suppress gaps out of politeness
5. Never suppress gaps out of politeness
If it would embarrass Claude to log it, that’s exactly when to log it.
6. Review produces a roadmap, not a list
6. Review produces a roadmap, not a list
Gaps must be clustered, ranked, and presented as integration candidates with concrete next steps — not a raw log dump.
Reference files
| File | Contents |
|---|---|
CAPTURE.md | JSON schema for gap entries, detection patterns, impact scoring guide, examples |
REVIEW.md | Clustering strategy, priority scoring formula, roadmap output format |