codesesh AGENTS.md

Repository instructions for CodeSesh, a tool that collects and displays local AI coding-agent conversation history in a web interface. A monorepo is one repository containing several related packages.

In plain words
What is it for?
Use it when developing CodeSesh packages, its command-line server, session search and discovery, project grouping, bookmarks, analytics, or web application.
Why use it?
It gives maintainers a map of the system, making it easier to find the code responsible for scanning sessions, serving the API, showing the web interface, and calculating costs.

Instructions file for CodexOpenCode

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/xingkaixin/codesesh/agents-md
Clone the repo
git clone --depth 1 https://github.com/xingkaixin/codesesh

Made for: Codex, OpenCode.

Per session 1,354 This file is loaded in full into every session.
When invoked 1,354 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.01354 $0.01354
Opus 5 $0.00677 $0.00677
Sonnet 5 $0.00271 $0.00271
Haiku 4.5 $0.00135 $0.00135

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

Security

Grade A, and why

codesesh AGENTS.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.

AGENTS.md · 80 lines

How it starts

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

CodeSesh

用途:发现、聚合、可视化受支持的本地 AI 编码 Agent 历史会话,通过 Web UI 统一浏览。

技术栈

  • Monorepo:pnpm(版本以 package.jsonpackageManager 字段为准)+ Turbo
  • 语言:TypeScript 7(tsc 原生)+ TypeScript 6(typescript API / tsc6,供 tsup d.ts、Astro 等),tsup 打包
  • Server:Hono(HTTP API)+ Citty(CLI 解析)
  • Web:React 19 + React Router + Tailwind CSS 4 + Base UI
  • Lint:oxlint
  • Format:oxfmt
  • Test:vitest + @vitest/coverage-v8

包结构与模块职能

  • packages/core/src/:framework-agnostic 核心库
    • packages/core/src/agents/:各 Agent 适配器、注册表与能力声明
    • packages/core/src/analytics/:Dashboard 与项目聚合统计
    • packages/core/src/bookmarks/:书签物化
    • packages/core/src/contract/:前后端共享的 browser-safe 契约
    • packages/core/src/discovery/:扫描编排、路径解析与 Session Detail 加载
    • packages/core/src/discovery/cache/:Session 缓存与搜索索引持久化
    • packages/core/src/pricing/:模型定价、代际同步与成本计算
    • packages/core/src/projects/:Project Identity、分组与作用域匹配
    • packages/core/src/search/:Session 搜索
    • packages/core/src/state/:书签、别名等用户状态
    • packages/core/src/types/:共享类型定义
    • packages/core/src/utils/:通用工具函数
  • packages/cli/src/:CLI 入口、HTTP 服务与后台 Worker
    • packages/cli/src/index.ts:参数解析,驱动扫描并启动服务器
    • packages/cli/src/server.ts:Hono 服务与生命周期管理
    • packages/cli/src/api/:HTTP API 端点;其余扫描、索引与 Worker 模块保持扁平布局
  • apps/web/src/:React 应用
    • apps/web/src/App.tsx:路由与顶层状态
    • apps/web/src/components/:产品与 UI 组件
    • apps/web/src/hooks/:客户端状态与数据同步 hooks
    • apps/web/src/lib/:HTTP API 客户端与前端工具
    • apps/web/src/styles/:全局样式
  • apps/www/:Astro 产品站
    • apps/www/src/pages/:静态页面路由
    • apps/www/src/components/:产品站组件
    • apps/www/public/:静态资源

数据流

CLI 参数 → core 全量扫描 / 缓存恢复 → LiveScanStore 文件监听增量刷新 → Hono HTTP API / SSE → React Web UI(Dashboard / 会话列表 / 详情)

验证

一条命令的整体检查:pnpm lint && pnpm typecheck && pnpm build && pnpm test

  • pnpm typecheck:全 workspace 类型检查(web 单独跑最快:pnpm --filter @codesesh/web typecheck)。
  • pnpm test:turbo 单测;单包用 pnpm --filter <pkg> test
  • pnpm test:coverage:先跑 scripts/critical-coverage.mjs 的覆盖率 ratchet(按 scope 设阈值,低于阈值即红),再全量覆盖率。
  • pnpm --filter @codesesh/web test:bundle:初始 bundle 300KB gzip 预算(apps/web/tests/initial-bundle.test.ts),需先 pnpm build;随手一个顶层 import 就可能触发。
  • pnpm test:e2e:Playwright 端到端(tests/e2e/),需要先构建。
  • pnpm test:migration:SQLite 缓存 schema 迁移冒烟。

Read the full file on GitHub · 80 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 · 80 lines · 1,354 tokens per session scan A 1a5efc79632a

Subscribe to this mod's changes

codesesh AGENTS.md is an instructions file published in the GitHub repository xingkaixin/codesesh (11 stars, last pushed 2d ago), licensed MIT. It adds 1,354 tokens to every session, about $0.0068 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.

Related

Other instructions, from other repositories

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

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

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,182 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,345 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

next.js 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