Claude Code plugin core: bounded, target-driven optimization loops
Project description
sindri
A Claude Code plugin for bounded, target-driven optimization loops.
In the myth, Sindri is the dwarf smith who forged Mjölnir by iterating under adversity — each hammer-strike tested, kept only if it survived. This plugin is the same pattern: make a change, benchmark it, keep it if it's better, revert otherwise, repeat until the target is hit or the pool of ideas is exhausted.
Inspired by karpathy/autoresearch and davebcn87/pi-autoresearch, adapted to Claude Code.
One commit per kept experiment. Git is the audit log. The forge runs one way.
Install
Option 1 — Claude Code marketplace (easiest, once PyPI is up)
/plugin marketplace add 4KMetrics/sindri
/plugin install sindri@4kmetrics
Then install the Python runtime once (the plugin calls python -m sindri):
uv pip install sindri-forge # or: pip install sindri-forge
The PyPI distribution is sindri-forge (the sindri name was taken by an unrelated ZK-proof SDK). The imported module name is still sindri.
Restart Claude Code. Done.
Option 2 — local dev install (no marketplace)
git clone https://github.com/4KMetrics/sindri.git ~/src/sindri
cd ~/src/sindri && ./scripts/install-plugin.sh
The install script handles the Python package + the ~/.claude/plugins/sindri symlink in one go.
That script installs the sindri Python package into your active environment and symlinks the plugin into ~/.claude/plugins/sindri. Restart Claude Code afterward. Verify: /sindri status should report "no active run" cleanly.
To target a specific Python (e.g. a venv), pass it via env var:
SINDRI_PYTHON=/path/to/venv/bin/python ./scripts/install-plugin.sh
Requirements:
- Python ≥ 3.10 (pydantic 2 is the only runtime dep; pyyaml is dev-only)
git≥ 2.30ghCLI (authenticated) — needed only forsindri-finalizePR creation- Claude Code CLI with
Task+ScheduleWakeuptools uv(optional, faster install) orpip
First-run dogfood: walk through docs/DOGFOOD.md on a throwaway repo before pointing sindri at real code — it verifies every skill path and catches environment gaps before you commit an overnight run.
Quickstart
# In the repo you want to optimize:
/sindri reduce bundle_bytes by 15%
Sindri will:
- Scaffold
.claude/scripts/sindri/benchmark.pyif missing (interactive; asks you to describe the measurement in natural language). - Scan your repo and draft a pool of 10–30 candidates.
- Ask you to approve / edit the pool.
- Check out a new branch
sindri/reduce-bundle-bytes-15pctand run the baseline 3×. - Loop autonomously — one experiment per wakeup, ~60s between them.
- When the target hits (or the pool drains with ≥1 win), push the branch and open a PR.
Check in anytime with /sindri status. Halt with /sindri stop. Abandon with /sindri clear.
Architecture
- Python core (
src/sindri/) — pure functions: statistics, state file I/O, git wrappers, pool ordering, termination predicates, PR body rendering. - Skills (
skills/sindri-*/SKILL.md) — prose prompts for the decisions that need Claude's inference: scaffolding a benchmark, proposing a candidate pool, orchestrating the loop. - Subagent prompt (
prompts/experiment-subagent.md) — the contract every experiment subagent follows. Fresh context per experiment, no context bleed.
See docs/superpowers/specs/2026-04-19-sindri-design.md for the full design.
Development
uv pip install -e ".[dev]"
pytest # all test layers
pytest -m "not e2e" -q # skip the slow end-to-end loop test
pytest tests/unit/test_plugin_artifacts.py -v # just artifact validity checks
./scripts/smoke.sh # plumbing smoke in a throwaway repo
License
MIT
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sindri_forge-0.3.2.tar.gz.
File metadata
- Download URL: sindri_forge-0.3.2.tar.gz
- Upload date:
- Size: 163.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9b1acc8dff2f5355746a6ed27cd904542b4f707a40f4b26f80d71814593acdb8
|
|
| MD5 |
b36820ed991bec1fae6e32aace9d1cc3
|
|
| BLAKE2b-256 |
7841601ded6e1b46f16605e219ec2b7203f7609eae75f3cae74df5697a5806b7
|
Provenance
The following attestation bundles were made for sindri_forge-0.3.2.tar.gz:
Publisher:
publish.yml on 4KMetrics/sindri
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sindri_forge-0.3.2.tar.gz -
Subject digest:
9b1acc8dff2f5355746a6ed27cd904542b4f707a40f4b26f80d71814593acdb8 - Sigstore transparency entry: 1346397080
- Sigstore integration time:
-
Permalink:
4KMetrics/sindri@ca3608d86ca24b93fe50b0f6e8428bb030107d8c -
Branch / Tag:
refs/heads/main - Owner: https://github.com/4KMetrics
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@ca3608d86ca24b93fe50b0f6e8428bb030107d8c -
Trigger Event:
workflow_run
-
Statement type:
File details
Details for the file sindri_forge-0.3.2-py3-none-any.whl.
File metadata
- Download URL: sindri_forge-0.3.2-py3-none-any.whl
- Upload date:
- Size: 22.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0ad5d299f27e23f7657b56e0729abb2e1fb5828c1d03bb7ffab9f652cbd8cc6e
|
|
| MD5 |
8bd838d7b6052063852305e4b4f0096e
|
|
| BLAKE2b-256 |
805a613f593c09e8bc5714e3081b38f9aaecdd8eba6238a4e7b54123a110320d
|
Provenance
The following attestation bundles were made for sindri_forge-0.3.2-py3-none-any.whl:
Publisher:
publish.yml on 4KMetrics/sindri
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sindri_forge-0.3.2-py3-none-any.whl -
Subject digest:
0ad5d299f27e23f7657b56e0729abb2e1fb5828c1d03bb7ffab9f652cbd8cc6e - Sigstore transparency entry: 1346397150
- Sigstore integration time:
-
Permalink:
4KMetrics/sindri@ca3608d86ca24b93fe50b0f6e8428bb030107d8c -
Branch / Tag:
refs/heads/main - Owner: https://github.com/4KMetrics
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@ca3608d86ca24b93fe50b0f6e8428bb030107d8c -
Trigger Event:
workflow_run
-
Statement type: