timesharing
Skill29 starsChanged 7 months agoMITView on GitHub
Multiplexes one agent's attention across independent long-running external processes while preserving one reasoning context. Use for concurrent tests, builds, servers, watchers, REPLs, benchmarks, downloads, and other latency-bearing shell work; never use it to spawn or substitute subagents.
In this repository27 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- broSkill
- build-skillSkill
- cloudflareSkill
- cold-emailSkill
- composio-cliSkill
- copywritingSkill
- diff-walkthroughSkill
- emailsSkill
- frontend-designSkill
- grill-meSkill
- grill-with-docsSkill
- howSkill
- improve-codebase-architectureSkill
- index-knowledgeSkill
- install-skillSkill
- jira-toolSkill
- librarianSkill
- prospectingSkill
- repo-walkthroughSkill
- spec-plannerSkill
- teachSkill
- tmuxSkill
- unslopSkill
- using-git-worktreesSkill
- whySkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
14 rules. About 0 are common, 13 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈13
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 17
Treat yourself as a cooperative scheduler:
- Distinctive: line 20
Start it asynchronously and record its purpose, provenance, dependency, and revisit point.
- Distinctive: line 25
Use a small number of jobs, usually 2-4.
- Very specific: line 38
Run trivial or immediately blocking commands normally: pwd, git status, small reads, quick searches, and commands whose answer determines …
- Distinctive: line 42
Before launch, form a tiny dependency graph.
- Distinctive: line 92
Before consuming a result, compare its launch provenance with current files/configuration.
- Distinctive: line 102
Before answering the user:
- Distinctive: line 105
Never claim success without a verified zero exit status.
- Distinctive: line 106
Check that results still match the current code/input state.
- Distinctive: line 108
Stop and clean disposable jobs you own.
- Distinctive: line 116
Fake concurrency: do useful work after launch.
- Distinctive: line 117
Context flooding: read a relevant tail, not 50,000 repeated log lines.
- Distinctive: line 118
Excessive concurrency: prefer 2-4 purposeful jobs, not 14 vague experiments.
- Distinctive: line 120
Speculative overlap: do not run work whose inputs are still being rewritten.
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 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
Timesharing
Timesharing lets one agent preserve one coherent reasoning context while opportunistically multiplexing its attention across independent external work.
The AI's reasoning stays serial. Only ordinary OS processes run concurrently. Never spawn a subagent, delegate interpretation, or create another AI context for this workflow.
Central Rule
Never block on an independent long-running process when useful independent work exists.
Treat yourself as a cooperative scheduler:
- Identify a command whose result is not immediately required.
- Start it asynchronously and record its purpose, provenance, dependency, and revisit point.
- Continue concrete independent work immediately.
- Revisit at a natural boundary, not through busy polling.
- Interpret the result in the same context that launched it.
Use a small number of jobs, usually 2-4. The goal is to hide external latency without losing cognitive coherence, not to maximize concurrency.
Decide
Timeshare when judgment says all of these are true:
- The command may take meaningful time or must remain alive.
- Its result is not required for the next reasoning step.
- Useful independent work exists, or later interaction/incremental output matters.
- Its inputs are stable enough that the run will remain useful.
Typical jobs include test suites, builds, installs, Docker builds, servers, watchers, long scripts, migrations, data/model processing, downloads, benchmarks, integration tests, REPLs, and debuggers.
Run trivial or immediately blocking commands normally: pwd, git status, small reads, quick searches, and commands whose answer determines the very next step. Use judgment, not a hard timing threshold.
Schedule
Before launch, form a tiny dependency graph. Only overlap genuinely independent work. Do not start a run whose inputs are likely to be invalidated immediately.
Maintain a lightweight in-context ledger:
JOB PURPOSE LOCATION STATE DEPENDS/REVISIT
ts-tests validate parser tmux:ts-repo-tests-... running after serializer edit
ts-api integration target tmux:ts-repo-api-... persistent before requestsKnow for each job: what and why, location, state, expected result, dependents, revisit point, and code/input provenance. The helper persists operational metadata; the purpose and dependency graph remain in this agent's unified mental model.
Natural scheduling points include after an edit, before a dependent decision, after another job completes, when no independent work remains, before final response, or when input may be needed. Do not repeatedly check a job without useful work between checks. If nothing useful remains, bounded waiting or inspection is honest and appropriate.
Use The Interface
The bundled script prefers isolated tmux sessions and falls back to background processes when tmux is unavailable. Run it by absolute path when necessary:
timesharing/scripts/timeshare.sh start tests \
--purpose 'validate parser fix' --dependency 'review after serializer edit' \
--provenance 'parser change A' -- npm test
timesharing/scripts/timeshare.sh start api --persistent \
--purpose 'serve integration target' -- npm run dev
timesharing/scripts/timeshare.sh list
timesharing/scripts/timeshare.sh status tests
timesharing/scripts/timeshare.sh inspect tests --lines 80
timesharing/scripts/timeshare.sh send repl --literal 'value.inspect' --enter
timesharing/scripts/timeshare.sh interrupt api
timesharing/scripts/timeshare.sh stop api
timesharing/scripts/timeshare.sh cleanupNames become lowercase ts-* job IDs. The tmux session also includes a repository name and workspace hash, preventing cross-repository collisions. Existing live jobs are never silently replaced. Resolve and inspect exact registered IDs before sending input, interrupting, or stopping anything.
For detailed operations, states, fallback behavior, and failures, read references/operations.md. For scheduling examples, read references/examples.md. Load the lower-level tmux skill only when pane layout or tmux-specific mechanics beyond this interface are needed.
Interpret State And Output
The lifecycle is:
planned -> running -> completed | failed | waiting | persistent
-> consumed -> cleaned upThe helper detects running, completed, failed, persistent, and unexpectedly terminated. For interactive jobs, infer waiting versus computing from the recent tail and prompt. Infer a stall only from elapsed time, unchanged output, expected behavior, and process state; do not guess from silence alone.
Inspect recent output first. Increase --lines only when the error needs earlier context. Never flood this context with whole logs by default. Treat a missing completion marker as unknown/unexpected termination, not success.
Before consuming a result, compare its launch provenance with current files/configuration. A run against state A does not validate later state B. Rerun relevant validation after material edits.
Interactive And Persistent Jobs
Mark servers/watchers with --persistent; continued execution is expected, not failure. Mark REPLs/debuggers with --interactive; tmux is required. Inspect the exact job before send, and send the least powerful input needed. Never send destructive keys to an uncertain target.
The shell fallback supports finite and persistent non-interactive commands, but not interactive input or durable terminal attachment. Report that limitation when fallback is used.
Finish
Before answering the user:
- Inspect every important outstanding finite job.
- Never claim success without a verified zero exit status.
- Check that results still match the current code/input state.
- State which requested services intentionally remain persistent.
- Stop and clean disposable jobs you own; never kill uncertain or unrelated processes.
- Preserve services the user explicitly asked to leave running.
Communicate only meaningful transitions: "Tests are running while I inspect the serializer" or "The build passed; integration tests are still running." Do not narrate every tmux command or status check.
Anti-Patterns
- Subagent substitution: same agent launches a process; never spawn another AI to run or interpret it.
- Fake concurrency: do useful work after launch; do not launch and immediately poll in a loop.
- Context flooding: read a relevant tail, not 50,000 repeated log lines.
- Excessive concurrency: prefer 2-4 purposeful jobs, not 14 vague experiments.
- Stale validation: record what state ran and never apply an old result to newer changes.
- Speculative overlap: do not run work whose inputs are still being rewritten.
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.

