goai: Instructions file for Claude Code

CLAUDE.md

goai CLAUDE.md is an instructions file for Claude Code from shaharia-lab/goai. It costs 1,119 tokens per session, scanned A, original, MIT.

Project instructions for GoAI, a Go library that provides one interface for language-model providers, embeddings, vector storage, and the Model Context Protocol. Embeddings turn text into numerical representations that can be searched for similarity; vector storage holds those representations.

In plain words
What is it for?
Use them when adding or maintaining GoAI features, provider integrations, embedding or vector functionality, Model Context Protocol support, examples, and tests.
Why use it?
They explain the library’s structure and standard commands so changes fit the existing codebase and can be built and tested consistently.

Instructions file for Claude Code

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

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

Reuse

Borrowing it

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

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

README.md
[![agentmods](https://agentmods.dev/badge/instructions/shaharia-lab/goai/claude-md.svg)](https://agentmods.dev/instructions/shaharia-lab/goai/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/shaharia-lab/goai/claude-md"><img src="https://agentmods.dev/badge/instructions/shaharia-lab/goai/claude-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 1,119 This file is loaded in full into every session.
When invoked 1,119 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.01119 $0.01119
Opus 5 $0.00560 $0.00560
Sonnet 5 $0.00224 $0.00224
Haiku 4.5 $0.00112 $0.00112

Measured 8d ago against content hash 766f9011fc3e, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

goai 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 8d 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 · 43 lines

How it starts

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

Overview

GoAI provides a unified interface over multiple LLM providers, embeddings, vector storage, and a full Model Context Protocol (MCP) client/server implementation (module github.com/shaharia-lab/goai). It is a library — there is no main package; runnable usage lives in _examples/.

The root package (package goai) keeps its source files flat in the repository root, prefixed by concern (llm_*, mcp_*, embedding_*, vector_*, chat_history_*). Additional functionality is being organized into subpackages — place new self-contained subsystems in their own directory/package rather than adding to the root.

Commands

go build ./...                                              # build
go test ./...                                               # run all tests
go test ./... -covermode=atomic -coverprofile=coverage.out # tests with coverage (as CI runs them)
go test -run TestName ./...                                 # run a single test by name
go run _examples/simple_chat.go                             # run an example
golangci-lint run                                           # lint (CI uses super-linter with VALIDATE_GO)

There is no Makefile. CI (.github/workflows/CI.yaml) runs lint (super-linter), tests + Codecov, then a SonarCloud scan.

Architecture

The package follows a consistent facade + provider-interface pattern in every subsystem: a high-level struct wraps a provider interface, so implementations are swappable and injectable for testing.

  • LLM (llm.go, types.go): LLMRequest (facade) wraps the LLMProvider interface (GetResponse / GetStreamingResponse). Providers: llm_provider_openai.go, llm_provider_anthropic.go, llm_provider_aws_bedrock.go, llm_provider_gemini.go, plus llm_provider_no_ops.go. Each provider has a matching thin client wrapper (e.g. llm_provider_openai_client.go) that isolates the vendor SDK for mocking. Streaming lives in separate *_streaming.go files. NewLLMRequest automatically wraps the provider in a TracingLLMProvider (decorator pattern, tracing_llm_provider.go) unless already traced. Request options are functional options (WithMaxToken, WithTemperature, etc.) via NewRequestConfig.
  • Tools (tools_provider.go): ToolsProvider supplies tools to LLM calls either from a local in-process []Tool list or from an MCP Client — the two are mutually exclusive (adding one blocks the other). ExecuteTool tries local tools first, then falls back to the MCP client.
  • Embeddings (embedding.go): EmbeddingService wraps the EmbeddingProvider interface; validates input and response. Bedrock provider in embedding_aws_bedrock_provider.go.
  • Vector storage (vector_storage.go): VectorStorage facade wraps VectorStorageProvider. Postgres/pgvector implementation in vector_storage_postgres.go; validation in vector_validation.go. chunking.go splits text for embedding.
  • Chat history (chat_history_*.go): ChatHistoryStorage interface with in-memory and SQLite implementations.
  • MCP (mcp_*.go): a complete MCP implementation.
    • Client: mcp_client.go (Client + Transport interface) with two transports — mcp_client_sse.go (HTTP/SSE) and mcp_client_std.go (stdio).
    • Server: mcp_server_base.go (BaseServer holds tools/resources/prompts, built with ServerConfigOptions like UseLogger) wrapped by a transport server — NewStdIOServer (mcp_server_stdio.go) or NewSSEServer (mcp_server_sse.go), each with a Run(ctx) loop. Wire protocol types are JSON-RPC 2.0 in mcp_types.go. See mcp_doc.go for an end-to-end server example.

Read the full file on GitHub · 43 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. 8d ago First seen · 43 lines · 1,119 tokens per session scan A 766f9011fc3e

Subscribe to this mod's changes

goai CLAUDE.md is an instructions file published in the GitHub repository shaharia-lab/goai (10 stars, last pushed 5d ago), licensed MIT. It adds 1,119 tokens to every session, about $0.0056 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.

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

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

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