Skip to main content

claude-code

Send prompts to Claude Code running in a tmux session and get responses.

معلومات المصدر

المستودع
doobidoo/nanobot-fork
آخر نشاط في المصدر
١٣ فبراير ٢٠٢٦ في ٢٠:٤١
لغة SKILL.md المكتشفة
الإنجليزية
النجوم
١
التفرعات
٠

خيارات التثبيت

يُحدَّد Prompt الذي يراجع المصدر أولًا بشكل افتراضي. يمكنك التبديل إلى أمر مباشر أو تنزيل نسخة محلية.

مراجعة ملفات المصدر

اقرأ SKILL.md وأي ملفات مرافقة يعرضها SkillsMP قبل أن تقرر التثبيت.

مستكشف الملفات
3 ملفات

عرض SKILL.md

SKILL.md
تعليمات المصدر · معاينة للقراءة فقط
name
claude-code
description
Send prompts to Claude Code running in a tmux session and get responses.
metadata
{"nanobot":{"emoji":"🤖","os":["linux"],"requires":{"bins":"[Truncated]"}}}
# Claude Code Skill Interact with Claude Code (Anthropic's CLI) running in a persistent tmux session. ## Prerequisites The Claude Code tmux session must be running: ```bash systemctl --user start claude-tmux ``` Or manually: ```bash ~/.local/bin/claude-tmux-start.sh ``` ## Sending Prompts Use the helper script to send a prompt and capture the response: ```bash {baseDir}/scripts/ask-claude.sh "Your prompt here" ``` Or manually via tmux: ```bash # Send prompt tmux send-keys -t claude 'Your prompt here' Enter # Wait for response (check for prompt symbol) sleep 10 # Capture output tmux capture-pane -t claude -p -S -100 ``` ## Checking Status ```bash {baseDir}/scripts/claude-status.sh ``` Returns: - `running` - Claude Code is ready for prompts - `busy` - Claude is processing a request - `stopped` - Session not running ## Session Management ```bash # Start session systemctl --user start claude-tmux # Stop session systemctl --user stop claude-tmux # Restart session systemctl --user restart claude-tmux # Attach to session (interactive) tmux attach -t claude # Detach with Ctrl+B, then D ``` ## Output Parsing Claude Code output includes: - `❯` - Input prompt (ready for new input) - `●` - Claude's response text - `⏵⏵` - Status line (bypass permissions indicator) To extract just the response: ```bash {baseDir}/scripts/ask-claude.sh "prompt" | grep "^●" | sed 's/^● //' ``` ## Example Usage ```bash # Simple question {baseDir}/scripts/ask-claude.sh "What is 2+2?" # Code generation {baseDir}/scripts/ask-claude.sh "Write a Python function to reverse a string" # File operations (Claude has access to filesystem) {baseDir}/scripts/ask-claude.sh "Read and summarize ~/notes.txt" ``` ## Tips - Keep prompts concise for faster responses - Claude Code has full filesystem access in bypass permissions mode - For long operations, increase the wait timeout - Check `~/.local/share/claude-tmux.log` for session logs
عرض على GitHub