codeclaw CLAUDE.md

Project instructions for CodeClaw, a command-line tool that collects Claude Code sessions, removes secrets, labels the work, and sends structured data to Hugging Face, a platform for sharing machine-learning models and datasets.

In plain words
What is it for?
Useful when changing log collection, secret removal, session classification, daemon behavior, or Hugging Face dataset uploads.
Why use it?
They help an agent preserve privacy, use the right configuration, avoid slowing active sessions, and run required tests after classifier changes.

Instructions file

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add instructions/ychampion/codeclaw/claude-md
Clone the repo
git clone --depth 1 https://github.com/ychampion/codeclaw
Per session 280 This file is loaded in full into every session.
When invoked 280 The same file — it is already loaded in full.
Security scan B 1 finding. Scan, not verified.
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 $0.00280 $0.00280
Opus 5 $0.00140 $0.00140
Sonnet 5 $0.00056 $0.00056
Haiku 4.5 $0.00028 $0.00028

Measured 2d ago against content hash 10ae261a7faf, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade B, and why

codeclaw 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 2d 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.

Asks for rootmediumPrivilege escalation

A mod that escalates privileges can change anything on the machine, not only the project.

Config at ~/.codeclaw/config.json, always chmod 600, always use .get() with defaults
CLAUDE.md · 36 lines

What it actually says

CodeClaw -- Code Intelligence

What This Repo Does CodeClaw collects Claude Code session logs, redacts secrets, classifies trajectories, and pushes structured training data to HuggingFace automatically.

Rules For Claude Code Working On This Repo Never hardcode dataset repo IDs -- always read from ~/.codeclaw/config.json

When adding redaction patterns, update BOTH codeclaw/secrets.py AND document in this file

The daemon MUST NEVER block or slow the user's active Claude Code session

Auto-push in daemon mode bypasses attestation gates -- this is intentional for private use

After any change to classifier.py, run: python -m pytest tests/ -v

Config at ~/.codeclaw/config.json, always chmod 600, always use .get() with defaults

Adding New Redaction Patterns Add to codeclaw/secrets.py in the REDACT_PATTERNS dict. Also add to ~/.codeclaw/blocklist.txt (one per line) for user-defined patterns.

Trajectory Types correction_loop: user corrects assistant -> HIGH training value

debugging_trace: bash+errors -> HIGH training value

iterative_build: long multi-tool session -> MEDIUM value

refactor: user asks to clean/rewrite -> MEDIUM value

sft_clean: clean first-try solution -> MEDIUM value, filter if < 4 turns

text

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. 2d ago First seen · 36 lines · 280 tokens per session scan B 10ae261a7faf

Subscribe to this mod's changes

codeclaw CLAUDE.md is an instructions file published in the GitHub repository ychampion/codeclaw (11 stars, last pushed 6mo ago), licensed MIT. It adds 280 tokens to every session, about $0.0014 per session on Opus 5. A static security scan graded it B with 1 finding (asks for root). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.