Borrowing it
Nothing to install: this file belongs to turbommgt/ccsave. 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/turbommgt/ccsave/main/CLAUDE.mdgit clone --depth 1 https://github.com/turbommgt/ccsaveWrote 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/turbommgt/ccsave/claude-md)<a href="https://agentmods.dev/instructions/turbommgt/ccsave/claude-md"><img src="https://agentmods.dev/badge/instructions/turbommgt/ccsave/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/turbommgt/ccsave/claude-md"><img src="https://agentmods.dev/badge/instructions/turbommgt/ccsave/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.01346 | $0.01346 |
| Opus 5.5 | $0.00538 | $0.00538 |
| Sonnet 5.5 | $0.00269 | $0.00269 |
| Haiku 4.5 | $0.00135 | $0.00135 |
Grade B, and why
ccsave CLAUDE.md scanned grade B with 1 finding 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.
Reads agent configuration directoriesmediumAgent snooping
.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.
- **`src/core/projectDetector.ts`**: Detect project via SHA256 hash of path; find session JSONL files in ~/.claude/projects/<hash>/; fallback to most-recent dir. How it starts
The opening of the file, as written. The whole thing — 49 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Session Snapshot — Restored Apr 7, 2026, 12:49
Current Task
Build ccsave, a TypeScript/Node.js CLI tool that prevents Claude Code session context loss by saving structured snapshots to CLAUDE.md. Session started with full spec review; proceeded through build steps 1-15 to implement all core functionality (config, session parsing, summarization, snapshot management, watcher). Most recently diagnosed and fixed a cost explosion in API summarization and fixed a file-writing bug.
Key Decisions Made
- Model choice: Switched from claude-opus-4-6 to claude-haiku-4-5 (25x cheaper per token, sufficient for summarization).
- Message windowing: Truncate session to first 20 + last 40 messages before sending to API (~97% input reduction). Rationale: most critical context at session start (setup) and end (current work).
- Token estimation: 1 byte ≈ 0.25 tokens; warn at 150k, critical at 180k. Combined with usage logging from Anthropic response.
- Project identification: SHA256 hash of project path with fallback to most-recently-modified directory.
- CLAUDE.md format: HTML comment delimiters (
[CCSAVE:START removed]/[CCSAVE:END removed]) with safe replacement logic usinglastIndexOfto handle corrupt state recovery. - Snapshot storage:
~/.ccsave/snapshots/with ISO-slug naming; metadata + structured content sections. - File operation tracking: Separate
FileOperationtype extracted from tool calls (write, read, edit, delete, bash).
Files Modified This Session
package.json: Dependencies (commander, chalk, ora, chokidar, @anthropic-ai/sdk), npm scripts (build, dev), bin entry.tsconfig.json: ES2020 target, CommonJS module, strict mode, src→dist mapping.src/types/index.ts: All interface definitions (CCSaveConfig, Snapshot, SessionMessage, ParsedSession, ProjectInfo, WatcherOptions, FileOperation, etc.).src/utils/config.ts: Load/save ~/.ccsave/config.json with typed defaults for all thresholds, intervals, API key.src/core/sessionReader.ts: Parse JSONL (user, assistant, tool_use, tool_result messages); extract user input, assistant text, tool calls with file paths, bash commands, tool result success/failure.src/core/projectDetector.ts: Detect project via SHA256 hash of path; find session JSONL files in ~/.claude/projects//; fallback to most-recent dir.src/core/tokenEstimator.ts: Estimate tokens (1 byte = 0.25 tokens); warn/critical thresholds; return estimate + byte count.src/core/summarizer.ts: Call Anthropic API with message window (first 20 + last 40 messages), claude-haiku-4-5 model, max_tokens 1500. Output token usage logging (input, output, cost estimate). Sanitize AI output to remove[CCSAVE:END removed]marker before returning.src/core/snapshotter.ts: Orchestrate session parse → tokenization → (optional) summarization → snapshot creation. Handle summarizer return type change (usage stats).src/core/claudeMdWriter.ts: Read/write CLAUDE.md with block insertion/replacement. FixedreplaceBlockto uselastIndexOf(BLOCK_END)instead ofindexOfto recover from corrupt state where markers appear mid-file.src/commands/save.ts: Manual snapshot command; surface cost line before spinner closes.src/commands/list.ts,watch.ts,restore.ts,config.ts: Implemented all four command handlers.src/index.ts: CLI entry point with commander; routes to commands.dist/: Compiled output (gitignore assumed).
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 · 49 lines · 1,346 tokens per session scan B 1652c88c7265
ccsave CLAUDE.md is an instructions file published in the GitHub repository turbommgt/ccsave (2 stars, last pushed 6mo ago), licensed MIT. It adds 1,346 tokens to every session, about $0.0054 per session on Opus 5.5. A static security scan graded it B with 1 finding (reads agent configuration directories). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
ccsave CLAUDE.md compared with instructions from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| ccsave CLAUDE.mdturbommgt/ccsave | Instructions file | 2 | 6mo ago | MIT | B | 1,346 | 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 |