agentleFS
adampoitadampoit/ai/skills/tmux-interactive-processes/SKILL.md

tmux-interactive-processes

Skill2 starsChanged 13 days agoMITView on GitHub

Use tmux instead of background bash for long-running, interactive, inspectable, or user-attachable terminal processes. Use for development servers, watch-mode tests, REPLs, debuggers, interactive CLIs, log tailing, and commands that may run indefinitely or need later input/inspection.

The file

Show its rules and text

We split this skill into the rules it gives an agent

14 rules. About 0 are common, 12 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈12

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use tmux when a command needs to keep running, accept later input, show ongoing output, or remain available for human attachment.

    line 8
  2. Distinctive:

    Prefer tmux over raw background shell patterns because the process stays visible, inspectable, attachable, and controllable.

    line 10
  3. Distinctive:

    Do not use these patterns for long-running or interactive work:

    line 14
  4. Distinctive:

    Use normal shell execution only when the command runs to completion and prints final output.

    line 24
  5. Distinctive:

    Use stable, descriptive names:

    line 28
  6. Distinctive:

    Check existing sessions before creating a new one:

    line 43
  7. Distinctive:

    Create a detached session from the current working directory:

    line 53
  8. Very specific:

    Use capture-pane to verify readiness, failures, prompts, and current state.

    line 82
  9. Very specific:

    Use send-keys for REPLs, debuggers, prompts, and graceful shutdown.

    line 98
  10. Distinctive:

    When useful, report the session name and attach command:

    line 102
  11. Distinctive:

    Prefer graceful shutdown first:

    line 110
  12. Distinctive:

    Remove the session only when it is no longer needed:

    line 122
  13. Distinctive:

    If a command is expected to run continuously, wait for input, display ongoing output, or require later interaction, use tmux.

    line 140
  14. Distinctive:

    If a command runs to completion and only prints final output, use normal shell execution.

    line 142

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Tmux Interactive Processes

Use tmux when a command needs to keep running, accept later input, show ongoing output, or remain available for human attachment.

Prefer tmux over raw background shell patterns because the process stays visible, inspectable, attachable, and controllable.

Avoid Background Bash

Do not use these patterns for long-running or interactive work:

command &
nohup command &
command > log.txt 2>&1 &
disown
tail -f log.txt

Use normal shell execution only when the command runs to completion and prints final output.

Session Names

Use stable, descriptive names:

agent-<repo-or-project>-<purpose>

Examples:

agent-myapp-dev
agent-myapp-tests
agent-myapp-debug
agent-myapp-repl

Check existing sessions before creating a new one:

tmux list-sessions

Reuse a matching session when appropriate.

Start Commands

Create a detached session from the current working directory:

tmux new-session -d -s agent-myapp-dev -c "$PWD" 'npm run dev'

For commands with tricky quoting, start a shell first:

tmux new-session -d -s agent-myapp-dev -c "$PWD" bash
tmux send-keys -t agent-myapp-dev 'npm run dev' C-m

Inspect the pane after startup before claiming success.

Inspect Output

Capture recent output:

tmux capture-pane -pt agent-myapp-dev -S -200

Capture more history:

tmux capture-pane -pt agent-myapp-dev -S -1000

Use capture-pane to verify readiness, failures, prompts, and current state.

Send Input

Send text followed by Enter:

tmux send-keys -t agent-myapp-dev 'help' C-m

Send control keys:

tmux send-keys -t agent-myapp-dev C-c

Use send-keys for REPLs, debuggers, prompts, and graceful shutdown.

User Attachment

When useful, report the session name and attach command:

tmux attach -t agent-myapp-dev

Stop Sessions

Prefer graceful shutdown first:

tmux send-keys -t agent-myapp-dev C-c

Inspect after shutdown:

tmux capture-pane -pt agent-myapp-dev -S -100

Remove the session only when it is no longer needed:

tmux kill-session -t agent-myapp-dev

Checklist

  1. Run tmux list-sessions.
  2. Reuse a matching session or create a detached session.
  3. Capture pane output after startup.
  4. Report the session name to the user.
  5. Inspect with capture-pane before making claims about state.
  6. Interact with send-keys when input is needed.
  7. Clean up sessions that are no longer needed.

Decision Rule

If a command is expected to run continuously, wait for input, display ongoing output, or require later interaction, use tmux.

If a command runs to completion and only prints final output, use normal shell execution.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.