codes CLAUDE.md

Developer instructions for a Go command-line application named codes, including its commands, packages, and entry point.

In plain words
What is it for?
They help build and test the program, route terminal or JSON output, dispatch subcommands, and inject version information into compiled binaries.
Why use it?
They give coding agents the build, test, lint, and architecture details needed to change the application consistently.

Instructions file

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/ourines/codes/claude-md
Clone the repo
git clone --depth 1 https://github.com/ourines/codes
Per session 3,743 This file is loaded in full into every session.
When invoked 3,743 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 $0.03743 $0.03743
Opus 5 $0.01871 $0.01871
Sonnet 5 $0.00749 $0.00749
Haiku 4.5 $0.00374 $0.00374

Measured 2d ago against content hash 221edcd0b917, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

codes 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 2d 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 · 286 lines

How it starts

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

Build & Test Commands

go build ./cmd/codes                    # Build (quick check)
go build -o codes ./cmd/codes           # Build named binary
go vet ./...                            # Lint
go test ./... -v -count=1               # Run all tests
go test ./internal/commands -run TestX   # Run single test
go test ./internal/session -v            # Run package tests
make build && make test                  # Build + smoke tests

Version injection at build time:

go build -ldflags "-X codes/internal/commands.Version=v1.0.0 -X codes/internal/commands.Commit=$(git rev-parse --short HEAD) -X codes/internal/commands.Date=$(date -u +%Y-%m-%dT%H:%M:%SZ)" -o codes ./cmd/codes

Architecture

Entry Point Routing (cmd/codes/main.go)

The root command dynamically selects behavior:

  • TTY detected → launches bubbletea TUI (internal/tui)
  • --json flag → structured JSON output via internal/output
  • Non-TTY → CLI fallback (internal/commands)
  • Subcommand → cobra dispatches to appropriate handler

Package Responsibilities

Package Role
internal/config JSON config load/save, API testing, git info extraction, project/remote CRUD
internal/tui Multi-tab bubbletea TUI (Projects, Profiles, Remotes, Settings, Stats, Tasks, Workflows)
internal/session Terminal session lifecycle: spawn, track via PID files, kill
internal/remote SSH/SCP operations, remote codes installation, profile sync
internal/agent Agent team management: daemon lifecycle, task execution, message passing, Claude subprocess orchestration
internal/stats Cost tracking: JSONL session parsing, token aggregation, caching, time-range filtering
internal/mcp MCP server: 44 tools over stdio + SSE (/mcp/ on HTTP port). NewSSEHandler() mounts SSE on existing HTTP mux — single port.
internal/commands Cobra command definitions (cobra.go) + implementations (commands.go)
internal/output JSON mode wrapper (output.JSONMode flag)
internal/ui Styled CLI text output helpers
internal/workflow Workflow templates: YAML store, agent team orchestration, legacy migration

Read the full file on GitHub · 286 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. 2d ago First seen · 286 lines · 3,743 tokens per session scan A 221edcd0b917

Subscribe to this mod's changes

codes CLAUDE.md is an instructions file published in the GitHub repository ourines/codes (11 stars, last pushed 6mo ago), licensed MIT. It adds 3,743 tokens to every session, about $0.0187 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-30.