c-programming-language

c-programming-language is a skill for Claude Code, Codex from DamiMartinez/book-skills. It costs 167 tokens per session (1,379 once invoked), scanned A, original, MIT.

A C-programming guide based on Kernighan and Ritchie’s *The C Programming Language*, 2nd Edition. It covers pointers, arrays, memory ownership, undefined behavior, compilation, and other core C concepts.

In plain words
What is it for?
It is for C programming tasks, including code writing, reviews, debugging, and explanations of C behavior.
Why use it?
It gives a consistent way to write, review, debug, and explain C while accounting for the language’s limited runtime safety checks.

Skill for Claude CodeCodex

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

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.

agentmods
npx agentmods add skills/damimartinez/book-skills/c-programming-language
Any agent
npx skills add DamiMartinez/book-skills --skill c-programming-language
Clone the repo
git clone --depth 1 https://github.com/DamiMartinez/book-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 c-programming-language

README.md
[![agentmods](https://agentmods.dev/badge/skills/damimartinez/book-skills/c-programming-language.svg)](https://agentmods.dev/skills/damimartinez/book-skills/c-programming-language)
Your own site
<a href="https://agentmods.dev/skills/damimartinez/book-skills/c-programming-language"><img src="https://agentmods.dev/badge/skills/damimartinez/book-skills/c-programming-language.svg" alt="Measured on agentmods" height="20"></a>
Per session 167 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,379 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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.00167 $0.01379
Opus 5 $0.00084 $0.00690
Sonnet 5 $0.00033 $0.00276
Haiku 4.5 $0.00017 $0.00138

Measured 6d ago against content hash 87a4ecb37ea6, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

c-programming-language 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 6d 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/c-programming-language/SKILL.md · 43 lines

How it starts

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

The C Programming Language (K&R, 2nd Edition)

Apply this skill when writing, reviewing, or debugging C code, or explaining C semantics — grounded in K&R's philosophy that C trusts the programmer completely: no hidden costs, no runtime safety net, and correctness is the programmer's explicit responsibility at every step.

Core concepts

"Trust the programmer" — C deliberately omits bounds checking, garbage collection, and most runtime safety nets, on the premise the programmer knows what they're doing and wants no hidden cost. This means C code that "looks fine" can still be wrong in ways the compiler won't catch — when reviewing C, actively look for what the language won't stop, not just syntax errors.

Pointer/array duality & pointer arithmetica[i] is defined as *(a + i); arrays decay to pointers in most expressions, and pointer arithmetic is scaled by the pointee's size automatically. Understanding this equivalence is the key to reading and writing idiomatic C (pointer-walking a buffer instead of indexing, passing arrays as pointer+length). When debugging array/pointer code, mentally rewrite between the two forms to spot off-by-one or scaling errors.

Declarations mirror use (the right-left / "spiral" rule) — A declaration like int *a[10] or int (*a)[10] should be read by working outward from the identifier following C's precedence rules ([] and () bind tighter than *), not left-to-right. When a declaration is confusing (arrays of pointers, pointers to functions, pointers to arrays), decompose it this way rather than guessing — this is the single most common source of "wait, what does this even declare" confusion in C.

Manual memory management & ownership — Every malloc/calloc needs an unambiguous owner responsible for exactly one matching free; there's no garbage collector to fall back on. When reviewing allocation code, explicitly trace: who allocates, who's responsible for freeing, and what happens on every exit path (including error returns) — leaks and double-frees are almost always a broken answer to "who owns this."

Read the full file on GitHub · 43 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. 6d ago First seen · 43 lines · 167 tokens per session scan A 87a4ecb37ea6

Subscribe to this mod's changes

c-programming-language is a skill published in the GitHub repository DamiMartinez/book-skills (11 stars, last pushed 1mo ago), licensed MIT. It adds 167 tokens to every session and 1,379 once invoked, about $0.0008 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

matlab

Build, review, migrate, and safely plan MATLAB or GNU Octave numerical workflows, including arrays, tabular/time data, tests, projects, graphics, MAT files, and explicit Python interoperability.

K-Dense-AI/scientific-agent-skills · 42 tokens

ast-grep

Guide for writing ast-grep rules to perform structural code search and analysis. Use when users need to search codebases using Abstract Syntax Tree (AST) patterns, find specific code structures, or perform complex code queries that go beyond simple text search. This skill should be used when users ask to search for…

JanDeDobbeleer/oh-my-posh · 80 tokens

platform-detection

Identify a .NET project's test platform, framework, command mode, and SDK-style vs classic project system. Use only for "which test platform/framework?", "VSTest or MTP?", or "what runner does this project use?", including bridge settings, UseVSTest opt-outs, and incompatible or conflicting VSTest/MTP configuration.…

dotnet/skills · 146 tokens

unity-version-split

Split a C# file into Unity 6.5+ and pre-Unity 6.5 variants. Use when a file needs different implementations for different Unity versions due to API changes (e.g., EntityId vs int, GetEntityId vs GetInstanceID).

IvanMurzak/Unity-MCP · 59 tokens

omh-rust

This is a Hermes-native rust workflow skill.

rlaope/oh-my-hermes · 69 tokens

migrate-better-result-3

Migrate a TypeScript codebase from better-result 2.x to 3.0. Use when upgrading better-result across the TaggedError syntax, removed Result serialization helpers, recovery inference, matching, or retry APIs.

dmmulroy/better-result · 52 tokens