tuning

tuning is a skill for Claude Code, Codex from chaterm/terminal-skills. It costs 6 tokens per session (1,516 once invoked), scanned A, original, Apache-2.0.

A guide to adjusting Linux operating-system settings for memory, networking, file systems, and process limits. It uses kernel parameters and configuration files to change how the system handles resources.

In plain words
What is it for?
Configuring memory swapping, dirty-page handling, TCP buffers and connection queues, file handles, file watchers, ports, and process limits.
Why use it?
It helps investigate or change default limits that can restrict applications under heavy workloads.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: positional $N argument.

Good fit Configuring memory swapping, dirty-page handling, TCP buffers and connection queues, file handles, file watchers, ports, and process limits.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/chaterm/terminal-skills/tuning
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add chaterm/terminal-skills --skill tuning
Clone the repo
git clone --depth 1 https://github.com/chaterm/terminal-skills

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for tuning

README.md
[![agentmods](https://agentmods.dev/badge/skills/chaterm/terminal-skills/tuning/github.svg)](https://agentmods.dev/skills/chaterm/terminal-skills/tuning)
Your own site
<a href="https://agentmods.dev/skills/chaterm/terminal-skills/tuning"><img src="https://agentmods.dev/badge/skills/chaterm/terminal-skills/tuning/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for tuning

Your own site · 80×15
<a href="https://agentmods.dev/skills/chaterm/terminal-skills/tuning"><img src="https://agentmods.dev/badge/skills/chaterm/terminal-skills/tuning.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 6 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,516 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00006 $0.01516
Opus 5 $0.00003 $0.00758
Sonnet 5 $0.00001 $0.00303
Haiku 4.5 $0.00001 $0.00152

Measured 10d ago against content hash 275799ca6c19, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

tuning scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 10d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

performance/tuning/SKILL.md · 241 lines

How it starts

The opening of the file, as written. The whole thing — 241 lines — stays where its author put it; the contents beside it link to each section on GitHub.

系统调优

概述

内核参数、文件系统、网络优化技能。

内核参数调优

内存管理

# /etc/sysctl.d/99-memory.conf

# 减少交换倾向
vm.swappiness = 10

# 脏页刷新
vm.dirty_ratio = 20
vm.dirty_background_ratio = 5

# 内存过量提交
vm.overcommit_memory = 1
vm.overcommit_ratio = 80

# 最大内存映射数
vm.max_map_count = 262144

# 应用
sysctl -p /etc/sysctl.d/99-memory.conf

网络调优

# /etc/sysctl.d/99-network.conf

# TCP 缓冲区
net.core.rmem_max = 16777216
net.core.wmem_max = 16777216
net.ipv4.tcp_rmem = 4096 87380 16777216
net.ipv4.tcp_wmem = 4096 65536 16777216

# 连接队列
net.core.somaxconn = 65535
net.core.netdev_max_backlog = 65535
net.ipv4.tcp_max_syn_backlog = 65535

# TIME_WAIT
net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_fin_timeout = 30
net.ipv4.tcp_max_tw_buckets = 65535

# 端口范围
net.ipv4.ip_local_port_range = 1024 65535

# Keep-Alive
net.ipv4.tcp_keepalive_time = 600
net.ipv4.tcp_keepalive_intvl = 30
net.ipv4.tcp_keepalive_probes = 3

文件系统

# /etc/sysctl.d/99-fs.conf

# 文件句柄
fs.file-max = 2097152
fs.nr_open = 2097152

# inotify
fs.inotify.max_user_watches = 524288
fs.inotify.max_user_instances = 512

文件描述符限制

ulimit 配置

# /etc/security/limits.conf
* soft nofile 65535
* hard nofile 65535
* soft nproc 65535
* hard nproc 65535

root soft nofile 65535
root hard nofile 65535

systemd 服务

# /etc/systemd/system/myapp.service.d/limits.conf
[Service]
LimitNOFILE=65535
LimitNPROC=65535

磁盘 IO 调优

IO 调度器

# 查看当前调度器
cat /sys/block/sda/queue/scheduler

# 设置调度器
echo deadline > /sys/block/sda/queue/scheduler
echo noop > /sys/block/sda/queue/scheduler      # SSD
echo mq-deadline > /sys/block/nvme0n1/queue/scheduler

# 永久设置 (GRUB)
GRUB_CMDLINE_LINUX="elevator=deadline"

预读设置

# 查看预读
blockdev --getra /dev/sda

# 设置预读 (KB)
blockdev --setra 4096 /dev/sda

挂载选项

# /etc/fstab
# SSD 优化
/dev/sda1 /data ext4 defaults,noatime,nodiratime,discard 0 2

# 数据库优化
/dev/sdb1 /mysql ext4 defaults,noatime,barrier=0 0 2

CPU 调优

CPU 频率

# 查看调速器
cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor

# 设置性能模式
cpupower frequency-set -g performance

# 或直接设置
echo performance | tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor

Read the full file on GitHub · 241 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 10d ago First seen · 241 lines · 6 tokens per session scan A 275799ca6c19

Subscribe to this mod's changes

tuning is a skill published in the GitHub repository chaterm/terminal-skills (59 stars, last pushed 6mo ago), licensed Apache-2.0. It adds 6 tokens to every session and 1,516 once invoked, about $0.0000 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.