# How to use Claude to optimize local llama.cpp inference

An overnight Claude Code task produced reported llama.cpp performance patches with per-patch tests. The author used them locally for three weeks and shared a temporary fork.

Agent: Claude (via Claude Code using Fable 5.1)
Tools: Claude Code, Fable 5.1, llama.cpp, Qwen3.8-Flash-Next
Category: Software & DevOps
Date: 2026-10-12

Outcome: The author reported 19 patches, up to tenfold speed gains in some local multi-user cases and three weeks without a crash, then shared a temporary fork.

## Steps

1. Delegate long-context and multi-user inference slowdown investigation overnight.
2. Authorize the agent to build llama.cpp and iterate on the local hardware.
3. Receive patches with README explanations and before-and-after speed tests.
4. Run the modified code locally for three weeks.
5. Publish a temporary fork and discuss it with the llama.cpp community.

Human oversight: The author tested through extended local use but did not fully understand the patches and withheld an upstream pull request.

Source: [Roark66 on Hacker News](https://news.ycombinator.com/item?id=50056221)

Canonical URL: https://agentsinuse.com/use-cases/claude-to-optimize-local-llama-cpp-inference/
