hardened-images: Instructions file for Claude Code

CLAUDE.md

hardened-images CLAUDE.md is an instructions file for Claude Code from konstruktoid/hardened-images. It costs 2,736 tokens per session, scanned B, original, Apache-2.0.

Project instructions for working on hardened-images, a project that builds security-focused Ubuntu server disk images with Packer and Ansible.

In plain words
What is it for?
Use them when changing or building the project's QEMU or Azure images, configuring hardening, passing build options, or checking the generated files.
Why use it?
They explain the project structure, supported image targets, build commands, hardening process, software inventory generation, and cleanup steps.

Instructions file for Claude Code

Written for Claude Code: ${CLAUDE_PLUGIN_ROOT} variable. Also seen: reads .claude/ paths; mentions CLAUDE.md; mentions Claude Code.

This is konstruktoid/hardened-images's own configuration. It tells Claude Code how to work on hardened-images itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything hardened-images configures →

Runs only inside a plugin — its command needs a path that Claude Code sets for a plugin’s own hooks and for nothing else, and the catalogue could not identify which plugin ships it.

Reuse

Borrowing it

Nothing to install: this file belongs to konstruktoid/hardened-images. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/konstruktoid/hardened-images/master/CLAUDE.md
Clone the repo
git clone --depth 1 https://github.com/konstruktoid/hardened-images

Made for: Claude Code.

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 hardened-images CLAUDE.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/konstruktoid/hardened-images/claude-md/github.svg)](https://agentmods.dev/instructions/konstruktoid/hardened-images/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/konstruktoid/hardened-images/claude-md"><img src="https://agentmods.dev/badge/instructions/konstruktoid/hardened-images/claude-md/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 hardened-images CLAUDE.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/konstruktoid/hardened-images/claude-md"><img src="https://agentmods.dev/badge/instructions/konstruktoid/hardened-images/claude-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 2,736 This file is loaded in full into every session.
When invoked 2,736 The same file — it is already loaded in full.
Security scan B 2 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.02736 $0.02736
Opus 5 $0.01368 $0.01368
Sonnet 5 $0.00547 $0.00547
Haiku 4.5 $0.00274 $0.00274

Measured 4d ago against content hash 63499ce719bf, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade B, and why

hardened-images CLAUDE.md scanned grade B with 2 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 4d 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.

Asks for rootmediumPrivilege escalation

A mod that escalates privileges can change anything on the machine, not only the project.

the script. The sudo password travels the same way, as `SUDO_PASSWORD` in

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

actions by SHA, no curl-pipe-to-shell, explicit `timeout-minutes`/`concurrency`).
CLAUDE.md · 169 lines

How it starts

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

CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

Project overview

hardened-images builds hardened Ubuntu server images using Packer templates. Targets are an Azure virtual machine image and a local QEMU .qcow2 disk image (a former .ova target is documented in git history only). The QEMU target starts from the official Ubuntu cloud image; Ubuntu 26.04 LTS (Resolute Raccoon) is the default. Hardening is applied by the external konstruktoid/ansible-collection-hardening Ansible collection. The collection code is external; it is installed and configured by the Ansible playbook in config/local.yml (with settings from config/ansible.cfg). The collection has no umbrella role, so the playbook's role list is the hardening scope.

Commands

  • bash build_box.sh — builds the local .qcow2 image: generates a throwaway SSH keypair, boots the official Ubuntu cloud image in QEMU, configures it on first boot from the NoCloud cidata seed in seed/user-data.pkrtpl.hcl, provisions with the konstruktoid.hardening collection, generates an SBOM (scripts/sbom.sh, Syft) and then strips the ephemeral keypair (scripts/cleanup.sh, always last). Extra args are passed through to packer build, e.g. bash build_box.sh -var 'ssh_authorized_keys=["ssh-ed25519 ..."]'. That variable is what makes the built image reachable over SSH at all: config/local.yml sets sshd_password_authentication: false and scripts/cleanup.sh strips the ephemeral keypair, so an image built without it is only reachable on the console, with the build password. Output (.qcow2, .spdx.json, .cdx.json, CHECKSUMS) lands under a timestamped subdirectory of output/.
  • packer init -upgrade ubuntu-hardened-azure.pkr.hcl / packer validate ... / packer build ... — Azure image build. Requires Azure credentials; see azure_vars_export and scripts/azure.sh.
  • shellcheck -x -s bash -f gcc build_box.sh run_qemu.sh azure_vars_export scripts/*.sh tools/*.sh — required to pass; build_box.sh runs exactly this list itself.
  • packer fmt -check -diff . and packer validate must both pass for any .pkr.hcl change. build_box.sh runs packer validate before packer build.
  • pre-commit run --all-filesgitleaks, shellcheck, ansible-lint, packer fmt, detect-private-key, and the pre-commit-hooks hygiene set.
  • .github/workflows/lint.yml runs shellcheck, bash -n, packer fmt/validate and ansible-lint in CI, plus actionlint and zizmor over the workflows. gitleaks, detect-private-key and the hygiene hooks run in pre-commit only.
  • bash tools/vendor-agent-standards.sh — re-vendors instructions/ and .agents/skills/ from the pinned upstream ref, verifying that the ref still resolves to the pinned commit before it replaces anything.

Read the full file on GitHub · 169 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. 4d ago Changed · +4 lines · +67 tokens per session 63499ce719bf
  2. 7d ago Changed · +24 lines · +432 tokens per session d7262279c925
  3. 11d ago First seen · 141 lines · 2,237 tokens per session scan B 1fa88c440b36

Subscribe to this mod's changes

hardened-images CLAUDE.md is an instructions file published in the GitHub repository konstruktoid/hardened-images (90 stars, last pushed 3d ago), licensed Apache-2.0. It adds 2,736 tokens to every session, about $0.0137 per session on Opus 5. A static security scan graded it B with 2 findings (asks for root, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other instructions, from other repositories

next.js AGENTS.md

AGENTS.md instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.

vercel/next.js · 7,296 tokens

codex AGENTS.md

AGENTS.md instructions for openai/codex, covering rust/codex-rs, the codex-core crate, code review rules, crate api surface and model visible context.

openai/codex · 5,153 tokens

vscode buildNext.instructions.md

Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).

microsoft/vscode · 6,785 tokens

spec-kit AGENTS.md

AGENTS.md instructions for github/spec-kit, covering agents.md, about spec kit and specify, quickstart — add a new integration in 5 steps, integration architecture and integrationmanifest — file tracking.

github/spec-kit · 7,104 tokens

vscode oss-third-party-notices.instructions.md

Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, applying the notice (cutover) and fallback chain (never fail the build).

microsoft/vscode · 5,001 tokens

langchain AGENTS.md

AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.

langchain-ai/langchain · 4,469 tokens