ks-cookbook CLAUDE.md

ks-cookbook CLAUDE.md is an instructions file for Claude Code from knowledgestack/ks-cookbook. It costs 1,662 tokens per session, scanned A, original, MIT.

A set of instructions for contributing to Knowledge Stack Cookbook, a collection of Python demonstrations and small recipes built around a knowledge-retrieval service. The examples read document sections, include section citations, and create files such as Markdown, Word, or spreadsheet documents.

In plain words
What is it for?
Use it when adding or changing cookbook examples, choosing the right recipe structure, connecting to the service, producing cited output, and checking contributions before a pull request.
Why use it?
It gives contributors consistent rules for code style, file structure, metadata, testing, and how each example connects to the knowledge service.

Instructions file for Claude Code

Written for Claude Code: the file is CLAUDE.md. Also seen: mentions CLAUDE.md; mentions Claude Code; mentions Cursor.

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 instructions/knowledgestack/ks-cookbook/claude-md
Clone the repo
git clone --depth 1 https://github.com/knowledgestack/ks-cookbook

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 ks-cookbook CLAUDE.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/knowledgestack/ks-cookbook/claude-md.svg)](https://agentmods.dev/instructions/knowledgestack/ks-cookbook/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/knowledgestack/ks-cookbook/claude-md"><img src="https://agentmods.dev/badge/instructions/knowledgestack/ks-cookbook/claude-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 1,662 This file is loaded in full into every session.
When invoked 1,662 The same file — it is already loaded in full.
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.01662 $0.01662
Opus 5 $0.00831 $0.00831
Sonnet 5 $0.00332 $0.00332
Haiku 4.5 $0.00166 $0.00166

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

Security

Grade A, and why

ks-cookbook CLAUDE.md 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.

CLAUDE.md · 84 lines

How it starts

The opening of the file, as written. The whole thing — 84 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.

Style rules (load these first)

Before editing anything, read the cursor rules that mirror ks-backend's clean-code convention:

What this repo is

ks-cookbook is a uv workspace of 32 flagship agent demos plus a set of lightweight recipes that sit on top of Knowledge Stack. Every flagship uses the same pattern: connect to knowledgestack-mcp (stdio), enumerate a corpus folder, read chunks, produce structured output with real [chunk:<uuid>] citations, and write a file artifact (.md / .docx / .xlsx).

The ksapi dependency resolves from PyPI (ksapi>=0.1.0). No sibling checkout of ks-backend is required. If you want to develop against the local generated SDK instead, add a [tool.uv.sources] override pointing at ../ks-backend/codegen/ks-backend-python in your own working copy — don't commit it.

Commands

All targets assume .env with KS_API_KEY + (OPENAI_API_KEY or ANTHROPIC_API_KEY).

make setup                # uv sync --all-packages + check-env
make install-dev          # setup + install pre-commit hooks
make lint                 # ruff check . (line-length 100, ignores E501/UP042)
make fix                  # ruff check . --fix (imports, unused, etc.)
make format               # ruff format .
make test                 # reminder — MCP server tests live in the ks-mcp repo
make help                 # list every demo target
make demo-<name>          # run a single flagship (e.g. demo-credit-memo)
make recipe NAME=<dir> ARGS='...'   # run a recipe from recipes/<dir>/recipe.py
make clean                # delete generated sample outputs from every flagship

Read the full file on GitHub · 84 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 · 84 lines · 1,662 tokens per session scan A d42adc312400

Subscribe to this mod's changes

ks-cookbook CLAUDE.md is an instructions file published in the GitHub repository knowledgestack/ks-cookbook (9 stars, last pushed 1mo ago), licensed MIT. It adds 1,662 tokens to every session, about $0.0083 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-31.