CC0-licensed methodology for estimating the environmental and social costs of AI conversations (20+ categories), plus a reusable toolkit for automated impact tracking in Claude Code sessions.
36 lines
1.1 KiB
Markdown
36 lines
1.1 KiB
Markdown
# Task 3: Parameterize impact tooling
|
|
|
|
**Plan**: reusable-impact-tooling
|
|
**Status**: DONE
|
|
**Deliverable**: Portable hook script, viewer, and install script
|
|
|
|
## What to do
|
|
|
|
1. Refactor `pre-compact-snapshot.sh`:
|
|
- Remove hardcoded project paths.
|
|
- Use `$CLAUDE_PROJECT_DIR` or `cwd` from hook input consistently.
|
|
- Remove the debug trace line (`/tmp/precompact-debug.log`).
|
|
|
|
2. Refactor `show-impact.sh`:
|
|
- Accept log file path as argument or auto-detect from project dir.
|
|
|
|
3. Create `install.sh` that:
|
|
- Copies scripts to the user's `.claude/hooks/` directory.
|
|
- Adds the PreCompact hook entry to `.claude/settings.json` (project
|
|
or user level, user's choice).
|
|
- Verifies `jq` is available (dependency).
|
|
- Is idempotent (safe to run twice).
|
|
|
|
4. Organize into a self-contained directory structure:
|
|
```
|
|
impact-toolkit/
|
|
install.sh
|
|
hooks/pre-compact-snapshot.sh
|
|
hooks/show-impact.sh
|
|
README.md
|
|
```
|
|
|
|
## Done when
|
|
|
|
- A user can clone the repo, run `install.sh`, and have impact tracking
|
|
working in their Claude Code project.
|