> ## Documentation Index
> Fetch the complete documentation index at: https://docs.blacksmith.sh/llms.txt
> Use this file to discover all available pages before exploring further.

# CI Tuning

> Speed up builds with runner recommendations and workflow rewrites

export function ExpandableVideo({src, title, className = "codesmith-rightsize-video"}) {
  const [open, setOpen] = useState(false);
  useEffect(() => {
    if (!open) {
      return undefined;
    }
    const onKeyDown = event => {
      if (event.key === "Escape") {
        setOpen(false);
      }
    };
    document.addEventListener("keydown", onKeyDown);
    const previousOverflow = document.body.style.overflow;
    document.body.style.overflow = "hidden";
    return () => {
      document.removeEventListener("keydown", onKeyDown);
      document.body.style.overflow = previousOverflow;
    };
  }, [open]);
  return <>
      <button type="button" className="expandable-video-trigger" onClick={() => setOpen(true)} aria-label={`Expand ${title || "video"}`}>
        <video className={className} src={src} title={title} autoPlay loop muted playsInline />
        <span className="expandable-video-hint" aria-hidden="true">
          Click to expand
        </span>
      </button>

      {open ? <div className="expandable-video-lightbox" role="dialog" aria-modal="true" aria-label={title || "Expanded video"} onClick={() => setOpen(false)}>
          <button type="button" className="expandable-video-close" aria-label="Close" onClick={() => setOpen(false)}>
            ×
          </button>
          <div className="expandable-video-lightbox-media" onClick={event => event.stopPropagation()}>
            <video className="expandable-video-lightbox-video" src={src} title={title} autoPlay loop muted playsInline controls />
          </div>
        </div> : null}
    </>;
}

<div className="codesmith-placeholder-media">
  <video className="codesmith-page-video" src="https://mintcdn.com/blacksmith/nbjvrnrvcCRYe1_Q/images/codesmith/rightsize.mp4?fit=max&auto=format&n=nbjvrnrvcCRYe1_Q&q=85&s=03caf1049ff7ea7e9507d8db3f051f11" title="[code]smith CI Tuning" autoPlay loop muted playsInline data-path="images/codesmith/rightsize.mp4" />
</div>

With context about your CI runs, \[code]smith can analyze workflow job history to speed up your builds.

**Right-sizing:** identifies jobs that are provisioned on the wrong runner size - either consistently exceeding their maximum allocated resources or underutilizing their allocated resources. These instance sizes can be bumped up/down for a speed boost or cost benefit.

**Deep dives:** identifies the jobs that currently take up the most CI time for your builds. \[code]smith can trigger a session analyzing this workflow and applying recommendations like reordering of jobs and Blacksmith configuration changes to optimize.

You can invoke a new right-sizing session by using the "/rightsize" skill. \[code]smith will generate a report with up to 8 runs that can be rightsized, along with a list of the highest-impact jobs where a deep dive could significantly optimize your CI time.

Clicking "deep dive" will begin a new \[code]smith session focused on optimizing that job.

<div className="codesmith-rightsize-layout">
  <div className="codesmith-rightsize-media">
    <Frame>
      <ExpandableVideo className="codesmith-rightsize-video" src="/images/codesmith/rightsize-full.mp4" title="[code]smith CI Tuning recommends runners for your workflows" />
    </Frame>
  </div>
</div>

You can choose to accept any number of \[code]smith's recommendations, or chat more to go deeper and create a PR.
