tmux-session-capture
Skill0 starsChanged 5 months agoMITView on GitHub
Ingest the user's pre-agent terminal context by capturing tmux pane scrollback with tdump. Use when the user says 'catch up on what I was doing', 'look at my terminal', 'see my shell history', references commands or output from before the agent session started, or hands you a scrollback dump file.
In this repository34 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- architectureSkill
- code-reviewSkill
- debugSkill
- dep-auditSkill
- deploy-checklistSkill
- documentationSkill
- end-agent-sessionSkill
- incident-responseSkill
- likec4-dslSkill
- load-agentSkill
- manual-testSkill
- market-scanSkill
- new-agentSkill
- new-goal-loopSkill
- nexus-microSkill
- nexusSkill
- nexus-sprintSkill
- orchestration-cost-policySkill
- persona-forgeSkill
- project-onboardSkill
- prompt-refinerSkill
- public-readinessSkill
- release-prepSkill
- render-mermaidSkill
- secrets-syncSkill
- standupSkill
- system-designSkill
- tech-debtSkill
- testing-strategySkill
- tsdocSkill
- web-ui-automation-componentsSkill
- web-ui-automation-surveySkill
The file
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 2 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 23
Default output: /tmp/tmux-session.txt.
- Very specific: line 26
If tdump is missing on the machine, fall back to the raw command: tmux capture-pane -p -S - -J > /tmp/tmux-session.txt.
- Very specific: line 44
Never treat a mid-session capture as a session transcript.
- Very specific: line 49
Run fish -c tdump (or the raw tmux command).
- Distinctive: line 50
Read the output file. It may be large.
- Distinctive: line 52
Do not echo the whole dump back at the user -- summarize what you learned.
≈ “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
tmux Session Capture
Capture the user's tmux scrollback so the agent can read their pre-session shell work instead of asking them to copy-paste it.
The mechanism
tdump is a fish function (~/.config/fish/functions/tdump.fish):
tmux capture-pane -p -S - -J > $out # full scrollback, wrapped lines joined
echo $out # echoes path, so (tdump) composes inline- Default output:
/tmp/tmux-session.txt; optional arg overrides the path. - From bash (agent Bash tool):
fish -c tdump, then Read the printed path. - User-side idiom:
claude "read (tdump) and catch up on what I was doing". - If tdump is missing on the machine, fall back to the raw command:
tmux capture-pane -p -S - -J > /tmp/tmux-session.txt.
When to use
- The user references shell work you didn't witness: "as you can see", "that error above", "what I was just doing".
- Bootstrapping an agent session on top of an active terminal workflow.
- Debugging something the user ran interactively before invoking the agent.
Critical limitation -- the TUI repaint trap
Claude Code (and most TUI agents) repaint the screen in place. Agent conversation history never lands in tmux scrollback. A capture taken mid-session yields only:
- Scrollback from before the agent session started, and
- A snapshot of the current viewport (which will include the live spinner and statusline, mid-render).
Consequences:
- Capture is most valuable before entering the agent session -- that is the intended workflow.
- Never treat a mid-session capture as a session transcript. The real record is the transcript JSONL under
~/.claude/projects/<project-dir>/, searchable viaaichat "query". capture-panegrabs the current pane only. Multi-pane workflows need one capture per pane (tmux capture-pane -p -S - -J -t <pane-id>).
Recipe
- Run
fish -c tdump(or the raw tmux command). - Read the output file. It may be large; prefer tail-first if you only need recent context.
- Mine it for: commands run, errors hit, files touched, versions printed.
- Do not echo the whole dump back at the user -- summarize what you learned.
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.

