feat(tmux): run claude via ai-jail in popup#191
Open
rafaeloledo wants to merge 1 commit into
Open
Conversation
Contributor
Author
Solution for the problem exposed on your video: https://youtu.be/7LG2Gui9ZWA?si=f-kaP85EXhnJFuwI&t=367 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
Wraps the
claudeinvocation in the tmux popup binding (prefix + y) withai-jailso the Claude Code session runs inside a sandbox rather than directly on the host.What is ai-jail?
ai-jail(by @akitaonrails) is a lightweight sandbox launcher for AI coding agents. It runs the wrapped command (here,claude) under a constrained environment — restricting filesystem and network access — so an agent that goes off the rails (roguerm, unexpected network egress, writes outside the project) can't damage the broader system. The agent still gets the working directory it needs, but with guardrails.Change
A single edit in
.config/tmux/utility.conf: the popup spawnsai-jail claudeinstead ofclaude. Behavior is otherwise identical — same per-directory session naming, same popup geometry.Usage
CLI
Once
ai-jailis onPATH, the tmux binding works transparently —prefix + yopens a popup runningclaudeinside the sandbox. You can also invoke it manually from any shell:.ai-jailconfig fileai-jailreads a per-project.ai-jailfile from the working directory. It controls what the sandboxed command can see and reach:Typical tweaks:
~/.config/some-tooltoro_mapsif the agent needs to read external config.rw_mapsto share artifacts between runs.["443"]inallow_tcp_portsto permit HTTPS egress for tools that fetch packages.For more: https://github.com/akitaonrails/ai-jail#quick-start
Caveat
This assumes
ai-jailis installed and onPATH. Users without it will see the popup fail to attach. Happy to gate it behind anif command -v ai-jailcheck if preferred, or leave as-is and document the dependency in the README.Test plan
ai-jailinstalled, prefix + y opens the popup andclauderuns sandboxedCredits
@akitaonrails