Skip to content

Instantly share code, notes, and snippets.

@arockwell
Created July 13, 2025 07:28
Show Gist options
  • Select an option

  • Save arockwell/b468d599784a128095afc760a687b32e to your computer and use it in GitHub Desktop.

Select an option

Save arockwell/b468d599784a128095afc760a687b32e to your computer and use it in GitHub Desktop.
EMDX Tmux Integration: Next Steps Analysis - Ideas for extending tmux pane spawning functionality
tmux_command = f"claude-code --file {temp_path}"
tags = get_document_tags(doc_id)
if '🎯' in tags:  # Gameplan
    tmux_command = f"claude-code --execute-plan {temp_path}"
elif 'πŸ”' in tags:  # Analysis
    tmux_command = f"claude-code --analyze {temp_path}"
elif 'πŸ§ͺ' in tags:  # Test
    tmux_command = f"pytest && cat {temp_path}"
tmux_command = f"""
echo 'Document: {doc['title']}'
echo ''
echo '1) Execute with Claude'
echo '2) Edit in vim'
echo '3) Convert to GitHub issue'
echo '4) Create todo list'
echo ''
read -p 'Choice: ' choice
case $choice in
  1) claude-code --file {temp_path} ;;
  2) vim {temp_path} ;;
  3) gh issue create --title "{doc['title']}" --body-file {temp_path} ;;
  4) emdx todo --from {temp_path} ;;
esac
"""
project = doc.get('project')
if project == 'emdx':
    tmux_command = f"cd ~/dev/emdx && poetry shell && cat {temp_path}"
elif project == 'webapp':
    tmux_command = f"cd ~/projects/webapp && npm run dev & cat {temp_path}"
if 'πŸ§ͺ' in tags:
    subprocess.run(['tmux', 'split-window', '-v', '-p', '30', 'npm test --watch'])

You could add more keys for specific workflows:

Binding("c", "tmux_claude", "Claude β†’", key_display="c"),  # Claude in new pane
Binding("x", "tmux_execute", "Execute β†’", key_display="x"),  # Execute plan
Binding("w", "tmux_watch", "Watch β†’", key_display="w"),  # Watch mode
subprocess.run(['tmux', 'rename-window', f"πŸ“„ {doc['title'][:20]}"])

session_name = f"emdx-{doc_id}"
tmux_command = f"tmux new-session -d -s {session_name} 'cat {temp_path}'"
with tempfile.NamedTemporaryFile(mode='w', suffix='.md', delete=False) as f:
    f.write(f"# {doc['title']}
")
    f.write(f"## Tags: {', '.join(tags)}
")
    f.write(f"## Project: {doc.get('project', 'None')}
")
    f.write(f"## Created: {doc['created_at']}
")
    f.write("
---

")
    f.write(doc['content'])
    
    f.write("

")
  1. Git operations: Auto-create branches named after gameplans
  2. Docker: Spawn containers based on document specs
  3. Testing: Run test suites mentioned in documents
  4. Monitoring: Start watching logs mentioned in analysis
  5. Communication: Auto-draft emails/PRs from plans

What direction excites you most? Want to implement any of these?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment