device-shell

device-shell is a skill for Claude Code, Codex from qiannianhuanxiang/DSHA. It costs 38 tokens per session (745 once invoked), scanned A, original, MIT.

A procedure for running commands on an Android phone or other Android device from a Linux-based environment. It uses ADB, Android’s standard debugging connection, and can optionally use a local Shizuku HTTP shell bridge.

In plain words
What is it for?
It helps retrieve device details, list installed apps, launch an app, check which app is in the foreground, and run Android shell commands such as package or activity tools.
Why use it?
It provides a documented way to inspect and control a connected Android device when the agent itself is running in Linux or a similar environment. It also clarifies that normal ADB access usually has limited permissions rather than full administrator access.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit It helps retrieve device details, list installed apps, launch an app, check which app is in the foreground, and run Android shell commands such as package or activity tools.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/qiannianhuanxiang/dsha/device-shell
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 qiannianhuanxiang/DSHA --skill device-shell
Clone the repo
git clone --depth 1 https://github.com/qiannianhuanxiang/DSHA

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 device-shell

README.md
[![agentmods](https://agentmods.dev/badge/skills/qiannianhuanxiang/dsha/device-shell/github.svg)](https://agentmods.dev/skills/qiannianhuanxiang/dsha/device-shell)
Your own site
<a href="https://agentmods.dev/skills/qiannianhuanxiang/dsha/device-shell"><img src="https://agentmods.dev/badge/skills/qiannianhuanxiang/dsha/device-shell/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 device-shell

Your own site · 80×15
<a href="https://agentmods.dev/skills/qiannianhuanxiang/dsha/device-shell"><img src="https://agentmods.dev/badge/skills/qiannianhuanxiang/dsha/device-shell.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 38 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 745 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00038 $0.00745
Opus 5.5 $0.00015 $0.00298
Sonnet 5.5 $0.00008 $0.00149
Haiku 4.5 $0.00004 $0.00075

Measured 2mo ago against content hash 164319af3762, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

device-shell scanned grade A with 1 finding 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 2mo 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.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

curl -sG 'http://127.0.0.1:<port>/exec' --data-urlencode 'cmd=<command>'
agent-skills/device-shell/SKILL.md · 81 lines

How it starts

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

Android Device Shell

Run commands on an Android device from a Linux-based agent environment.

The device is reachable through ADB. Replace <serial> with the actual device serial shown by adb devices.

adb -s <serial> shell '<device shell command>'

Examples:

# identity / basic info
adb -s <serial> shell 'id; getprop ro.product.model; getprop ro.build.version.release'

# list packages
adb -s <serial> shell pm list packages

# launch an app to foreground
adb -s <serial> shell cmd package resolve-activity --brief -a android.intent.action.MAIN -c android.intent.category.LAUNCHER <package>
adb -s <serial> shell am start -n <resolved-component>

# check current foreground app
adb -s <serial> shell dumpsys window | grep -E 'mCurrentFocus|mFocusedApp'
adb -s <serial> shell dumpsys activity activities | grep -E 'ResumedActivity'

Notes:

  • ADB shell usually runs as uid=2000(shell), not root.
  • Use am, pm, input, dumpsys, getprop, cmd for Android-specific operations.

Channel 2: Local Shizuku HTTP bridge

Some Android host apps expose a local HTTP shell bridge. A common pattern is:

curl -sG 'http://127.0.0.1:<port>/exec' --data-urlencode 'cmd=<command>'

Response is JSON:

{"result":"<command output>\n[EXIT=<code>]"}

If it returns a service-not-ready marker such as [SHIZUKU_SERVICE_NOT_READY], the Shizuku UserService has not been bound yet. Restart the host app/service after granting Shizuku permission, then try again.

Channel 3: Termux environment (DSHA)

When the agent runs inside Termux (not proot), destructive commands are wrapped and require user confirmation:

  • rm, dd, mkfs*, fdisk, reboot, shutdown, halt, poweroff, wipe, pm, sm, settings are replaced by wrappers in ~/dsh-bin/ (prepended to PATH by the DSHA launcher).
  • Running one triggers a termux-dialog confirmation popup on the device ("DSHA 安全确认:模型试图执行 [...]"). The command blocks until the user checks "允许" (allow) or cancels.
  • If rejected, or Termux:API (termux-api package) is not installed, the wrapper exits non-zero. Treat a non-zero exit as "user denied" — do not retry the same destructive command; ask the user or choose a safer path.

Read the full file on GitHub · 81 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. 2mo ago First seen · 81 lines · 38 tokens per session scan A 164319af3762

Subscribe to this mod's changes

device-shell is a skill published in the GitHub repository qiannianhuanxiang/DSHA (392 stars, last pushed 2mo ago), licensed MIT. It adds 38 tokens to every session and 745 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

device-shell compared with skills from other repositories

device-shell next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
device-shellqiannianhuanxiang/DSHASkill3922mo agoMITA38Claude Code, Codex
kotlin-expertpersonamanagmentlayer/pclSkill4411d agoApache-2.0A55Claude Code
release-new-versionniki914/zafiroSkill3404d agoMITA54Claude Code, Codex
extract-apkniki914/zafiroSkill3404d agoMITA105Claude Code, Codex
zafiro-qaniki914/zafiroSkill3404d agoMITA71Claude Code, Codex
assistant-add-supportniki914/zafiroSkill3404d agoMITA61Claude Code, Codex
termuxniki914/zafiroSkill3404d agoMITA36Claude Code, Codex