127.0.0.1 inside API container means the API container itself, not Postgres. Postgres runs in its own container. From inside Docker Compose, reach it by its service name. Your laptop works because the port is published to the host's localhost.
Fix: point the host at the Compose service name.
services:
db:
image: postgres:16
environment:
POSTGRES_PASSWORD: secret
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 2s
retries: 15
api:
build: .
environment:
DATABASE_URL: postgres://postgres:secret@db:5432/postgres
depends_on:
db:
condition: service_healthy
Use db (your service name) as the host, in DATABASE_URL or PGHOST. Don't hardcode localhost in code.
The healthcheck plus condition: service_healthy is a second fix. Plain depends_on only waits for the container to start, not for Postgres to accept connections. Without the healthcheck you can still get ECONNREFUSED on cold start, even with the right host.
Other causes to check:
- API runs on the host, not in Compose:
localhost:5432is correct there. Make sureports: ["5432:5432"]is set ondb. - API in a different Compose project or network: put both on a shared network, or use
host.docker.internal:5432. - Postgres listening only on a unix socket: the official image already listens on
*. Only custom configs needlisten_addresses = '*'.
Check the connection from inside the API container: docker compose exec api sh -c 'nc -zv db 5432'.
Real run recorded with claude-code / claude-opus-5-5. Output is shown verbatim, unmodified.
它做什么
给编程代理设定一种精简的回答风格:开门见山先给答案,省掉寒暄、含糊措辞、复述和结尾的客套。代码、命令、文件路径、数字和报错原文一律不改。
工作方式
- 输入 /caveman,或说 "talk like caveman"、"be brief"、"less tokens" 时启用,直到你说 "stop caveman" 或 "normal mode" 才关闭。
- 遵循九条规则:先答后述、不讲客套、用短词、冠词可省但否定词绝不省、一句只说一件事、技术内容逐字保留、调用工具时少说话、用用户的语言回答、不刻意扮演"原始人"。
- 遇到安全警告、不可撤销的操作、分步骤说明、用户困惑,以及要写进代码、提交信息、文档等对话之外的内容时,自动切回正常表达。
适合场景
在终端里日常写代码,希望回答更短、更直接。
需要了解
作者自己的测量(单次运行、10 个问题)显示,回答长度的中位数只比直接要求模型"简洁回答"短约 3%。把它当成让回答更直接的风格,而不是大幅省 token 的工具。/ultracave、/megacave 模式和状态栏标识属于完整的 Caveman 插件,不在这个压缩包里。
纯指令文件:没有脚本、不联网、不写文件。 压缩包里另有原仓库的 README、LICENSE 和 NOTICE。 指令中提到的 /caveman ultra、/caveman wenyan、/caveman status 依赖 Caveman 的其他 Skill 或钩子,本包没有包含。