rtk-ai / rtk-ai/rtk

Add Devin CLI integration (PreToolUse hook via .devin/hooks.v1.json)

Open
#4,097 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area:cli enhancement help wanted priority:medium
Dominant language
Rust
Stars
81.1k
Forks
5.1k
Avg merge
4d 11h
Merged PRs (30d)
40

Description

Devin CLI, pi, and Codex CLI hook coverage compared:

  • Codex CLI got a real rtk hook codex PreToolUse processor in #3552,
    merged into develop 2026-09-13. Not yet in a tagged release as of this
    writing.
  • Pi has a maintained TypeScript extension (rtk init -g --agent pi, from
    #2022) that calls rtk rewrite on the tool_call event.
  • Devin CLI has no rtk support in any form. Two prior attempts did not
    land: PR #1851 (patched ~/.devin/config.json using Claude Code's hook
    JSON shape, closed unmerged) and the #3144/#3145 pair (closed same day,
    unmerged, no review activity). Issue #3143 was self-closed by its
    author intending a redo that never landed.

Devin CLI documents a real PreToolUse-equivalent hook that fires before
the exec tool runs, with a decision: approve/block and
hookSpecificOutput.updatedInput output shape, the same rewrite
capability rtk already uses for Claude Code and Cursor:

Why this matters in practice, from one real install's usage over the
last 7 days: the Claude Code processor saw 62,562 hook invocations and
13,263 actual command rewrites in that window. Devin CLI, pi, and Codex
CLI lanes on the same machine currently run every shell command
unfiltered, with no equivalent token savings, because only Claude Code
had a wired hook. Codex and Pi are now solvable per above; Devin is not.

Proposed shape, mirroring the existing Claude Code and Cursor processors:

  • rtk hook devin subcommand: reads Devin's PreToolUse JSON from stdin,
    returns { decision: "approve", hookSpecificOutput: { updatedInput: {
    command: "rtk original_command" } } } for rewritable commands, or a
    plain approve for everything else (fail-open, matching the Cursor and
    Pi processors' behavior on rtk errors).
  • rtk init --agent devin: writes .devin/hooks.v1.json (project) or the
    user-level equivalent, with --uninstall and --show support matching
    the other --agent targets.

Two earlier attempts (#1851, #3144, #3145) did not land; happy to test
against a real Devin CLI install if a maintainer wants to pick this back
up, or to open a PR against the shape above if that is preferred.


Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the existing Claude Code and Cursor processors and the other rtk init --agent targets, then read Devin's PreToolUse hook documentation and configuration examples. Add the devin hook subcommand and init --agent devin support with uninstall/show behavior, preserving fail-open approval for non-rewritable commands. Done means the generated .devin/hooks.v1.json works with a real Devin CLI install and returns the documented updatedInput shape for rewritable commands.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cli, tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
62/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.