codesesh: Instructions file for Codex

AGENTS.md

codesesh AGENTS.md is an instructions file for Codex, OpenCode from xingkaixin/codesesh. It costs 980 tokens per session, scanned A, original, MIT.

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

Written for Codex and OpenCode: the file is AGENTS.md.

This is xingkaixin/codesesh's own configuration. It tells Codex and OpenCode how to work on codesesh 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 codesesh configures →

Reuse

Borrowing it

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

Made for: Codex, OpenCode.

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

README.md
[![agentmods](https://agentmods.dev/badge/instructions/xingkaixin/codesesh/agents-md/github.svg)](https://agentmods.dev/instructions/xingkaixin/codesesh/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/xingkaixin/codesesh/agents-md"><img src="https://agentmods.dev/badge/instructions/xingkaixin/codesesh/agents-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 codesesh AGENTS.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/xingkaixin/codesesh/agents-md"><img src="https://agentmods.dev/badge/instructions/xingkaixin/codesesh/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 980 This file is loaded in full into every session.
When invoked 980 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.00980 $0.00980
Opus 5.5 $0.00392 $0.00392
Sonnet 5.5 $0.00196 $0.00196
Haiku 4.5 $0.00098 $0.00098

Measured 2d ago against content hash ef3f04312cc1, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 · 57 lines

How it starts

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

CodeSesh

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

Rust workspace(crates/)+ pnpm/Turbo(apps/、packages/),工具链见 rust-toolchain.toml、mise.toml。

改动前按 docs/README.md 找对应文档;模块边界和运行模式见 docs/architecture.md;领域术语以 CONTEXT.md 为准。

验证

后端基本验证(涉及 CLI 的构建前先运行 pnpm build:web):

cargo fmt --all --check
cargo clippy --workspace --all-targets --locked -- -D warnings
cargo test --workspace --locked
  • CODESESH_SKIP_WEB_ASSETS=1 只用于 debug 后端检查,release 拒绝跳过 Web 资源。
  • Rust wire 类型改变后运行 pnpm generate:rust-contract,并检查 TypeScript 消费者。
  • 前端:pnpm lint、pnpm format:check、pnpm typecheck 和相关 Vitest 测试。
  • 改 CLI、HTTP、SSE 或持久化:pnpm test:backend。
  • 改界面流程:pnpm test:e2e。
  • 改文档:node scripts/check-docs-paths.mjs 和 node scripts/check-docs-facts.mjs。
  • 改版本号:node scripts/release-preflight.mjs。
  • 重命名或新增平台相关模块时,同步 package.json 中 test:rust:platform 的过滤条件。

验证命令不代表已经通过,报告结果必须保留实际运行证据。测试取舍见 docs/engineering/testing.md, 完整 CI 以 .github/workflows/ci.yml 为事实源,制品要求见 docs/engineering/rust-packaging.md。

Web 设计规则

apps/web/src 的颜色和类名由 .oxlintrc.json overrides 中的 shadcn 规则检查,只用主题 token; 例外按具体类名添加,不用通配符。不要启用 no-restyle、no-arbitrary-values、no-inline-styles、 require-static-classes:图表和虚拟列表需要动态尺寸。Astro 产品站不在检查范围内。

扩展新 Agent

  1. 在 crates/codesesh-core/src/agents/ 新增 Rust 适配器,并接入:
    • agents.rs:pub mod 声明和 scan_agent 分发;文件来源在 session_root / is_session_file 声明会话文件,数据库来源在 database_path 声明 SQLite 路径。 来源可用性、回填选择、数据库戳记和 discovery/json_scan.rs 的 JSON 扫描都读取这些函数, 不另设分支。
    • discovery/backfill.rs:伴随索引文件加入 inventory 的 context_names。
    • discovery/incremental.rs:watch_roots 监听路径和 read 增量刷新。
    • 数据库来源另外对照 deepchat 在 backfill.rs(inventory、session_fingerprints)和 incremental.rs 中的分支逐一接入。
  2. 在 crates/codesesh-core/src/discovery/paths.rs 声明数据根目录、环境变量覆盖和扫描路径。
  3. 在 crates/codesesh-core/src/agents/catalog.json 声明公开元数据和展示能力,然后运行 pnpm generate:rust-contract;浏览器端目录由生成结果导出,不维护第二份值。 support 按适配器实际解析结果声明分级与能力,并同步 README 中的能力矩阵。
  4. 在 apps/web/public/icon/agent/ 与 apps/www/public/icon/agent/ 添加 SVG。
  5. 自定义工具展示在 apps/web/src/components/session-detail/tool-strategy/ 添加并注册。

Read the full file on GitHub · 57 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 Changed · -1 lines · -24 tokens per session ef3f04312cc1
  2. 17d ago Changed · -41 lines · -697 tokens per session 0820efbb8c52
  3. 24d ago Changed c9c7b6fb2b8c
  4. 28d ago Changed 3d2a4122b064
  5. 1mo ago Changed · +2 lines · +56 tokens per session 00f85df8ed21
  6. 1mo ago Changed 658003952068
  7. 1mo ago Changed · +34 tokens per session 1847fc1b42b0
  8. 1mo ago Changed 9d49afe91db2
  9. 1mo ago Changed 4faa11104d76
  10. 1mo ago First seen · 97 lines · 1,611 tokens per session scan A 65399274f72e

Subscribe to this mod's changes

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

codesesh AGENTS.md compared with instructions from other repositories

codesesh AGENTS.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
codesesh AGENTS.mdxingkaixin/codeseshInstructions file11yesterdayMITA980Codex, OpenCode
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA9,719GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file143kyesterdayMITA7,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