Repository navigation
Conversation
2 tasks
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #663 +/- ##
==========================================
+ Coverage 61.99% 62.05% +0.05%
==========================================
Files 29 29
Lines 5091 5091
Branches 1082 1082
==========================================
+ Hits 3156 3159 +3
+ Misses 1595 1592 -3
Partials 340 340 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
tony
force-pushed
the
2026-04-libtmux-profiler-skill
branch
from
May 10, 2026 16:01
b6b40f1 to
aeb0ed0
Compare
tony
force-pushed
the
2026-04-libtmux-profiler-skill
branch
from
May 30, 2026 12:01
aeb0ed0 to
041a80f
Compare
tony
force-pushed
the
2026-04-libtmux-profiler-skill
branch
from
July 18, 2026 11:01
041a80f to
8fb3543
Compare
tony
force-pushed
the
2026-04-libtmux-profiler-skill
branch
6 times, most recently
from
November 28, 2026 12:49
4817253 to
fb8a9be
Compare
…/skills/ why: Profiling investigations against libtmux/tmuxp historically required ad-hoc cProfile invocations and manual flamegraph wrangling. Python 3.15's new stdlib `profiling.sampling` module (Tachyon) ships everything needed in-tree — flamegraphs, heatmaps, line-level attribution, pstats — but the "how to use it on this codebase" knowledge isn't discoverable from the module help. This skill is the institutional capital that makes Tachyon trivially repeatable on libtmux/tmuxp work. what: - SKILL.md with workflows for: pstats top-N (terminal-only summary), automated pstats diff (before/after with the bundled diff-pstats.py helper, replaces the broken --diff-flamegraph alpha), single-call microbench (per-call timing of one libtmux API), heatmap (line-level attribution), live TUI (top(1)-style real-time profiler), attach to a running pytest (diagnose hangs without restart), sampling-mode selection guide, output-reading cheat sheet - scripts/setup-tachyon-venv.sh: idempotent bootstrap that creates `.venv-3.15` with libtmux installed editable + the testing dep group (skips dev because watchfiles has no Rust wheel for 3.15a8 yet) - scripts/init-profile-session.sh: builds the per-session output directory at /tmp/py-profiling/<TS>/<project>/<branch>/<name>/ and writes a README.md with HEAD short-sha so the artifact set stays reconstructable after the branch moves - scripts/bench-libtmux-call.py: tight-loop microbench against a real tmux server using a registry-of-callables design (BENCH_TARGETS dict) so the script can never execute caller-supplied Python expressions. Targets: has_session, list_sessions, list_windows, session_name, show_options, list_panes - scripts/diff-pstats.py: structured pstats arithmetic — loads two .pstats files, computes per-function cumtime deltas, prints a markdown table sorted by abs(delta) for paste-into-PR/issue use. Replaces Python 3.15.0a8's broken `--diff-flamegraph` until the upstream UnboundLocalError is fixed - reference/flamegraph-reading.md: visual-signature cheat sheet for reading plain flamegraphs (sleep loops, fixture setup, dispatch chains) and diff flamegraphs (when 3.15 fixes the alpha bug) - .gitignore: override the global `.claude/` ignore so this skill ships with the repo
tony
force-pushed
the
2026-04-libtmux-profiler-skill
branch
from
November 29, 2026 02:48
fb8a9be to
95d3146
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note
Master through
v0.70.0dropped Python3.10in #849 (0.63.0) and already includes Python3.15alongside3.11–3.14in.tool-versions(#834).Summary
Adds a Claude Code skill at
.claude/skills/libtmux-profiler/that documents and automates Python 3.15's stdlibprofiling.sampling(Tachyon) for libtmux/tmuxp work. Pure tooling addition — no runtime code changes, no public API impact.What's in here
The skill itself
SKILL.mddocuments seven workflows for libtmux/tmuxp performance investigation:diff-pstats.pyhelper (replaces Python 3.15.0a8's broken--diff-flamegraph)wall/cpu/gil/exception)reference/flamegraph-reading.mdis a visual-signature cheat sheet for plain and diff flamegraphs.Helper scripts
Each script in
.claude/skills/libtmux-profiler/scripts/solves a single discrete problem:setup-tachyon-venv.sh— idempotent bootstrap that creates a.venv-3.15venv with libtmux installed editable plus the testing dep group. Skips the dev group becausewatchfileshas no Rust wheel for 3.15a8 yet.init-profile-session.sh— builds the per-session output directory at/tmp/py-profiling/<TS>/<project>/<branch>/<name>/and writes a README with HEAD short-sha so the artifact set stays reconstructable after the branch moves.bench-libtmux-call.py— tight-loop microbench against a real tmux server. Uses a registry-of-callables design (BENCH_TARGETSdict) so the script can never execute caller-supplied Python expressions. Built-in targets:has_session,list_sessions,list_windows,session_name,show_options,list_panes.diff-pstats.py— markdown table of cumtime deltas between two.pstatsfiles, sorted byabs(Δ)so the biggest movers surface first. Paste-ready for PRs, issues, or chat.Toolchain bump
.tool-versionsadds Python 3.15.0a8 alongside the existing 3.10-3.14. The project's pinned Python (3.14) is unchanged — 3.15 is only used by the skill's.venv-3.15venv..gitignoreoverrides the global.claude/ignore so this skill ships with the repo.What this is not
src/libtmux/is touched.Verification
The skill is non-runtime, so verification is mostly "the bootstrap is idempotent and the helpers don't crash."
The setup script is idempotent — safe to re-run, skips work when the venv already exists:
$ bash .claude/skills/libtmux-profiler/scripts/setup-tachyon-venv.shSmoke-test the diff helper against any two
.pstatsfiles:$ ./.venv-3.15/bin/python .claude/skills/libtmux-profiler/scripts/diff-pstats.py path/to/baseline.pstats path/to/current.pstats --top 10Smoke-test the microbench against the default
has_sessiontarget:$ BENCH_ITERS=100 ./.venv-3.15/bin/python .claude/skills/libtmux-profiler/scripts/bench-libtmux-call.pyTest plan
pytestis unaffected — same 885 + 1 skipped as on master