dev-toolbelt/dev-team-agents/current-context
Claude Code and agent skill by dev-toolbelt/dev-team-agents
- community
Checking that the SKILL.md file is still in the repository.
Detect branch, worktree session, and staged changes for devteam.
Install
npx vskill@latest install dev-toolbelt/dev-team-agents/current-contextSKILL.md
The same SKILL.md was published earlier as dev-toolbelt/dev-team-agents/current-context.
Current Context Detection
Before executing any devteam command, identify the working context so that analysis and actions stay scoped to the right branch and files.
Steps
Run these commands in order:
| Command | Purpose | |
|---|---|---|
git branch --show-current | Identify the active branch | |
git diff --name-only HEAD | List locally modified files | |
git diff --name-only main...HEAD | List all files changed in this branch vs main | |
Check .dev-team-agents/.worktree-session (if present) | Identify active worktree and its branch |
Scope Rule
Restrict all analysis and actions to files and changes within the detected context. Do NOT scan or act on the full codebase unless the task explicitly requests a broader scope.
Worktree Session
If .dev-team-agents/.worktree-session exists, read it before proceeding:
worktree=no— operating on main working tree; no worktree isolation activeworktree=yes branch=<b>— operating inside a worktree on branch<b>; loadskills/shared/worktree/SKILL.mdand follow its isolation protocol
If the file does not exist, assume the main working tree and proceed normally.
Staged Changes
Use git status --porcelain to distinguish:
M(staged modifications) — already added to the indexM(unstaged modifications) — modified but not staged??(untracked files) — new files not yet tracked
This matters when the task involves committing or reviewing only staged work.
Branch Freshness Check
After running the context commands, check if the branch is behind the remote main:
If BEHIND is greater than 7:
- Warn the user: "This branch is N commits behind main. Consider rebasing before continuing."
- Offer three options: (a) rebase now, (b) continue anyway, (c) abort.
- If the user chooses (a), run
git rebase origin/mainand re-run the context detection.
If git fetch fails (no network), skip the check silently and proceed.
Cache
Running 4 git commands on every invocation adds latency. Use a short-lived cache stored at .dev-team-agents/user-data/.context-cache.json:
Read the cache first:
Write the cache after detection:
Cache TTL is 1800 seconds (30 minutes). On cache miss, branch change, or stale cache, run the full detection flow and write a fresh cache entry. If python3 is unavailable, skip caching silently and always run the full detection.
Summary Format
After running the commands, produce a one-line context header before any action:
This makes the working scope explicit to any subsequent agent or step.
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/shared/current-context/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/dev-toolbelt/dev-team-agents/current-context)