I strongly prefer TypeScript with strict mode enabled for all new code. Please don't use the `any` type unless there is genuinely no way around it, and if you do, make sure to leave a comment explaining the reasoning behind it. I find that taking the time to properly type things catches a lot of bugs before they ever make it to runtime.
When you are writing React components, it would be good to use function components with hooks rather than class components. You should also try to keep each component in its own file under `src/components/`, because it really makes it a lot easier to find things later on.
You should always make sure to run the test suite before pushing any changes to the main branch. This is important because it helps catch bugs early and prevents broken builds from being deployed to production. Run the tests with:
```bash pnpm test --run ```
If a test is flaky, please don't just skip it. Instead, open an issue on https://github.com/acme/web-app/issues and add the `flaky` label so that we can actually track it down.
- Please use Conventional Commits for all of your commit messages.
- It would be great if you could keep pull requests small, ideally under about 400 lines of changes.
- Make sure to always update `CHANGELOG.md` whenever you change any user-facing behavior.
Strongly prefer TypeScript, strict mode on, all new code. No `any` type unless truly no way around — if used, leave comment explaining why. Proper typing catches many bugs before runtime.
React components: function components with hooks, not class components. One component per file under `src/components/` — easier to find later.
Always run test suite before pushing to main branch. Catches bugs early, prevents broken builds deploying to production. Run tests with:
```bash pnpm test --run ```
Flaky test? Don't skip. Open issue on https://github.com/acme/web-app/issues and add `flaky` label so it can be tracked down.
- Use Conventional Commits for all commit messages.
- Keep PRs small, ideally under ~400 lines changed.
- Always update `CHANGELOG.md` when changing user-facing behavior.
Real run recorded with claude-code / claude-opus-5-5. Prompt: "Compress docs/preferences.md so it costs fewer tokens when the agent loads it, but keep a backup of the original." The skill ran its bundled script (python3 -m scripts), which calls the claude CLI to do the compression. The first validation found a stray comma after a URL, and the script fixed it automatically before passing. The left and right columns are the file's exact contents before and after, unmodified, only split into headings, paragraphs and lists for display. The original was backed up to preferences.original.md in the tool's data directory.
하는 일
CLAUDE.md, 프로젝트 메모, 할 일 목록, 선호 설정 같은 자연어 파일을 간결한 문장으로 다시 써서, 에이전트가 불러올 때마다 드는 토큰을 줄입니다. 제목, 코드 블록, 인라인 코드, URL, 파일 경로는 그대로 유지해야 합니다.
작동 방식
- /caveman-compress <파일> 또는 메모리 파일을 압축해 달라는 요청으로 실행됩니다.
- 함께 들어 있는 Python 스크립트를 실행합니다. 파일 종류, 크기(최대 500 KB), 이름을 확인한 뒤 텍스트를 Claude에 보내 압축합니다. 코드 블록은 먼저 가려 두어 모델이 바꿀 수 없습니다.
- 결과를 로컬에서 검증합니다. 검사에 실패하면 문제된 부분만 고치도록 Claude에 최대 2번 요청하고, 그래도 실패하면 원본 파일을 건드리지 않습니다.
- 압축된 파일을 제자리에 쓰고, 원본은
<이름>.original.md로 별도 데이터 폴더에 저장합니다. 에이전트가 두 번 불러오지 않게 하기 위해서입니다.
이럴 때 좋습니다
세션마다 불러오는 큰 프로젝트 메모리 파일.
알아 둘 점
글로 된 파일(.md, .mdc, .txt, .rst, .typ, .tex, 확장자 없음)만 압축하고 코드와 설정 파일은 건너뜁니다. Python 3.10 이상이 필요합니다. 저희 테스트에서는 1,391바이트짜리 설정 파일이 881바이트가 되었고, 제목, 코드 블록, 인라인 코드, URL은 모두 그대로였습니다.
에이전트가 실행하는 Python 스크립트가 들어 있습니다. 지정한 파일의 내용을 Anthropic으로 보냅니다. ANTHROPIC_API_KEY가 설정되어 있으면 Anthropic Python SDK를, 없으면 로그인된 `claude` CLI를 사용하므로 사용량이 본인의 Anthropic 계정에 잡힙니다. 대상 파일을 덮어쓰고 ~/.local/share/caveman-compress(Windows는 %LOCALAPPDATA%)에 백업과 잠금 파일을 씁니다. 이름이 자격 증명이나 키처럼 보이는 파일은 거부합니다. 스크립트를 모두 읽었고 다른 네트워크 접근이나 파일 접근은 없었습니다. Anthropic에 보내고 싶지 않은 내용이 담긴 파일에는 쓰지 마세요.