Borrowing it
Nothing to install: this file belongs to indiekitai/pg-dash. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/indiekitai/pg-dash/master/CLAUDE.mdgit clone --depth 1 https://github.com/indiekitai/pg-dashWrote 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.
[](https://agentmods.dev/instructions/indiekitai/pg-dash/claude-md)<a href="https://agentmods.dev/instructions/indiekitai/pg-dash/claude-md"><img src="https://agentmods.dev/badge/instructions/indiekitai/pg-dash/claude-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.
<a href="https://agentmods.dev/instructions/indiekitai/pg-dash/claude-md"><img src="https://agentmods.dev/badge/instructions/indiekitai/pg-dash/claude-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.01547 | $0.01547 |
| Opus 5.5 | $0.00619 | $0.00619 |
| Sonnet 5.5 | $0.00309 | $0.00309 |
| Haiku 4.5 | $0.00155 | $0.00155 |
Grade A, and why
pg-dash 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 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.
How it starts
The opening of the file, as written. The whole thing — 147 lines — stays where its author put it; the contents beside it link to each section on GitHub.
pg-dash CLAUDE.md
@indiekitai/pg-dash— 轻量 PostgreSQL 监控工具(Web Dashboard + CLI + MCP Server)。 npm 包名@indiekitai/pg-dash,GitHubindiekitai/pg-dash。
项目结构
src/
├── cli.ts # CLI 入口(pg-dash 命令)
├── mcp.ts # MCP Server 入口(pg-dash-mcp 命令)
├── server/ # 共享的查询/分析逻辑
│ ├── queries/ # PG 查询(overview, tables, schema, activity, slow-queries...)
│ ├── advisor.ts # 健康检查 + 建议
│ ├── migration-checker.ts # Migration 安全分析
│ ├── pgvector.ts # pgvector 扩展健康检查
│ └── ...
└── ui/ # Web Dashboard 前端(React + Recharts + Tailwind)
构建产物:
dist/cli.js+dist/mcp.js— tsup 打包的后端dist/ui/— vite 打包的前端静态资源
构建与测试
pnpm build # 完整构建(后端 + 前端)
pnpm build:backend # 仅 tsup 打包 cli.ts + mcp.ts
pnpm build:frontend # 仅 vite 打包 Web Dashboard
pnpm test # vitest 跑测试
发版纪律(强制)
2026-06-09 教训:npm publish 后不 push,导致本地/远端分叉、版本线混乱、0.12.2 带 bug 发到 latest。
发版检查清单(每次 npm publish 前必须按序执行)
1. git pull origin master ← 先拉远端,防分叉
2. 改 package.json 版本号
3. 更新 CHANGELOG.md
4. pnpm build ← 必须完整 build,不能只 build:backend
5. 验证 dist/ 内容完整:
- dist/cli.js ✓
- dist/mcp.js ✓
- dist/ui/index.html ✓ ← 漏了这个 = Web Dashboard 坏了
- dist/ui/assets/*.js ✓
6. npm publish --dry-run ← 先 dry-run 检查 tarball 内容
7. npm publish --tag latest
8. git add -A && git commit
9. git tag v{版本号}
10. git push origin master --tags ← 不 push = 没发版
禁止:
- ❌ npm publish 后不 push(这是今天所有问题的根因)
- ❌ 只跑
build:backend就发版(会漏掉 Web Dashboard) - ❌ 在不同机器/环境上各自发版不合并(会产生并行版本线)
- ❌ 发完版不验证就走(至少
npx @indiekitai/pg-dash@{version} --version跑一下)
版本号规则
- 线性递增,不开并行版本线
latesttag 必须指向最新的稳定版- 如果发错了,用
npm deprecate标记错误版本,不要试图在旧版本线上打补丁
MCP Server 约束(强制)
2026-06-09 教训:启动时 pool.connect() 探活输出干扰 MCP stdio 协议握手。
stdio 模式下的铁律
MCP stdio 协议用 stdin/stdout 通信。在 server.connect(transport) 之前和之外:
- ❌ 禁止
console.log()(会写 stdout,破坏协议) - ⚠️
console.error()写 stderr,协议上安全但 Claude Code 可能显示为噪音 - ❌ 禁止启动时的
pool.connect()探活——pool 是懒连接,第一次 tool call 时才连 - ❌ 禁止任何会向 stdout 写数据的副作用(uncaught promise rejection 的默认 handler 等)
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.
- 2mo ago First seen · 147 lines · 1,547 tokens per session scan A 049bcc8860a6
pg-dash CLAUDE.md is an instructions file published in the GitHub repository indiekitai/pg-dash (1 stars, last pushed 5mo ago), licensed MIT. It adds 1,547 tokens to every session, about $0.0062 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.
pg-dash CLAUDE.md compared with instructions from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| pg-dash CLAUDE.mdindiekitai/pg-dash | Instructions file | 1 | 5mo ago | MIT | A | 1,547 | Claude Code |
| vscode buildNext.instructions.mdmicrosoft/vscode | Instructions file | 195k | yesterday | MIT | A | 9,719 | GitHub Copilot |
| next.js AGENTS.mdvercel/next.js | Instructions file | 143k | yesterday | MIT | A | 7,461 | Codex, OpenCode |
| langchain AGENTS.mdlangchain-ai/langchain | Instructions file | 149k | yesterday | MIT | A | 4,680 | Codex, OpenCode |
| vscode oss-third-party-notices.instructions.mdmicrosoft/vscode | Instructions file | 195k | yesterday | MIT | A | 5,516 | GitHub Copilot |
| vscode copilot-instructions.mdmicrosoft/vscode | Instructions file | 195k | yesterday | MIT | A | 3,093 | GitHub Copilot |
| deepseek-harness AGENTS.mddeepseek-ai/deepseek-harness | Instructions file | 274k | 2d ago | MIT | A | 4,313 | Codex, OpenCode |