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.
curl -O https://raw.githubusercontent.com/defog-ai/defog/main/CLAUDE.mdgit clone --depth 1 https://github.com/defog-ai/defogWrote 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.
[](https://agentmods.dev/instructions/defog-ai/defog/claude-md)<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.
<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>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.
| Model | Per session | Once 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 |
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.
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.mdand in thedocs/folder
Linting and Checking
- Use
ruff checkto make sure your implementations are not broken - Use
ruff formatfor 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_asyncfunction and its associated parameters (includingresponse_format,reasoning_effort, andtools) - 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 .envargument 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.pyas per-1k-token rates. - When adding or updating an entry, use ONLY the provider's official pricing page:
- OpenAI: https://developers.openai.com/api/docs/pricing
- Anthropic (Claude): https://platform.claude.com/docs/en/about-claude/models/overview
- 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 matchinggpt-5-minientry — look each model up on the source page.
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.
- 2mo ago First seen · 34 lines · 607 tokens per session scan A 5c787c3f3bb0
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.
defog CLAUDE.md compared with instructions from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| defog CLAUDE.mddefog-ai/defog | Instructions file | 55 | 16d ago | MIT | A | 607 | Claude Code |
| vscode buildNext.instructions.mdmicrosoft/vscode | Instructions file | 195k | yesterday | MIT | A | 9,719 | GitHub Copilot |
| next.js AGENTS.mdvercel/next.js | Instructions file | 143k | yesterday | MIT | A | 7,461 | Codex, OpenCode |
| langchain AGENTS.mdlangchain-ai/langchain | Instructions file | 149k | yesterday | MIT | A | 4,680 | Codex, OpenCode |
| vscode oss-third-party-notices.instructions.mdmicrosoft/vscode | Instructions file | 195k | yesterday | MIT | A | 5,516 | GitHub Copilot |
| vscode copilot-instructions.mdmicrosoft/vscode | Instructions file | 195k | yesterday | MIT | A | 3,093 | GitHub Copilot |
| deepseek-harness AGENTS.mddeepseek-ai/deepseek-harness | Instructions file | 274k | 2d ago | MIT | A | 4,313 | Codex, OpenCode |