q-code: Instructions file for Codex

AGENTS.md

q-code AGENTS.md is an instructions file for Codex, OpenCode from v833/q-code. It costs 10,314 tokens per session, scanned A, original, MIT.

Repository instructions for q-code, a TypeScript command-line framework for building AI agents. They describe its commands, tools, agent coordination, integrations, monitoring, and evaluation system.

In plain words
What is it for?
Use them when developing q-code features, command-line commands, tools, skills, subagents, integrations, logging, dashboards, or evaluation tasks.
Why use it?
They give contributors a shared guide to the project's many subsystems and everyday commands. This helps changes fit the existing architecture and development workflow.

Instructions file for CodexOpenCode

Written for Codex and OpenCode: the file is AGENTS.md. Also seen: mentions subagents; names the TodoWrite tool; mentions AGENTS.md.

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

Reuse

Borrowing it

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

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 q-code AGENTS.md

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

Your own site · 80×15
<a href="https://agentmods.dev/instructions/v833/q-code/agents-md"><img src="https://agentmods.dev/badge/instructions/v833/q-code/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 10,314 This file is loaded in full into every session.
When invoked 10,314 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.10314 $0.10314
Opus 5.5 $0.04126 $0.04126
Sonnet 5.5 $0.02063 $0.02063
Haiku 4.5 $0.01031 $0.01031

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

Security

Grade A, and why

q-code 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 2mo 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 · 215 lines

How it starts

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

q-code 项目协作说明

项目概览

q-code 是一个基于 Vercel AI SDK 的 TypeScript 命令行 Agent 框架。核心能力包括:

  • Agent / 任务:Agent Loop、Plan Mode(自然语言审批、智能进入与 Shift+Tab 切换)、Task V2、TodoWrite、上下文压缩、会话持久化与 TUI /sessions 管理、文件历史快照与 /rewind 按轮次回滚内置写工具改动、TUI /agents SubAgent Monitor(同步与后台 SubAgent,completed 默认隐藏并可清理,忙碌等待期间可用 Ctrl+A 查看)、只读同步 SubAgent 动态并行调度、SubAgent 长 final output artifact/preview 回传、TUI 输入历史跨进程持久化、@file 文件引用注入与候选索引缓存/监听刷新、@image:<path> / TUI 图片附件多模态输入、文件派项目记忆(headers 精选、预算化正文注入、年龄提示)、Skills、SubAgent、Agent Teams、Worktree 隔离。
  • 工具执行:文件/搜索工具、可配置超时与 spill 的 Shell 工具(Windows 优先 PowerShell7,缺失时回退 Windows PowerShell 5.1)、后台 Shell job(f_status / f_tail / f_kill / f_list)。
  • 集成扩展:MCP server、ACP v1 stdio Agent 接入、Hooks(生命周期事件、pre/post tool-use 决策、prompt/context 注入、退出码协议)、Slash 命令注册表、Output Styles、Markdown User Commands、企业 AI 基建同步(Infra)、GitLab Wiki 知识库。
  • 可观测性:NDJSON 审计日志(默认开启)、本地只读 Web Dashboard、模型等待心跳、ttftMs/elapsedMs/TPS step 诊断、可选 Langfuse/OpenTelemetry trace 导出、崩溃保护(crash guard,默认开启)与 crash report、Usage / Cache / 成本统计、上下文占用预警、启动时版本更新说明(对比 ~/.q-code/last-version.json 与包内 changelog.json)。
  • 评测:q-code eval 本地优先 Agent 质量平台,覆盖固定任务集、mock/cli/真实模型 runner、LLM judge(opt-in)、工具轨迹、预算/成本、进度、文件副作用、策略安全、JSONL trace、Markdown/JUnit 报告、baseline 对比、趋势看板、定期回归与可选 Langfuse evaluator trace / dataset / scores 导出。
  • TUI:基于 Ink 的交互式 TUI(默认)、流式 Markdown 稳定前缀渲染、Markdown 快路径与 LRU parse cache、--classic 经典 readline、可经管道/CI 自动降级;主 Agent 默认人格为「小黄鸭」,可用 /ya 主动切换到主题鸭「降压鸭」「屁老鸭」。
  • CLI 子命令:q-code help|version|update|audit|init|eval|dashboard|exec|acp(启动前 short-circuit);exec 提供 Codex CLI 兼容的无头 JSONL、session resume 和常用参数;acp 以 ACP v1 stdio Agent 身份提供 session/prompt;其余参数走主交互循环。

