instar-session
Skill86 starsChanged 4 months agoMITView on GitHub
Spawn, monitor, and communicate with persistent Claude Code sessions running in the background. Use when a task needs to run without blocking the current session, when the user asks to do something in the background, or when a long-running task needs its own context window. Trigger words: background task, spawn session, persistent, run in background, parallel, separate session, async task.
- Sends data out
In this repository23 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- autonomousSkill
- buildSkill
- instar-projectSkill
- secret-setupSkill
- setup-wizardSkill
- test-as-selfSkill
- agent-identitySkill
- agent-memorySkill
- agent-passportSkill
- agent-readinessSkill
- command-guardSkill
- credential-leak-detectorSkill
- instar-devSkill
- instar-feedbackSkill
- instar-identitySkill
- instar-schedulerSkill
- instar-telegramSkill
- iterative-converging-auditSkill
- knowledge-baseSkill
- smart-web-fetchSkill
- spec-convergeSkill
- systematic-debuggingSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
14 rules. About 0 are common, 5 are distinctive, and 9 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
9
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 19
Before using this skill, check if Instar is available:
- Very specific: line 21
Check for Instar: ls .instar/config.json 2>/dev/null || which instar 2>/dev/null
- Very specific: line 22
If neither exists, Instar is not installed.
- Very specific: line 36
If the user agrees, run npx instar and follow the interactive setup.
- Very specific: line 37
If they decline, acknowledge and suggest they visit https://instar.sh when ready.
- Very specific: line 39
If Instar is installed, verify the server: curl -sf http://localhost:4040/health
- Very specific: line 40
If server is not running: "The Instar server needs to be running.
- Distinctive: line 47
Sessions: run in tmux panes. They persist across terminal disconnects.
- Distinctive: line 152
Follow-up instructions while a session is in progress
- Distinctive: line 188
Before spawning a new session for a task, check if one already exists:
- Distinctive: line 262
Every spawned session runs as a full Claude Code process and inherits:
- Distinctive: line 266
All hooks (dangerous command guards, identity injection, etc.)
- Very specific: line 267
All skills in .claude/skills/
- Very specific: line 268
All scripts in .claude/scripts/
≈ “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.
Files
instar-session — Persistent Agent Session Management
Instar lets you spawn, monitor, and communicate with Claude Code sessions running as background processes in tmux. Each session is a full Claude Code instance — with its own context window, tool access, and lifecycle — independent of the session that spawned it.
Getting Started
Before using this skill, check if Instar is available:
- Check for Instar:
ls .instar/config.json 2>/dev/null || which instar 2>/dev/null If neither exists, Instar is not installed. Tell the user:
"Right now, your agent can only do one thing at a time. Ask it to research something, and you wait. Ask it to run a long audit, and your terminal is locked up. Close the window, and the work dies.
Instar gives your agent the ability to spawn itself. Need three things researched? Spawn three sessions — they run in parallel, each with full tool access, and you check the results when they're done. Need a deep security audit that takes 20 minutes? Spawn it in the background and keep working. Close your laptop, come back tomorrow — the session kept running.
It takes about 2 minutes to set up. One command:
npx instarYour agent stops being single-threaded. It becomes a team. Learn more at instar.sh"
If the user agrees, run
npx instarand follow the interactive setup. If they decline, acknowledge and suggest they visit https://instar.sh when ready.- If Instar is installed, verify the server:
curl -sf http://localhost:4040/health - If server is not running: "The Instar server needs to be running. Want me to start it? (
instar server start)" - Once running, proceed with the instructions below.
Core Concepts
- Sessions run in tmux panes. They persist across terminal disconnects.
- Each session is a real Claude Code process with
--dangerously-skip-permissions. - The server tracks sessions, captures output, and provides input relay.
- Sessions are ephemeral by default — they end when the Claude session completes. Scheduled jobs auto-respawn.
Spawning a Session
Via the Server API
# Auth token from .instar/config.json
AUTH=$(python3 -c "import json; print(json.load(open('.instar/config.json'))['auth']['token'])")
# Spawn a session
curl -s -X POST http://localhost:4040/sessions/spawn \
-H 'Content-Type: application/json' \
-H "Authorization: Bearer $AUTH" \
-d '{
"name": "research-task",
"prompt": "Research the latest changes to the Next.js App Router and write a summary to research-notes.md",
"model": "sonnet"
}' | python3 -m json.toolSpawn Parameters
| Parameter | Required | Description |
name | Yes | Session identifier. Lowercase, hyphens allowed. Must be unique. |
prompt | Yes | The initial instruction for the Claude session. |
model | No | opus, sonnet, or haiku (default: sonnet) |
jobSlug | No | Associate with a scheduled job for tracking |
The server returns the session name and status. The session starts immediately in the background.
Listing and Monitoring Sessions
List all active sessions
AUTH=$(python3 -c "import json; print(json.load(open('.instar/config.json'))['auth']['token'])")
curl -s http://localhost:4040/sessions \
-H "Authorization: Bearer $AUTH" | python3 -m json.toolResponse includes status (running, idle, completed, error), start time, and associated job.
Filter by status
# Only running sessions
curl -s "http://localhost:4040/sessions?status=running" \
-H "Authorization: Bearer $AUTH"
# Completed sessions
curl -s "http://localhost:4040/sessions?status=completed" \
-H "Authorization: Bearer $AUTH"List tmux sessions directly
curl -s http://localhost:4040/sessions/tmux \
-H "Authorization: Bearer $AUTH"Capturing Output
AUTH=$(python3 -c "import json; print(json.load(open('.instar/config.json'))['auth']['token'])")
# Get the last 100 lines of output from a session
curl -s "http://localhost:4040/sessions/research-task/output?lines=100" \
-H "Authorization: Bearer $AUTH"
# Get more output
curl -s "http://localhost:4040/sessions/research-task/output?lines=500" \
-H "Authorization: Bearer $AUTH"Output is captured from the tmux pane and returned as plain text. This is the primary way to check what a background session has done.
Sending Input to a Running Session
You can send follow-up messages to a session that's still active:
AUTH=$(python3 -c "import json; print(json.load(open('.instar/config.json'))['auth']['token'])")
curl -s -X POST http://localhost:4040/sessions/research-task/input \
-H 'Content-Type: application/json' \
-H "Authorization: Bearer $AUTH" \
-d '{"text": "Also check for any breaking changes in the Pages Router"}'This injects the text into the tmux session as if typed at the prompt. Use this for:
- Follow-up instructions while a session is in progress
- Answering questions the session posed
- Redirecting focus mid-task
Killing a Session
AUTH=$(python3 -c "import json; print(json.load(open('.instar/config.json'))['auth']['token'])")
curl -s -X DELETE "http://localhost:4040/sessions/research-task" \
-H "Authorization: Bearer $AUTH"Session Lifecycle
spawn → running → (working) → idle → completed
↓
error (if Claude exits with error)- running — Session is active and processing
- idle — Session is waiting at a prompt (nothing to do)
- completed — Session finished its work and exited cleanly
- error — Session encountered an error
Sessions in idle or completed state are safe to kill. Sessions in running state will be interrupted.
Checking Session Status
Before spawning a new session for a task, check if one already exists:
AUTH=$(python3 -c "import json; print(json.load(open('.instar/config.json'))['auth']['token'])")
# Check if 'research-task' session exists and what it's doing
curl -s http://localhost:4040/sessions \
-H "Authorization: Bearer $AUTH" | python3 -c "
import json, sys
sessions = json.load(sys.stdin)
for s in sessions:
if s.get('name') == 'research-task':
print(f'Status: {s[\"status\"]}')
print(f'Started: {s.get(\"startedAt\", \"unknown\")}')
"Multi-Session Patterns
Pattern 1: Parallel research
Spawn multiple sessions to research different topics simultaneously:
AUTH=$(python3 -c "import json; print(json.load(open('.instar/config.json'))['auth']['token'])")
for topic in "react-19-changes" "nextjs-15-changes" "typescript-5-changes"; do
curl -s -X POST http://localhost:4040/sessions/spawn \
-H 'Content-Type: application/json' \
-H "Authorization: Bearer $AUTH" \
-d "{
\"name\": \"$topic\",
\"prompt\": \"Research $topic and write findings to docs/$topic.md\",
\"model\": \"haiku\"
}"
doneThen check their output when complete:
for topic in "react-19-changes" "nextjs-15-changes" "typescript-5-changes"; do
echo "=== $topic ==="
curl -s "http://localhost:4040/sessions/$topic/output?lines=50" \
-H "Authorization: Bearer $AUTH"
donePattern 2: Long-running background task
For tasks that take more than a few minutes, spawn and check back later:
# Spawn the long task
curl -s -X POST http://localhost:4040/sessions/spawn \
-H 'Content-Type: application/json' \
-H "Authorization: Bearer $AUTH" \
-d '{
"name": "full-audit",
"prompt": "Perform a full security audit of the codebase. Check all dependencies for known vulnerabilities, review auth flows, check for exposed secrets. Write a report to audit-report.md when complete.",
"model": "opus"
}'
# Check status (the session runs while you do other work)
curl -s http://localhost:4040/sessions \
-H "Authorization: Bearer $AUTH" | python3 -m json.toolWhat Sessions Inherit
Every spawned session runs as a full Claude Code process and inherits:
- The project's
CLAUDE.mdinstructions - The agent's identity files (
AGENT.md,USER.md,MEMORY.md) - All hooks (dangerous command guards, identity injection, etc.)
- All skills in
.claude/skills/ - All scripts in
.claude/scripts/
The session starts fresh from its prompt, but operates with full project context. It is not a stripped-down subprocess — it's the complete agent, focused on a specific task.
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
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.

