Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/Aquaticat/Monochromatic. TypeScript and Rust monorepo: Claude Code and Pi coding-agent plugins, a m
Something went wrong. Try again.
README.md
session-start-housekeeping #
Claude Code SessionStart hook that performs housekeeping tasks when a session starts or resumes.
What it does #
Runs these cleanup steps in parallel on every session startup or resume:
- Creates
/tmp/claudeand/tmp/claude-1000directories - Removes stale git metadata (
HEAD,config,hooks,objects,refs) and.claudedirectories leaked intopackage/*/*/dist/final/and committed-pluginpackage/*/*/bundle/directories - Removes zero-byte Claude Code sandbox sentinels (
HEAD,config,hooks,objects,refs) from the workspace root when they are regular files - Removes the ephemeral
.mcp.jsonfile from the workspace root
Hook configuration #
// In .claude/settings.json
{
"hooks": {
"SessionStart": [
{
"matcher": "startup|resume",
"hooks": [
{
"type": "command",
"command": "ccssh",
},
],
},
],
},
}
Replaces #
This single hook replaces five separate command hooks:
{ "type": "command", "command": "mkdir -p /tmp/claude" }
{ "type": "command", "command": "mkdir -p /tmp/claude-1000" }
{ "type": "command", "command": "rm -rf package/*/*/dist/final/{HEAD,config,hooks,objects,refs,.claude}" }
{ "type": "command", "command": "find . -maxdepth 1 -type f -empty \\( -name HEAD -o -name config -o -name hooks -o -name objects -o -name refs \\) -delete" }
{ "type": "command", "command": "rm -f .mcp.json" }