dive: Instructions file for Claude Code

CLAUDE.md

dive CLAUDE.md is an instructions file for Claude Code from deepnoodle-ai/dive. It costs 2,753 tokens per session, scanned A, original, Apache-2.0.

A project guide for Dive, a Go library for building AI agents and connecting them to language-model providers. It explains the project overview, commands, architecture, and main types.

In plain words
What is it for?
Use it when working on Dive code, running its tests, building its optional command-line tool, or learning where agent, tool, session, and language-model behavior is defined.
Why use it?
It gives an unfamiliar contributor the context needed to understand how agents, tools, extensions, sessions, and model interfaces fit together.

Instructions file for Claude Code

Written for Claude Code: PreToolUse hook event. Also seen: mentions CLAUDE.md; mentions subagents; mentions Claude Code.

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

Reuse

Borrowing it

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

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

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

Your own site · 80×15
<a href="https://agentmods.dev/instructions/deepnoodle-ai/dive/claude-md"><img src="https://agentmods.dev/badge/instructions/deepnoodle-ai/dive/claude-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 2,753 This file is loaded in full into every session.
When invoked 2,753 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.02753 $0.02753
Opus 5.5 $0.01101 $0.01101
Sonnet 5.5 $0.00551 $0.00551
Haiku 4.5 $0.00275 $0.00275

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

Security

Grade A, and why

dive 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 1mo 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 · 98 lines

How it starts

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

CLAUDE.md

Project Overview

Dive is a Go library for building AI agents and integrating with leading LLMs. Library-first approach — the CLI in experimental/cmd/dive/ is secondary.

Commands

  • go test ./... — Run all tests
  • cd experimental/cmd/dive && go build — Build the CLI (optional)
  • Use github.com/deepnoodle-ai/wonton/assert for all tests

Architecture

Core Types

  • Agent (agent.go): Created via NewAgent(AgentOptions), returns *Agent. Manages tool execution and conversation.
  • Extension (agent.go): Extension interface (Tools, Hooks, Rules) for composable agent capabilities. Set on AgentOptions.Extensions. Extensions provide tools, hooks, and system prompt rules that are merged during NewAgent.
  • Session (dive.go): Session interface (ID, Messages, SaveTurn). Set on AgentOptions.Session or per-call via WithSession. The session package provides New() (in-memory) and store-backed implementations.
  • LLM (llm/llm.go): LLM and StreamingLLM interfaces abstract over providers.
  • Tool (tool.go): Tool and TypedTool[T] interfaces. FuncTool[T]() creates tools from functions with auto-generated schemas. Toolset interface provides dynamic tool resolution per LLM request. Tool panics are auto-recovered. All toolkit constructors return *dive.TypedToolAdapter[T] (satisfies dive.Tool). ToolDeclarer (DeclaredTools) marks a provider-defined toolset such as anthropic.ComputerToolset: calls route to the declared tools by name, which are left out of the request while the declarer is present. ToolAnnotations.HaltsBatch (automatic for calls with ToolsetName) runs a batch in order and answers later halting calls after a failure with an error, ToolCallResult.Error == ErrBatchHalted.
  • Hooks (hooks.go): Hooks struct groups hook slices on AgentOptions. Hook types: SessionStartHook, PreGenerationHook, PostGenerationHook, PreToolUseHook, PostToolUseHook, PostToolUseFailureHook, StopHook, PreIterationHook, OnSuspendHook. All hooks receive *HookContext. PreToolUse hooks can set HookContext.UpdatedInput to rewrite the tool args. SessionStartHook fires once at the start of a fresh conversation (no prior messages, non-resume) and returns a *SessionStartResult to seed it (durable or ephemeral via Persist).
  • Tracer (tracer.go): Tracer interface for observation (tracing, metrics, audit logging). Three methods (StartAgentRun, StartChat, StartToolCall) return (ctx, span); the agent threads ctx through downstream calls so spans nest naturally. NopTracer (default) and MultiTracer live in core; the OpenTelemetry adapter is otel.NewTracer in the dive/otel module.
  • Turn outcome (outcome.go, turn.go): once the turn begins (just before PreGeneration), every exit goes through turn.end, which reads one turnRecord. An error exit returns (resp, err) with Status == ResponseStatusIncomplete, resp.Turn.Outcome classifying the error, and err wrapping *GenerationError{Response: resp}; a failed partial resume returns (nil, err). Response.Turn (messages saved, usage, outcome or suspension, Persistence) is set for every status, and ResponseItemTypeTurnEnded is the last item emitted. A tool batch that stops early (toolbatch.go) returns its partial batch; closeToolBatch answers each call it did not finish as not run or unknown, Outcome.ToolCalls records their states, and a parallel call still running gets a BackgroundTaskHandle for its late result. WithSoftCancel (softcancel.go) stops at the next step boundary. The loop reads each response's stop reason (llm.ClassifyStopReason): an output or context limit, a refusal, a provider stop and the iteration limit run no tool call, and a pause is resent. An incomplete turn is closed (closeturn.go: every call answered, a turn-incomplete reminder whose details hold the outcome), passed to OnIncompleteTurn hooks and saved; WithContinue picks it up; IncompleteTurns.Discard restores the old error behaviour. Every turn has an ID (TurnID(ctx)), a status and per-call states on Turn; a TurnStore session (Load, CheckpointTurn, revisions; session.Session is one, in session/turns.go) stores the record, and the agent saves through it in place of the other writes, folding a WithContinue into the open turn. Agent.CancelSuspendedTurn closes a suspended turn without a model call. DurabilityOptions (durability.go) adds step checkpoints (a running record at each model response and tool call; a turn found running on load is closed with process_exit) and session claims (SessionClaimer, session/claims.go) for several processes on one session. Design: docs/design/incomplete-turns.md.
  • Suspend/Resume (tool.go, response.go, dive.go): A tool can pause the agent mid-turn by returning NewSuspendResult(prompt, metadata) or NewSuspendResultWithReason(prompt, reason, metadata) (sets ToolResult.Suspend). SuspendReason classifies why: SuspendReasonInput (default) or SuspendReasonAuth. CreateResponse returns (*Response, nil) with Status == ResponseStatusSuspended and Response.Suspension *SuspensionState. Resume via WithToolResults (session-backed) or WithResume(state, results) (stateless). SuspendableSession is an optional Session extension for auto-persistence; Agent.CancelSuspendedTurn closes a suspended turn and session.Session.RemoveLastTurn deletes one. A resent result already accepted is skipped (ErrConflictingToolResult if it differs); WithResumeRequest checks the turn ID and revision first. OnSuspend hooks fire before persistence. See docs/guides/suspend-resume.md.

Read the full file on GitHub · 98 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. 1mo ago Changed · +2 lines · +482 tokens per session 04962cf0da52
  2. 1mo ago Changed · +3 lines · +355 tokens per session b5f7b1337e87
  3. 2mo ago First seen · 93 lines · 1,916 tokens per session scan A 4c597bff0109

Subscribe to this mod's changes

dive CLAUDE.md is an instructions file published in the GitHub repository deepnoodle-ai/dive (133 stars, last pushed 8d ago), licensed Apache-2.0. It adds 2,753 tokens to every session, about $0.0110 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

dive CLAUDE.md compared with instructions from other repositories

dive CLAUDE.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
dive CLAUDE.mddeepnoodle-ai/diveInstructions file1338d agoApache-2.0A2,753Claude Code
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA9,719GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file143ktodayMITA7,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