Skip to main content

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

/plugin install sindri@claude-community
/reload-plugins            # or relaunch Claude Code; commands are then live

Then, in any repo you want to optimize:

/sindri reduce bundle_bytes by 15%

That's it. No pip install, no virtualenv. The Python backend (sindri-forge) is fetched on demand by uv. If uv isn't installed, /sindri prints a one-line install command and stops.

Sindri is published in the Anthropic community marketplace (anthropics/claude-plugins-community). If you haven't added it yet: /plugin marketplace add anthropics/claude-plugins-community.

Requirements:

  • uv — runs the backend in an isolated environment
  • git ≥ 2.30
  • gh CLI (authenticated) — needed only for sindri-finalize PR creation
  • Claude Code with Task + ScheduleWakeup tools

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:

  1. Scaffold .claude/scripts/sindri/benchmark.py if missing (interactive; asks you to describe the measurement in natural language).
  2. Scan your repo and draft a pool of 10–30 candidates.
  3. Ask you to approve / edit the pool.
  4. Check out a new branch sindri/reduce-bundle-bytes-15pct and run the baseline 3×.
  5. Loop autonomously — one experiment per wakeup, ~60s between them.
  6. 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

Local plugin install (contributors)

git clone https://github.com/4KMetrics/sindri.git ~/src/sindri
cd ~/src/sindri && ./scripts/install-plugin.sh   # symlinks the plugin only

To test local backend edits (instead of the published package), point the launcher at your checkout before running /sindri:

export SINDRI_FORGE_SOURCE="$(pwd)"

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

sindri_forge-0.4.0.tar.gz (177.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sindri_forge-0.4.0-py3-none-any.whl (22.5 kB view details)

Uploaded Python 3

File details

Details for the file sindri_forge-0.4.0.tar.gz.

File metadata

  • Download URL: sindri_forge-0.4.0.tar.gz
  • Upload date:
  • Size: 177.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for sindri_forge-0.4.0.tar.gz
Algorithm Hash digest
SHA256 84a481d9dd0aea333caea6cd969da6f16f4ea9a0baaa58d53e492c3d601abdcb
MD5 acd5ce012ccec26c9afcd2f4a2727e42
BLAKE2b-256 57c9d4e6671fecbaef3e0722e9cc8f5ea6744c14c118e520af20a9234282656c

See more details on using hashes here.

Provenance

The following attestation bundles were made for sindri_forge-0.4.0.tar.gz:

Publisher: publish.yml on 4KMetrics/sindri

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sindri_forge-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: sindri_forge-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 22.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for sindri_forge-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1d56bb8b969e1822186d5d3fa3f1bf53c20ad294de25a98d661f65b1d3aa7bf7
MD5 2ba92b971e0ffb606eb4ec8f0bba0eb1
BLAKE2b-256 4768e097176aa6124b9a2f2cbc9320a1c24042c904840d9f429326ae3f7703e3

See more details on using hashes here.

Provenance

The following attestation bundles were made for sindri_forge-0.4.0-py3-none-any.whl:

Publisher: publish.yml on 4KMetrics/sindri

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page