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.
1.1 KiB
1.1 KiB
Task 3: Parameterize impact tooling
Plan: reusable-impact-tooling Status: DONE Deliverable: Portable hook script, viewer, and install script
What to do
-
Refactor
pre-compact-snapshot.sh:- Remove hardcoded project paths.
- Use
$CLAUDE_PROJECT_DIRorcwdfrom hook input consistently. - Remove the debug trace line (
/tmp/precompact-debug.log).
-
Refactor
show-impact.sh:- Accept log file path as argument or auto-detect from project dir.
-
Create
install.shthat:- 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
jqis available (dependency). - Is idempotent (safe to run twice).
- Copies scripts to the user's
-
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.