streamlit-6-session-state
Sub-skill of streamlit: 6. Session State (+1).
Best use case
streamlit-6-session-state is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Sub-skill of streamlit: 6. Session State (+1).
Teams using streamlit-6-session-state should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/6-session-state/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How streamlit-6-session-state Compares
| Feature / Agent | streamlit-6-session-state | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Sub-skill of streamlit: 6. Session State (+1).
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# 6. Session State (+1)
## 6. Session State
**Managing State:**
```python
import streamlit as st
# Initialize state
if "counter" not in st.session_state:
st.session_state.counter = 0
if "messages" not in st.session_state:
st.session_state.messages = []
# Display current state
st.write(f"Counter: {st.session_state.counter}")
# Update state with buttons
col1, col2, col3 = st.columns(3)
if col1.button("Increment"):
st.session_state.counter += 1
st.rerun()
if col2.button("Decrement"):
st.session_state.counter -= 1
st.rerun()
if col3.button("Reset"):
st.session_state.counter = 0
st.rerun()
# State with widgets
st.text_input("Name", key="user_name")
st.write(f"Hello, {st.session_state.user_name}!")
# State callback
def on_change():
st.session_state.processed = st.session_state.raw_input.upper()
st.text_input("Raw input", key="raw_input", on_change=on_change)
if "processed" in st.session_state:
st.write(f"Processed: {st.session_state.processed}")
```
**Form State:**
```python
import streamlit as st
# Forms prevent rerunning on every widget change
with st.form("my_form"):
st.write("Submit all at once:")
name = st.text_input("Name")
age = st.number_input("Age", min_value=0, max_value=120)
color = st.selectbox("Favorite color", ["Red", "Green", "Blue"])
# Every form needs a submit button
submitted = st.form_submit_button("Submit")
if submitted:
st.success(f"Thanks {name}! You're {age} and like {color}.")
```
## 7. Multi-Page Applications
**Directory Structure:**
```
my_app/
├── app.py # Main entry point (optional)
├── pages/
│ ├── 1_📊_Dashboard.py
│ ├── 2_📈_Analytics.py
│ └── 3_⚙️_Settings.py
└── utils/
└── helpers.py
```
**Main App (app.py):**
```python
import streamlit as st
st.set_page_config(
page_title="Multi-Page App",
page_icon="🏠",
layout="wide"
)
st.title("Welcome to My App")
st.write("Use the sidebar to navigate between pages.")
# Shared state initialization
if "user" not in st.session_state:
st.session_state.user = None
```
**Page 1 (pages/1_Dashboard.py):**
```python
import streamlit as st
st.set_page_config(page_title="Dashboard", page_icon="📊")
st.title("📊 Dashboard")
st.write("This is the dashboard page")
# Access shared state
if st.session_state.get("user"):
st.write(f"Welcome back, {st.session_state.user}!")
```
**Page 2 (pages/2_Analytics.py):**
```python
import streamlit as st
st.set_page_config(page_title="Analytics", page_icon="📈")
st.title("📈 Analytics")
st.write("This is the analytics page")
# Add analytics content
```Related Skills
provider-session-ecosystem-audit-and-exporters
Build and maintain cross-provider session-log audits for Codex, Codex, Hermes, and Gemini, including exporter design, normalization, and behavioral verification.
tax-filing-session-setup-with-github-tracking
Structured workflow for preparing and tracking a tax filing session using prepared documents, task checklist, and GitHub issue cross-referencing
tax-filing-session-setup-with-github-traceability
Structured workflow for setting up a multi-file tax filing session with GitHub issue tracking and prepared-file validation
recover-from-corrupted-git-state
Diagnose and recover from corrupted git states (stale locks, failed rebases, pre-commit hook blocks) during bulk operations
multi-layer-stale-state-debugging
Detect and clear stale state persisting across multiple storage layers (auth files, cache, code logic)
handle-session-overlay-blocking
Technique for dismissing overlay dialogs that freeze rendering and block form interaction in web automation
handle-freetaxusa-session-timeouts
Recover from FreeTaxUSA session timeout dialogs blocking form submission and navigation
extract-skills-from-hermes-sessions
Automatically analyze Codex session transcripts to identify and extract reusable skills using LLM analysis via OpenRouter
extract-skills-from-Codex-sessions
Automatically extract reusable skills from Codex session transcripts using LLM analysis and wire them into a Stop hook
user-approved-plan-state-sync
Reconcile GitHub and local repo state when a plan has been user-approved, including direct approval messages that require creating the local marker and moving the issue to status:plan-approved.
session-start-dirty-state-triage-with-background-agents
Distinguish real implementation dirt from generated session-state churn when resuming a repo with active overnight/background agents.
live-state-aware-overnight-implementation-prompts
Design overnight implementation prompts that begin with a live repo/CI precheck so workers continue from partial progress instead of replaying stale handoffs.