debug-optimized-builds

debug-optimized-builds is a skill for Claude Code, Codex from mohitmishra786/low-level-dev-skills. It costs 104 tokens per session (1,887 once invoked), scanned A, original, MIT.

A guide to debugging programs compiled with optimization enabled, including release builds that still contain debugging information. It explains compiler optimizations, inlined functions, split-DWARF files, and messages such as “value optimized out.”

In plain words
What is it for?
Use it to select compiler and CMake debug settings, investigate release crashes, inspect inlined stack frames, fix confusing breakpoints, and understand unavailable variables.
Why use it?
Optimized code may move, combine, or remove values, so debugger output can differ from the source code. This guide helps choose a build that keeps useful debugging information while retaining some optimization.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: positional $N argument.

not rated 196repo +3 2mo ago A scan Socket: passSnyk: passSkillSpector: pass 104 tokens original MIT

Good fit Use it to select compiler and CMake debug settings, investigate release crashes, inspect inlined stack frames, fix confusing breakpoints, and understand unavailable variables.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/mohitmishra786/low-level-dev-skills/debug-optimized-builds
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 mohitmishra786/low-level-dev-skills --skill debug-optimized-builds
Clone the repo
git clone --depth 1 https://github.com/mohitmishra786/low-level-dev-skills

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 debug-optimized-builds

README.md
[![agentmods](https://agentmods.dev/badge/skills/mohitmishra786/low-level-dev-skills/debug-optimized-builds.svg)](https://agentmods.dev/skills/mohitmishra786/low-level-dev-skills/debug-optimized-builds)
Your own site
<a href="https://agentmods.dev/skills/mohitmishra786/low-level-dev-skills/debug-optimized-builds"><img src="https://agentmods.dev/badge/skills/mohitmishra786/low-level-dev-skills/debug-optimized-builds.svg" alt="Measured on agentmods" height="20"></a>
Per session 104 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,887 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. Third-party audits
  • Socket pass 18 Mar 2026
  • Snyk pass 4 Mar 2026
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00104 $0.01887
Opus 5 $0.00052 $0.00944
Sonnet 5 $0.00021 $0.00377
Haiku 4.5 $0.00010 $0.00189

Measured 8d ago against content hash 72e95562d87e, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

debug-optimized-builds 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 8d 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.

skills/debuggers/debug-optimized-builds/SKILL.md · 214 lines

How it starts

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

Debugging Optimized Builds

Purpose

Guide agents through debugging code compiled with optimization: choosing the right debug-friendly optimization level, reading inlined frames, diagnosing "value optimized out", using split-DWARF for faster debug builds, and applying GDB techniques specific to optimized code.

Triggers

  • "GDB says 'value optimized out' — what does that mean?"
  • "How do I debug a release build?"
  • "How do I see inlined function frames in GDB?"
  • "What's the difference between -O0 and -Og for debugging?"
  • "How do I use RelWithDebInfo with CMake?"
  • "Breakpoints in optimized code land on wrong lines"

Workflow

1. Choose the right build configuration

Goal?
├── Full debuggability, no optimization
│   → -O0 -g                        (slowest, all vars visible)
├── Debuggable, some optimization (recommended for most dev work)
│   → -Og -g                        (-Og keeps debug experience good)
├── Release build with debug info (shipped, debuggable crashes)
│   → -O2 -g -gsplit-dwarf          (or -O2 -g1 for lighter info)
└── Full release (no debug symbols)
    → -O2 -DNDEBUG

-Og: GCC's "debug-friendly optimization" — enables optimizations that don't interfere with debugging. Variables stay in registers where GDB can see them. Line numbers stay accurate. Best balance for development.

# GCC / Clang
gcc -Og -g -Wall main.c -o prog

# CMake build types
cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug          # -O0 -g
cmake -S . -B build -DCMAKE_BUILD_TYPE=RelWithDebInfo # -O2 -g -DNDEBUG
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release        # -O2 -DNDEBUG

2. "Value optimized out" — causes and workarounds

(gdb) print my_variable
$1 = <optimized out>

This means the compiler decided the variable's value doesn't need to be stored at this point — it might be:

  • Kept only in a register (not the one GDB is looking at)
  • Folded into a constant by constant propagation
  • Eliminated because it's not used after this point
  • Replaced by a later optimized value

Read the full file on GitHub · 214 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. 8d ago First seen · 214 lines · 104 tokens per session scan A 72e95562d87e

Subscribe to this mod's changes

debug-optimized-builds is a skill published in the GitHub repository mohitmishra786/low-level-dev-skills (196 stars, last pushed 2mo ago), licensed MIT. It adds 104 tokens to every session and 1,887 once invoked, about $0.0005 per session on Opus 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-30.

Related

Other skills, from other repositories

debugging

Systematically diagnose and fix software bugs by analyzing error messages, stack traces, logs, and runtime behavior across multiple languages. Use when the user requests debugging or provides relevant inputs for this workflow.

seb1n/awesome-ai-agent-skills · 41 tokens

log-analyzer

Parse agent log files to identify error patterns, rate limit hits, timeout clusters, tool failures, and component-level error counts. Produces a structured anomaly report. Cron-compatible — silent if no issues, alert digest if anomalies found. Also computes per-tool failure rates from a Hermes profile state.db…

moonlight-lupin/agent-skills · 69 tokens

error-handler

Design error handling, structured logging, and observability with OpenTelemetry (traces, metrics, logs), error classification, recovery patterns (retry with jitter, circuit breaker, bulkhead, timeout), error budgets/SLOs with burn rate alerts, and production incident triage. Use when user asks to implement error…

EliasOulkadi/shokunin · 125 tokens

performance-profiler

Performance profiling and optimization for web apps — Core Web Vitals (LCP, INP, CLS), Lighthouse audits, bundle analysis, backend profiling (CPU, memory, DB queries), N+1 detection, caching strategies (Redis, CDN, HTTP), and performance budgets. Use when user asks to improve performance, run Lighthouse audit, profile…

EliasOulkadi/shokunin · 118 tokens

scientific-debugging

A method for debugging software by observing the problem, forming possible explanations, running small experiments, and then fixing and checking the result.

VidyFoo/antigravity-skill-engine · 36 tokens

diagnosing-ml-failures

Isolate the root cause of ML performance drops, inconsistent evaluations, prediction errors, and training-serving mismatches across data, labels, splits, pipelines, models, metrics, and runtime behavior. Use when investigating a reproducible failure or regression, not routine model selection or general performance…

aiopshwang/data-analysis-ml-agent-skills · 65 tokens