defog: Instructions file for Claude Code

CLAUDE.md

defog CLAUDE.md is an instructions file for Claude Code from defog-ai/defog. It costs 607 tokens per session, scanned A, original, MIT.

A project instruction file describing how an agent should behave while working on the defog-ai/defog codebase. It covers documentation updates, code checks, pull-request reviews, and model use.

In plain words
What is it for?
Use it when contributing to defog-ai/defog, especially when changing code, updating docs, running lint checks, or reviewing pull requests.
Why use it?
It gives the agent project-specific expectations that general coding instructions may not include. This helps keep changes, reviews, and documentation consistent with the repository.

Instructions file for Claude Code

Written for Claude Code: the file is CLAUDE.md.

This is defog-ai/defog's own configuration. It tells Claude Code how to work on defog 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 defog configures →

Reuse

Borrowing it

Nothing to install: this file belongs to defog-ai/defog. 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/defog-ai/defog/main/CLAUDE.md
Clone the repo
git clone --depth 1 https://github.com/defog-ai/defog

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 defog CLAUDE.md

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

Your own site · 80×15
<a href="https://agentmods.dev/instructions/defog-ai/defog/claude-md"><img src="https://agentmods.dev/badge/instructions/defog-ai/defog/claude-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 607 This file is loaded in full into every session.
When invoked 607 The same file — it is already loaded in full.
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.00607 $0.00607
Opus 5.5 $0.00243 $0.00243
Sonnet 5.5 $0.00121 $0.00121
Haiku 4.5 $0.00061 $0.00061

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

Security

Grade A, and why

defog 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 2mo 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 · 34 lines

What it actually says

General Behaviour

  • Do not be obsequious. Do not say "You are absolutely right" or "You are right". You do not have to please the user – you just need to make the code work.
  • Do NOT use emotional words or exclaimations like "Perfect!", or "Great!". Be more stoic

Updating documentation

  • After you implement or change code, always remember to check if you need to update documentation. Documentation is in README.md and in the docs/ folder

Linting and Checking

  • Use ruff check to make sure your implementations are not broken
  • Use ruff format for code formatting

Reviewing PRs

  • Be honest, technically focused, and blunt. Pay special attention to security issues.

Using LLMs

  • Recall that this is 2025 and that new LLM models have been released.
    • Claude 4 Sonnet and Claude 4 Opus are now valid models
    • OpenAI's gpt-4.1, o3, and o4-mini are now valid models
    • Gemini's 2.5 flash and 2.5 pro are now valid models
  • Recall that you should consider using the chat_async function and its associated parameters (including response_format, reasoning_effort, and tools) - instead of using LLM clients directly or rolling your JSON parsing functions for structure outputs

Testing

  • Remember to run all tests with python -m pytest .... This is to ensure you are using the correct version of python and pytest
  • Add PYTHONPATH=. when running tests, so that the tests/examples use the version of defog in this repo - instead of the machine installed version
  • Use the --envfile .env argument to load environment variables (API keys etc.) when running tests
  • Try to run scoped tests that directly affect changed code instead of running all tests at once

Model Pricing

  • Prices live in defog/llm/cost/models.py as per-1k-token rates.
  • When adding or updating an entry, use ONLY the provider's official pricing page:
  • Convert the published per-1M-token numbers to per-1k (divide by 1000). Keys are input_cost_per1k, cached_input_cost_per1k, output_cost_per1k, and (for Anthropic) cache_creation_input_cost_per1k.
  • Do not infer prices from neighbouring entries or prior versions. A newer tier name (e.g. gpt-5.4-mini) does not necessarily share pricing with the matching gpt-5-mini entry — look each model up on the source page.
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. 2mo ago First seen · 34 lines · 607 tokens per session scan A 5c787c3f3bb0

Subscribe to this mod's changes

defog CLAUDE.md is an instructions file published in the GitHub repository defog-ai/defog (55 stars, last pushed 16d ago), licensed MIT. It adds 607 tokens to every session, about $0.0024 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-30.

Related

defog CLAUDE.md compared with instructions from other repositories

defog CLAUDE.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
defog CLAUDE.mddefog-ai/defogInstructions file5516d agoMITA607Claude Code
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA9,719GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file143kyesterdayMITA7,461Codex, OpenCode
langchain AGENTS.mdlangchain-ai/langchainInstructions file149kyesterdayMITA4,680Codex, OpenCode
vscode oss-third-party-notices.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA5,516GitHub Copilot
vscode copilot-instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA3,093GitHub Copilot
deepseek-harness AGENTS.mddeepseek-ai/deepseek-harnessInstructions file274k2d agoMITA4,313Codex, OpenCode