环境与工具

  • 运行时:Node.js 22+。
  • 包管理器:pnpm。不要混用 npm/yarn 生成新的 lockfile。
  • 源码直接通过 tsx 运行,项目为 ESM:package.json 中 "type": "module"。
  • TypeScript 严格模式开启,模块解析为 bundler,目标为 ES2022。
  • 本仓库存在 .env,其中可能包含本地敏感配置;不要在回复、日志或提交中暴露密钥明文。

常用命令

pnpm install
pnpm start                  # tsx src/index.ts
pnpm continue               # tsx src/index.ts --continue

pnpm docs:dev               # VitePress 文档站本地预览
pnpm docs:build             # 构建 docs/.vitepress/dist
pnpm docs:preview           # 预览文档站构建产物

pnpm typecheck              # tsc --noEmit
pnpm test                   # vitest run(unit + integration)
pnpm test:unit              # vitest run tests/unit
pnpm test:integration       # vitest run tests/integration
pnpm test:acp               # ACP 参数、内容转换和 stdio 握手测试
pnpm test:watch             # vitest watch
pnpm test:coverage          # vitest run --coverage

pnpm test:legacy            # 串行:test-mcp + test-skills + test-agents + test-async-agents + test-teams
pnpm test:mcp
pnpm test:skills
pnpm test:agents            # test-agents + test-async-agents
pnpm test:teams
pnpm test:infra-candidate

pnpm eval:smoke             # 运行 deterministic smoke eval,不导出 Langfuse
pnpm eval:cli               # 运行 cli-subprocess fixture eval,不导出 Langfuse
pnpm eval:ci                # 运行 smoke + cli eval,并输出 JUnit 报告
pnpm eval:smoke:langfuse    # 运行 smoke eval 并按配置导出到 Langfuse
pnpm eval:nightly           # 运行定期 deterministic 回归并生成趋势看板
pnpm eval:trend             # 从历史 eval runs 生成本地趋势看板
pnpm eval:compare           # 对比两个 eval run
pnpm prompt:cache:verify    # 本地验证稳定 system prompt hash 与 90%+ 前缀目标
pnpm prompt:quality:verify  # 本地审计 Agent prompt 12 维质量基线

pnpm test:all               # pnpm test && pnpm test:legacy
pnpm precommit              # typecheck + test:unit
pnpm build                  # 调 scripts/build.mjs:自动生成 changelog 并产出 dist/
pnpm changelog              # 手动从 git tag / conventional commit 生成 CHANGELOG(调试用)

Read the full file on GitHub · 215 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. 2mo ago First seen · 215 lines · 10,314 tokens per session scan A 14a403217059

Subscribe to this mod's changes

q-code AGENTS.md is an instructions file published in the GitHub repository v833/q-code (10 stars, last pushed 11d ago), licensed MIT. It adds 10,314 tokens to every session, about $0.0413 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-31.

Related

q-code AGENTS.md compared with instructions from other repositories

q-code AGENTS.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
q-code AGENTS.mdv833/q-codeInstructions file1011d agoMITA10,314Codex, OpenCode
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA9,719GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file143kyesterdayMITA7,461Codex, OpenCode
langchain AGENTS.mdlangchain-ai/langchainInstructions file149ktodayMITA4,680Codex, OpenCode
vscode oss-third-party-notices.instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA5,516GitHub Copilot
vscode copilot-instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA3,093GitHub Copilot
deepseek-harness AGENTS.mddeepseek-ai/deepseek-harnessInstructions file275k2d agoMITA4,313Codex, OpenCode