search-before-debugging

search-before-debugging is a skill for Claude Code, Codex from hifriendbot/cogmemai-mcp. It costs 82 tokens per session (1,167 once invoked), scanned A, original, MIT.

A debugging workflow that searches CogmemAi for an existing solution before investigating a new error or unexpected behavior. CogmemAi is a memory store for fixes and patterns from earlier sessions.

In plain words
What is it for?
Use it when you see an error, failed test, regression, confusing output, build failure, or report that something broke. Search with the most distinctive symptom before running diagnostic commands or reading code.
Why use it?
It helps avoid repeating investigations for bugs that may already have a known solution. Searching first can make debugging faster and preserve earlier lessons.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it when you see an error, failed test, regression, confusing output, build failure, or report that something broke. Search with the most distinctive symptom before running diagnostic commands or reading code.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/hifriendbot/cogmemai-mcp/search-before-debugging
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add hifriendbot/cogmemai-mcp --skill search-before-debugging
Clone the repo
git clone --depth 1 https://github.com/hifriendbot/cogmemai-mcp

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for search-before-debugging

README.md
[![agentmods](https://agentmods.dev/badge/skills/hifriendbot/cogmemai-mcp/search-before-debugging/github.svg)](https://agentmods.dev/skills/hifriendbot/cogmemai-mcp/search-before-debugging)
Your own site
<a href="https://agentmods.dev/skills/hifriendbot/cogmemai-mcp/search-before-debugging"><img src="https://agentmods.dev/badge/skills/hifriendbot/cogmemai-mcp/search-before-debugging/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for search-before-debugging

Your own site · 80×15
<a href="https://agentmods.dev/skills/hifriendbot/cogmemai-mcp/search-before-debugging"><img src="https://agentmods.dev/badge/skills/hifriendbot/cogmemai-mcp/search-before-debugging.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 82 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,167 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00082 $0.01167
Opus 5.5 $0.00033 $0.00467
Sonnet 5.5 $0.00016 $0.00233
Haiku 4.5 $0.00008 $0.00117

Measured 1mo ago against content hash b03d406a8dad, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

search-before-debugging scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skill/search-before-debugging/SKILL.md · 127 lines

How it starts

The opening of the file, as written. The whole thing — 127 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Search Before Debugging with CogmemAi

The single highest-leverage debugging habit: search for an existing fix before debugging from scratch. Most bugs in established codebases are repeats. Someone (you, a teammate, a past version of you) has already solved it. CogmemAi makes those fixes instantly findable.

This skill is the recall half of the bugfix loop. Pair it with the save-bugfix skill which captures fixes for future sessions to find.

When to Use

Trigger before any debugging action when you encounter:

  • An error message or stack trace
  • A failing test (especially flaky or new failures)
  • Unexpected behavior or output
  • A regression after a recent change
  • A user report of "it broke" or "this doesn't work"
  • Confusing log output
  • A build failure

The rule: search first, debug second. Always.

Call recall_memories with the most distinctive part of the symptom as the query. Pass context_type: "debugging" to bias the ranker toward bug and pattern memories.

recall_memories({
  query: "Cannot read properties of undefined Stripe webhook",
  context_type: "debugging",
  limit: 10
})

If the literal error string is too generic, also try:

  • The component name + the error type ("auth jwt token expired")
  • The library name + the symptom ("postgres connection pool exhausted")
  • The recent change that may have triggered it ("after migrating to Next 15, hydration mismatch")

Run two or three queries with different phrasings if the first returns nothing relevant. CogmemAi's semantic search will catch reformulations the keyword wouldn't.

What to Do With Results

A high-relevance match exists

Stop. Read the memory carefully. It contains the symptom, root cause, fix, and why-it-works that a past debugging session captured. Verify:

  1. The symptom in the memory matches your current bug closely
  2. The file path or component named in the fix still exists in the codebase
  3. The fix is still applicable (the underlying library, version, or architecture hasn't changed in a way that invalidates it)

Read the full file on GitHub · 127 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago First seen · 127 lines · 82 tokens per session scan A b03d406a8dad

Subscribe to this mod's changes

search-before-debugging is a skill published in the GitHub repository hifriendbot/cogmemai-mcp (7 stars, last pushed today), licensed MIT. It adds 82 tokens to every session and 1,167 once invoked, about $0.0003 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

inspector-workbench

Runs Inspector UI work on the standalone Threads state lab so the agent can see the overlay. Use when a CopilotKit employee asks an agent to fix, polish, add, or debug Inspector UI, chrome, panes, overlay actions, launcher, Home, Threads, Playground, Memory, or any visual behavior in @copilotkit/web-inspector. Don't…

CopilotKit/CopilotKit · 112 tokens

md-audit

Read-only code quality audit — scan the current working directory for common issues (bugs, dead code, security hotspots, missing error handling) and return a prioritised findings report. No files are edited. Use when asked to "audit the code", "quick audit", "find issues", "code scan", or "what's wrong with this…

chaitanyagiri/munder-difflin · 85 tokens

potpie-debug-memory

Use while debugging or troubleshooting failures, flaky tests, incidents, production alerts, CI failures, local dev setup issues, repeated bugs, prior fixes, failed attempts, and verification history.

potpie-ai/potpie · 41 tokens

browserwing-admin

Manage and operate BrowserWing — an intelligent browser automation platform. Install dependencies, configure LLM, create/manage/execute automation scripts, use AI-driven exploration to generate scripts, browse the script marketplace, and troubleshoot issues.

MemTensor/MemOS · 47 tokens

code-understand

Map the load-bearing files, symbols, callers, and dependencies of an unfamiliar codebase before making changes. Use for architecture orientation, impact analysis, what-would-break questions, or finding callers. Uses CodeGraph when available and a dependency-free builtin fallback.

Ar9av/obsidian-wiki · 55 tokens

exploiting-format-string-vulnerabilities

Methodology for exploiting format string bugs where attacker-controlled data reaches the format argument of printf-family functions, enabling stack/memory disclosure (info leaks for ASLR/PIE/canary defeat) and arbitrary write primitives (%n) to hijack control flow via GOT/.finiarray overwrites.

xalgorix/xalgorix · 69 tokens