← Blog

Graft v6.2: graft import — Reverse-Compile Existing Harnesses into .gft

1 min read
graftcompilerllmclaudeproductization

Graft is a DSL that compiles .gft pipeline definitions into Claude Code harness structures. v6.2 adds the reverse direction — importing existing harnesses back into .gft.

The Problem

Existing projects already have .claude/ harness structures — agent definitions, hooks, settings, orchestration plans. Converting them to .gft manually means reading each file and translating it by hand.

graft import

cd your-project
graft import              # reads .claude/, outputs pipeline.gft
graft import -o review.gft  # specify output file

The importer reads:

  • .claude/agents/*.md → node declarations (model, budget, reads, produces with typed fields)
  • .claude/hooks/*.js → edge declarations with transforms (select, compact, filter, drop)
  • .claude/settings.json → model routing overrides, graph budget
  • .claude/orchestration.md → graph flow (sequential, parallel blocks)

Round-Trip Validation

The imported .gft files compile back through Graft cleanly. Tested against all 8 benchmark pipelines — the importer produces valid .gft that passes graft check with correct scope, types, and token budget analysis.

What Shipped

  • v6.1: Safe compilation (orchestration.md separate from CLAUDE.md)
  • v6.2: graft import command with 10 dedicated tests

Current: v6.2.0 on npm, 1,722 tests passing.