Initial commit establishing core-agent repository with: - Claude Code plugin hooks (safety checks, auto-formatting, context preservation) - Collection skills for blockchain research archival (claude-cowork/) - CLAUDE.md documenting repository structure and development patterns Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
4.8 KiB
CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Overview
core-agent contains Claude Code plugins and data collection skills for the Host UK federated monorepo. It has two main components:
- claude/ - Claude Code plugin with hooks, commands, and automation scripts
- claude-cowork/ - Data collection skills for archiving blockchain/cryptocurrency research
Repository Structure
core-agent/
├── claude/ # Claude Code plugin
│ ├── hooks/hooks.json # Hook definitions
│ ├── hooks/prefer-core.sh # PreToolUse: block dangerous commands
│ ├── scripts/ # Automation scripts
│ │ ├── pre-compact.sh # Save state before compaction
│ │ ├── session-start.sh # Restore context on startup
│ │ ├── php-format.sh # Auto-format PHP after edits
│ │ ├── go-format.sh # Auto-format Go after edits
│ │ └── check-debug.sh # Warn about debug statements
│ └── commands/
│ └── remember.md # /core:remember command
│
└── claude-cowork/ # Data collection skills
├── hooks/ # Collection event hooks
│ ├── hooks.json # Hook registration
│ └── dispatch.sh # Hook dispatcher
└── skills/ # Collection skills
├── ledger-papers/ # Whitepaper archive (91+ papers)
├── project-archaeology/ # Dead project excavation
├── bitcointalk/ # BitcoinTalk thread collection
├── coinmarketcap/ # Market data collection
├── github-history/ # Git history preservation
└── ... # Other collectors
Claude Plugin Features
Hooks
| Hook | File | Purpose |
|---|---|---|
| PreToolUse | prefer-core.sh |
Block destructive commands, enforce core CLI |
| PostToolUse | php-format.sh |
Auto-format PHP files after edits |
| PostToolUse | go-format.sh |
Auto-format Go files after edits |
| PostToolUse | check-debug.sh |
Warn about debug statements |
| PreCompact | pre-compact.sh |
Save state before compaction |
| SessionStart | session-start.sh |
Restore context on startup |
Blocked Commands
The plugin blocks these patterns to prevent accidental damage:
rm -rf/rm -r(except node_modules, vendor, .cache)mv/cpwith wildcardsxargswith rm/mv/cpfind -execwith file operationssed -i(in-place editing)grep -l | ...(mass file targeting)- Raw
gocommands (usecore go *) - Raw
php artisan/composer test(usecore php *)
Commands
/core:remember <fact>- Save context that persists across compaction
Context Preservation
State is saved to ~/.claude/sessions/ before compaction:
- Working directory and branch
- Git status (modified files)
- In-progress todos
- User-saved context facts
Data Collection Skills
ledger-papers
Archive of 91+ distributed ledger whitepapers across 15 categories (genesis, cryptonote, MRL, privacy, smart-contracts, etc).
./discover.sh --all # List all papers
./discover.sh --category=privacy # Filter by category
project-archaeology
Excavates abandoned CryptoNote projects before data is lost.
./excavate.sh masari # Full dig
./excavate.sh masari --scan-only # Check what's accessible
Other collectors
bitcointalk/- BitcoinTalk thread archivalcoinmarketcap/- Historical price datagithub-history/- Repository history preservationwallet-releases/- Binary release archivalblock-explorer/- Blockchain data indexing
Development
Testing hooks locally
# Simulate PreToolUse hook input
echo '{"tool_input": {"command": "rm -rf /"}}' | bash ./claude/hooks/prefer-core.sh
Adding new hooks
- Add script to
claude/scripts/ - Register in
claude/hooks/hooks.json - Test with simulated input
Collection skill structure
Each skill follows this pattern:
skills/<name>/
├── SKILL.md # Documentation
├── discover.sh # Job generator (outputs URL|FILENAME|TYPE|METADATA)
├── process.sh # Job processor (optional)
└── registry.json # Data registry (optional)
Coding Standards
- UK English: colour, organisation, centre
- Shell scripts: Use
#!/bin/bash, read JSON withjq - Hook output: JSON with
decision(approve/block) and optionalmessage - License: EUPL-1.2 CIC
Integration with Host UK
This plugin is designed for use across the Host UK federated monorepo. It enforces the core CLI for multi-repo operations instead of raw git/go/php commands. See the parent /Users/snider/Code/host-uk/CLAUDE.md for full monorepo documentation.